Removes an adapter NIO binding.

        :param adapter_number: adapter number

        :returns: NIO instance
351700
def adapter_remove_nio_binding(self, adapter_number):
        

        try:
            adapter = self._ethernet_adapters[adapter_number]
        except IndexError:
            raise VMwareError("Adapter {adapter_number} doesn't exist on VMware VM '{name}'".format(name=self.name,
                                                                                                    adapter_number=adapter_number))

        nio = adapter.get_nio(0)
        if isinstance(nio, NIOUDP):
            self.manager.port_manager.release_udp_port(nio.lport, self._project)
        adapter.remove_nio(0)
        if self._started and self._ubridge_hypervisor:
            yield from self._delete_ubridge_connection(adapter_number)

        log.info("VMware VM '{name}' [{id}]: {nio} removed from adapter {adapter_number}".format(name=self.name,
                                                                                                 id=self.id,
                                                                                                 nio=nio,
                                                                                                 adapter_number=adapter_number))

        return nio
1173418
def remove_nio(self, port_number):
        

        if port_number not in self._mappings:
            raise DynamipsError("Port {} is not allocated".format(port_number))

        nio = self._mappings[port_number]
        if isinstance(nio, NIOUDP):
            self.manager.port_manager.release_udp_port(nio.lport, self._project)
        yield from Bridge.remove_nio(self, nio)

        log.info('Ethernet hub "{name}" [{id}]: NIO {nio} removed from port {port}'.format(name=self._name,
                                                                                           id=self._id,
                                                                                           nio=nio,
                                                                                           port=port_number))

        del self._mappings[port_number]
        return nio
1347119
def unbind(self, ticket, device_id, user_id):
        
        return self._post(
            'unbind',
            data={
                'ticket': ticket,
                'device_id': device_id,
                'openid': user_id
            }
        )
807356
@SuppressWarnings({"unchecked", "rawtypes"})
    public T adapter(Adapter adapter) {

        if (view instanceof AdapterView) {
            AdapterView av = (AdapterView) view;
            av.setAdapter(adapter);
        }
        return self();
    }
1019135
def adapter_update_nio_binding(self, adapter_number, port_number, nio):
        

        if self.ubridge:
            yield from self._ubridge_apply_filters(adapter_number, port_number, nio.filters)
746659
def adapter
      unless @adapter_.value
        adapter = self.class.adapter_plugin_class.new
        adapter.connect! if adapter.respond_to?(:connect!)
        @adapter_.compare_and_set(nil, adapter)
        clear_cache!
      end
      @adapter_.value
    end
1285307
def slot_add_binding(self, slot_number, adapter):
        

        try:
            slot = self._slots[slot_number]
        except IndexError:
            raise DynamipsError('Slot {slot_number} does not exist on router "{name}"'.format(name=self._name, slot_number=slot_number))

        if slot is not None:
            current_adapter = slot
            raise DynamipsError('Slot {slot_number} is already occupied by adapter {adapter} on router "{name}"'.format(name=self._name,
                                                                                                                        slot_number=slot_number,
                                                                                                                        adapter=current_adapter))

        is_running = yield from self.is_running()

        # Only c7200, c3600 and c3745 (NM-4T only) support new adapter while running
        if is_running and not ((self._platform == 'c7200' and not str(adapter).startswith('C7200'))
                               and not (self._platform == 'c3600' and self.chassis == '3660')
                               and not (self._platform == 'c3745' and adapter == 'NM-4T')):
            raise DynamipsError('Adapter {adapter} cannot be added while router "{name}" is running'.format(adapter=adapter,
                                                                                                            name=self._name))

        yield from self._hypervisor.send('vm slot_add_binding "{name}" {slot_number} 0 {adapter}'.format(name=self._name,
                                                                                                         slot_number=slot_number,
                                                                                                         adapter=adapter))

        log.info('Router "{name}" [{id}]: adapter {adapter} inserted into slot {slot_number}'.format(name=self._name,
                                                                                                     id=self._id,
                                                                                                     adapter=adapter,
                                                                                                     slot_number=slot_number))

        self._slots[slot_number] = adapter

        # Generate an OIR event if the router is running
        if is_running:

            yield from self._hypervisor.send('vm slot_oir_start "{name}" {slot_number} 0'.format(name=self._name,
                                                                                                 slot_number=slot_number))

            log.info('Router "{name}" [{id}]: OIR start event sent to slot {slot_number}'.format(name=self._name,
                                                                                                 id=self._id,
                                                                                                 slot_number=slot_number))
1216946
function Devices (_adapter, _callback) {

    if (!_adapter || !_adapter.adapterDir) {
        _callback = _adapter;
        _adapter = undefined;
    }
    var that = this;
    this.list = [];

    this.setAdapter = function (_adapter) {
        adapter = _adapter;
    };
    this.has = function (id, prop) {
        var b = objects.hasOwnProperty(id);
        if (prop === undefined) return b;
        return (b && objects[id] !== null && objects[id].hasOwnProperty(prop));
    };
    this.get = function (id) {
        return (objects[id]);
    };
    this.remove = function(id) {
        delete objects[id];
    };
    this.setraw = function (id, obj) {
        objects[id] = obj;
    };

    this.getobjex = function (id) {
        var obj = this.get(id);
        if (obj || !adapter || !adapter.namespace) return obj;
        id = id.substr(adapter.namespace.length+1);
        return objects[id];
    };
    this._getobjex = function(id) {
        return this.getobjex(id) || { val: undefined };
    };
    this.getval = function (id, _default) {
         var o = this.get(id);
         if (o && o.val !== undefined) return o.val;
         return _default;
    };

    this.invalidate = function (id) {
        this._getobjex(id).val = undefined;
    };
    this.setrawval = function (id, val) {
        this._getobjex(id).val = val;
    };

    this.getKeys = function (pattern) {
        var r = new RegExp(pattern2RegEx(pattern));
        var result = [];
        for (var id in objects) {
            if (r.test(id)) result.push(id);
        }
        return result;
    };

    this.foreach = function (pattern, callback) {
        var r = new RegExp(pattern2RegEx(pattern));
        for (var id in objects) {
            if (r.test(id)) {
                if (callback (id, objects[id]) === false) {
                    return { id: id, val: objects[id]};
                }
            }
        }
    };

    this.createObjectNotExists = function (id, obj, callback) {
        var val;
        var newobj = {
            type: 'state',
            common: {
                name: id,
                type: 'string',
                role: obj.type || 'state',
                //enumerable: true
                //writable: false
            },
            native: { }
        };
        _fullExtend(newobj, obj);

        if (obj['val'] !== undefined) {
            newobj.common.type = typeof obj.val;
            val = obj.val;
            delete newobj.val;
        }
        setObjectNotExists(id, newobj, function(err, o) {
            if (!err) {
                //that.states[newobj._id] = newobj;
                objects[newobj._id] = newobj;
                if (val !== undefined) {
                    that.setState(newobj._id, val, true)
                }
            }
            safeCallback(callback, err, o);
        });
    };

    this.setState = function (id, val, ack) {
        if (val !== undefined) objects[id].val = val;
        else val = objects[id].val;
        //ack = ack || true;
		if (ack === undefined) ack=true;
        setState(id, val, ack);
    };

    this.setStateEx = function (id, newObj, ack, callback) {
        if (typeof ack === 'function') {
            callback = ack;
            ack = true
        }
        if (typeof newObj !== 'object') {
            newObj = { val: newObj };
        }
        if (ack === undefined) ack = true;
        if (!that.has(id)) {
            that.createObjectNotExists(id, newObj, callback);
        } else {
            if (objects[id].val !== newObj.val) {
                that.setState(id, newObj.val, ack);
            }
            safeCallback(callback, 0);
        }
    };

    function val2obj(valOrObj, showName) {
        //if (valOrObj === null) return;
        //if (!valOrObj) return;
        if (typeof valOrObj === 'object') {
            var obj = valOrObj || {};
        } else {
            var obj = {};
            if (valOrObj !== undefined) {
                obj.val = valtype(valOrObj);
            }
        }
        if (showName && !hasProp(obj, 'common.name')) {
            //_fullExtend(obj, { common: { name: showName}});
            _setobjname(obj, showName);
        }
        return obj;
    }

    this.updateAsync = function (list, callback) {
        if (typeof list === 'function') {
            callback = list;
            list = null;
        }
        if (!list) {
            list = that.list;
            that.list = {};
        }
        if (!list) return callback(-1);
        if (Array.isArray(list)) {
            for (var i=0; i<list.length; i++) {
                var objName = Object.keys( list[i] )[ 0 ];
                this.setStateEx(objName, list[i][objName]);
            }
        } else {
            for (var id in list) {
                this.setStateEx(id, list[id]);
            }
        }
        safeCallback(callback, 0);
    };

    this.update = function (list, callback) {
        if (typeof list === 'function') {
            callback = list;
            list = null;
        }
        if (!list || that.list === list) {
            //list = that.list;
            //that.list = [];
            //if (that.root.list) that.root.list = that.list;
            list = that.list.slice();
            that.list.length = 0;
			
        }
        if (!list || list.length == 0) return safeCallback(callback, -1);

        forEachObjSync(list, function (obj, doit) {
                that.setStateEx(obj._id, obj, true, doit);
            },
            callback
        );
    };

    function _setobjname(o, name) {
        if (o['common'] === undefined) {
            o['common'] = { name: name};
        } else {
            o.common['name'] = name;
        }
    }

    this.setObjectName = function (id, name) {
        if (!objects[id] || !objects[id].common || !objects[id].common.name) {
            var o = {common: {name: ''} };
            if (!objects[id]) {
                objects[id] = {};
            }
            _setobjname(objects[id], '');
        }
        if (objects[id].common.name !== name) {
            adapter.getObject(id, {}, function (err, obj) {
                if (err || !obj) {
                    return;
                }
                if (obj.common.name !== name) {
                    obj.common.name = name;
                    adapter.setObject(id, obj);
                }
                objects[id].common.name = name;
            });
        }
    };

    this.readAllExistingObjects = function (callback) {
        adapter.getForeignStates(adapter.namespace + '.*', {}, function(err, states) {
            if (err || !states) return callback(-1);
            var namespacelen = adapter.namespace.length + 1;
            for (var fullId in states) {
                var id = fullId.substr(namespacelen),
                    as = id.split('.'),
                    s = as[0];
                for (var i=1; i<as.length; i++) {
                    //if (!that.has(s)) that.setraw(s, { exist: true });
                    //!!
                    if (!that.has(s)) that.setraw(s, {});
                    s += '.' + as[i];
                }
                that.setraw(id, { val: states[fullId] ? states[fullId].val : null});
            }

            function setObjectProperty(obj, names, val) {
                var dot = names.indexOf('.');
                if (dot > 0) {
                    var n = names.substr(0, dot-1);
                    if (obj[n] === undefined) {
                        obj[n] = {};
                    }
                    setObjectProperty(obj[n], names.substr(dot+1), val);
                }
                obj[names] = val;
            }

            function doIt(list) {
                for (var i = 0; i < list.length; i++) {
                    var id = list[i]._id.substr(namespacelen);
                    var o = {common: {name: list[i].common.name}};
                    if (!objects[id]) {
                        objects[id] = {};
                    };
                    if (list[i].native !== undefined) {
                        o['native'] = list[i].native;
                    }
                    fullExtend(objects[id], o);
                }
            }

            adapter.getDevices(function (err, devices) {
                doIt(devices);
                adapter.getChannels('', function (err, channels) {
                    doIt(channels);
                    safeCallback(callback, 0);
                });
            });
        });
    };


    this.CDevice = function CDevice (_name, showName, list) {
        //if (!(this instanceof that.CDevice)) {
        //    return new that.CDevice(_name, showName, list);
        //}

        var deviceName = '', channelName = '';
        var self = this;
        this.list = (list === undefined) ? that.list : list;

        function push (obj) {
            for (var i=0; i<self.list.length; i++) {
                if (self.list[i]._id === obj._id) {
                    return fullExtend(self.list[i], obj);
                }
            }
            self.list.push(obj);
            return obj;
        }

        this.setDevice = function (name, options) {
            channelName = "";
            if (!name) return;
            deviceName = normalizedName (name);
            var obj = { type: 'device', _id: deviceName };
            if (options) {
                Object.assign(obj, options);
            }
            return push(obj);
        };
        this.setDevice(_name, showName && typeof showName == 'string' ? {common: {name: showName}} : showName);

        this.setObjectName = function (id, showName) {
            for (var i=0; i<self.list.length; i++) {
                if (self.list[i]._id == id) {
                    _setobjname(self.list[i], showName);
                    return i;
                }
            }
            return -1;
        };

        this.setChannel = function (name, showNameOrObject) {
            if (name === undefined) channelName = "";
            else {
                channelName = name;
                var id = dcs(deviceName, channelName);
                if (!that.has(id)) {
                    if (typeof showNameOrObject == 'object') {
                        var obj = {type: 'channel', _id: id, common: {name: name} };
                        if (showNameOrObject.common) obj.common = showNameOrObject.common;
                        if (showNameOrObject.native) obj.native = showNameOrObject.native;
                    } else {
                        var obj = {type: 'channel', _id: id, common: {name: showNameOrObject || name}};
                    }
                    return push(obj);
                }
            }
        };
        this.setChannelEx = function (name, showNameOrObject) {
            if (name === undefined) channelName = "";
            else {
                channelName = normalizedName(name);
                var id = dcs(deviceName, channelName);
                if (!that.has(id)) {
                    if (typeof showNameOrObject == 'object') {
                        var obj = {type: 'channel', _id: id, common: {name: name} };
                        if (showNameOrObject.common) obj.common = showNameOrObject.common;
                        if (showNameOrObject.native) obj.native = showNameOrObject.native;
                    } else {
                        var obj = {type: 'channel', _id: id, common: {name: showNameOrObject || name}};
                    }
                    return push(obj);
                }
            }
        };

        function split(id, valOrObj, showName) {
            var ar = ((id && id[0] == '.') ? id.substr(1) : dcs(deviceName, channelName, id)).split('.');
            var dName = deviceName, cName = channelName;
            switch(ar.length) {
                case 3:
                    self.setDevice(ar.shift());
                case 2:
                    self.setChannel(ar.shift());
                default:
                    var ret = add (ar[0], valOrObj, showName);
                    deviceName = dName;
                    channelName = cName;
                    return ret;
            }
        }

        function add (name, valOrObj, showName) {
            //if (valOrObj === null) return;
            if (valOrObj == null) return;
            if (name.indexOf('.') >= 0) {
                return split(name, valOrObj, showName);
            }
            var obj = val2obj(valOrObj, showName || name);
            obj._id = dcs(deviceName, channelName, name);
            obj.type = 'state';
            return push(obj);
        }

        function __setVal(_id, newObj) {
            var val = newObj['val'] !== undefined ? newObj.val : newObj;
            if (objects[_id].val !== val) {
                that.setState(_id, val, true);
            }
        }

        this.dset = function(d,s,v,showName) {
            var _id = dcs(d, '', s);
            if (!objects[_id]) {
                return add ('.'+_id, v, showName);
            }
            __setVal(_id, v);
        };

        this.rset = function (id, newObj, showName) {
            return this.set('.' + id, newObj, showName);
        };

        this.set = function (id, newObj, showName) {
            if (newObj == undefined) return;
            var _id = dcs(deviceName, channelName, id);
            if (!objects[_id]) {
                return add (id, newObj, showName);
            }
            var val = newObj['val'] !== undefined ? newObj.val : newObj;
            if (objects[_id].val !== val) {
                that.setState(_id, val, true);
                return true;
            }
            return false; //objects[_id];
        };
        this.setex = function (id, newObj, showName) {
            if (adapter && id.substr(0, adapter.namespace.length) == adapter.namespace) {
                id = id.substr(adapter.namespace.length+1);
            }
            return this.set(id, newObj, showName);
        };

        this.getobjex = function (id) {
            var id = dcs(deviceName, channelName, id);
            return that.getobjex(id);
        };
        this._getobjex = function(id) {
            return this.getobjex(id) || { val: undefined };
        };
        this.invalidate = function (id) {
            this._getobjex(id).val = undefined;
        };
        this.setraw = function (id, val) {
            this._getobjex(id).val = val;
        };
        this.setName = function (name) {
            var id = dcs(deviceName, channelName, '');
            that.setObjectName(id, name);
        };

        this.add = this.set;
        this.getFullId = function (id) {
            return dcs(deviceName, channelName, id);
        };
        this.get = function(channel, id) {
            if (id == undefined) {
                var _id = dcs(deviceName, channelName, channel);
            } else {
                var _id = dcs(deviceName, channel, id);
            }
            return objects[_id]
        };
        this.createNew = function (id, newObj, showName) {
            if (this.get(id)) return;
            this.set(id, newObj, showName);
        };
        this.setAndUpdate = function (id, newObj) {
            this.set(id, newObj);
            this.update();
        };
        this.setImmediately = this.setAndUpdate;

        this.clear = function(id) {
            id = exports.ns.no (id);
            var st = that.getobjex(id);
            if (st === undefined) return;
            switch(typeof st.val) {
                case 'string': st = ''; break;
                case 'boolean': st = false; break;
                case 'number': st = 0; break;
                default: return;
            }
            this.setAndUpdate(id, st);
        };
		
        this.update = function (callback) {
            if (this.list.length > 0) {
                that.update(this.list, callback);
            } else {
                safeCallback(callback);
            }
        };

    };

    this.CState = this.CDevice;
    this.root = new this.CDevice('');
    this.init = function (_adapter, callback) {
        this.setAdapter(_adapter);
        exports.ns = CNamespace(_adapter);
        this.readAllExistingObjects(callback);
    };

    if (_adapter) {
        this.init(_adapter, _callback);
    }

    return this;
}
252836
def remove_account(self, address: str):
        
        account = self.get_account_by_b58_address(address)
        if account is None:
            raise SDKException(ErrorCode.get_account_by_address_err)
        self.accounts.remove(account)
1256690
def unbind(self, exchange, source, routing_key='', nowait=True,
               arguments={}, ticket=None, cb=None):
        '''
        
        '''
        nowait = nowait and self.allow_nowait() and not cb

        args = Writer()
        args.write_short(ticket or self.default_ticket).\
            write_shortstr(exchange).\
            write_shortstr(source).\
            write_shortstr(routing_key).\
            write_bit(nowait).\
            write_table(arguments or {})
        self.send_frame(MethodFrame(self.channel_id, 40, 40, args))

        if not nowait:
            self._unbind_cb.append(cb)
            self.channel.add_synchronous_cb(self._recv_unbind_ok)
1037163
def stop_capture(self, adapter_number):
        

        try:
            adapter = self._ethernet_adapters[adapter_number]
        except KeyError:
            raise VirtualBoxError("Adapter {adapter_number} doesn't exist on VirtualBox VM '{name}'".format(name=self.name,
                                                                                                            adapter_number=adapter_number))

        nio = adapter.get_nio(0)

        if not nio:
            raise VirtualBoxError("Adapter {} is not connected".format(adapter_number))

        nio.stopPacketCapture()

        if self.ubridge:
            yield from self._ubridge_send('bridge stop_capture {name}'.format(name="VBOX-{}-{}".format(self._id, adapter_number)))

        log.info("VirtualBox VM '{name}' [{id}]: stopping packet capture on adapter {adapter_number}".format(name=self.name,
                                                                                                             id=self.id,
                                                                                                             adapter_number=adapter_number))
1070969
def adapter_remove_nio_binding(self, adapter_number, port_number):
        

        try:
            adapter = self._adapters[adapter_number]
        except IndexError:
            raise IOUError('Adapter {adapter_number} does not exist on IOU "{name}"'.format(name=self._name,
                                                                                            adapter_number=adapter_number))

        if not adapter.port_exists(port_number):
            raise IOUError("Port {port_number} does not exist in adapter {adapter}".format(adapter=adapter,
                                                                                           port_number=port_number))

        nio = adapter.get_nio(port_number)
        if isinstance(nio, NIOUDP):
            self.manager.port_manager.release_udp_port(nio.lport, self._project)
        adapter.remove_nio(port_number)
        log.info('IOU "{name}" [{id}]: {nio} removed from {adapter_number}/{port_number}'.format(name=self._name,
                                                                                                 id=self._id,
                                                                                                 nio=nio,
                                                                                                 adapter_number=adapter_number,
                                                                                                 port_number=port_number))

        if self.ubridge:
            bridge_name = "IOL-BRIDGE-{}".format(self.application_id + 512)
            yield from self._ubridge_send("iol_bridge delete_nio_udp {name} {bay} {unit}".format(name=bridge_name,
                                                                                                 bay=adapter_number,
                                                                                                 unit=port_number))

        return nio
351473
def adapter_update_nio_binding(self, adapter_number, nio):
        

        if self._ubridge_hypervisor:
            try:
                yield from self._update_ubridge_connection(adapter_number, nio)
            except IndexError:
                raise VMwareError('Adapter {adapter_number} does not exist on VMware VM "{name}"'.format(
                    name=self._name,
                    adapter_number=adapter_number
                ))
688520
def remove_watchpoint(self, addr, size, type):
        
        return self.dwt.remove_watchpoint(addr, size, type)
1021557
def get_port(self, adapter_number, port_number):
        
        for port in self.ports:
            if port.adapter_number == adapter_number and port.port_number == port_number:
                return port
        return None
345470
def unbind(exchange, opts = {})
      check_queue_deleted!

      if exchange.respond_to?(:remove_route)

        # we can do the unbinding ourselves
        exchange.remove_route opts.fetch(:routing_key, @name), self
      else

        # we need the channel to lookup the exchange
        @channel.queue_unbind self, opts.fetch(:routing_key, @name), exchange
      end
    end
870783
def uninstall_wic(self, wic_slot_number):
        

        # WICs are always installed on adapters in slot 0
        slot_number = 0

        # Do not check if slot has an adapter because adapters with WICs interfaces
        # must be inserted by default in the router and cannot be removed.
        adapter = self._slots[slot_number]

        if wic_slot_number > len(adapter.wics) - 1:
            raise DynamipsError("WIC slot {wic_slot_number} doesn't exist".format(wic_slot_number=wic_slot_number))

        if adapter.wic_slot_available(wic_slot_number):
            raise DynamipsError("No WIC is installed in WIC slot {wic_slot_number}".format(wic_slot_number=wic_slot_number))

        # Dynamips WICs slot IDs start on a multiple of 16
        # WIC1 = 16, WIC2 = 32 and WIC3 = 48
        internal_wic_slot_number = 16 * (wic_slot_number + 1)
        yield from self._hypervisor.send('vm slot_remove_binding "{name}" {slot_number} {wic_slot_number}'.format(name=self._name,
                                                                                                                  slot_number=slot_number,
                                                                                                                  wic_slot_number=internal_wic_slot_number))

        log.info('Router "{name}" [{id}]: {wic} removed from WIC slot {wic_slot_number}'.format(name=self._name,
                                                                                                id=self._id,
                                                                                                wic=adapter.wics[wic_slot_number],
                                                                                                wic_slot_number=wic_slot_number))
        adapter.uninstall_wic(wic_slot_number)