Installs a WIC on this adapter.

        :param wic_slot_id: WIC slot ID (integer)
        :param wic: WIC instance
969974
def install_wic(self, wic_slot_id, wic):
        

        self._wics[wic_slot_id] = wic

        # Dynamips WICs ports start on a multiple of 16 + port number
        # WIC1 port 1 = 16, WIC1 port 2 = 17
        # WIC2 port 1 = 32, WIC2 port 2 = 33
        # WIC3 port 1 = 48, WIC3 port 2 = 49
        base = 16 * (wic_slot_id + 1)
        for wic_port in range(0, wic.interfaces):
            port_number = base + wic_port
            self._ports[port_number] = None
1298869
def slot_add_nio_binding(self, slot_number, port_number, nio):
        

        try:
            adapter = 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 adapter is None:
            raise DynamipsError("Adapter is missing in slot {slot_number}".format(slot_number=slot_number))

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

        try:
            yield from self._hypervisor.send('vm slot_add_nio_binding "{name}" {slot_number} {port_number} {nio}'.format(name=self._name,
                                                                                                                         slot_number=slot_number,
                                                                                                                         port_number=port_number,
                                                                                                                         nio=nio))
        except DynamipsError:
            # in case of error try to remove and add the nio binding
            yield from self._hypervisor.send('vm slot_remove_nio_binding "{name}" {slot_number} {port_number}'.format(name=self._name,
                                                                                                                      slot_number=slot_number,
                                                                                                                      port_number=port_number))
            yield from self._hypervisor.send('vm slot_add_nio_binding "{name}" {slot_number} {port_number} {nio}'.format(name=self._name,
                                                                                                                         slot_number=slot_number,
                                                                                                                         port_number=port_number,
                                                                                                                         nio=nio))

        log.info('Router "{name}" [{id}]: NIO {nio_name} bound to port {slot_number}/{port_number}'.format(name=self._name,
                                                                                                           id=self._id,
                                                                                                           nio_name=nio.name,
                                                                                                           slot_number=slot_number,
                                                                                                           port_number=port_number))

        yield from self.slot_enable_nio(slot_number, port_number)
        adapter.add_nio(port_number, nio)
758200
def attach(self, id, attributes=None, touch=True):
        
        if isinstance(id, orator.orm.Model):
            id = id.get_key()

        query = self.new_pivot_statement()

        if not isinstance(id, list):
            id = [id]

        query.insert(self._create_attach_records(id, attributes))

        if touch:
            self.touch_if_touching()
658763
public function addShopWifi($shop_id, $ssid, $password = null)
    {
        $data = ['shop_id' => $shop_id, 'ssid' => $ssid, 'password' => $password];
        $url = 'https://api.weixin.qq.com/bizwifi/device/add?access_token=ACCESS_TOKEN';
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, $data);
    }
550921
def _add_device(self, scs_id, ha_id, name):
        
        if scs_id in self._devices:
            return

        self._devices[scs_id] = {
            'name': name,
            'ha_id': ha_id
        }
1227427
void tos_into_slot( int idx, String id ) {
    subRef(_ary[idx], _key[idx]);
    subRef(_fcn[idx]);
    Frame fr =                   _ary[_sp-1];
    _ary[idx] = fr==null ? null : addRef(new Frame(fr));
    _d  [idx] =                  _d  [_sp-1] ;
    _fcn[idx] =           addRef(_fcn[_sp-1]);
    _str[idx] =                  _str[_sp-1] ;
    _key[idx] = fr!=null ? id : null;
    assert _ary[0]== null || check_refcnt(_ary[0].anyVec());
  }
1061047
def attach_igw(self, req, driver):
        
        igw = driver.get_igw(req.params)
        if igw is None:
            igw = driver.create_igw(req.params)
        response = driver.attach_igw(req.params, igw)
        data = {
            'action': 'attach_igw',
            'controller': 'network',
            'id': id,
            'cloud': req.environ['calplus.cloud'],
            'response': response
        }
        return data
1083452
def install(self):
        
        items = []
        for typeName in self.types:
            it = self.store.findOrCreate(namedAny(typeName))
            installOn(it, self.store)
            items.append(str(it.storeID).decode('ascii'))
        self._items = items
411050
def slot_definition_for(self, slotname: SlotDefinitionName, cls: ClassDefinition) -> Optional[SlotDefinition]:
        
        if cls.is_a:
            for sn in self.schema.classes[cls.is_a].slots:
                slot = self.schema.slots[sn]
                if slot.alias and slotname == slot.alias or slotname == slot.name:
                    return slot
        for mixin in cls.mixins:
            for sn in self.schema.classes[mixin].slots:
                slot = self.schema.slots[sn]
                if slot.alias and slotname == slot.alias or slotname == slot.name:
                    return slot
        if cls.is_a:
            defn = self.slot_definition_for(slotname, self.schema.classes[cls.is_a])
            if defn:
                return defn
        for mixin in cls.mixins:
            defn = self.slot_definition_for(slotname, self.schema.classes[mixin])
            if defn:
                return defn
        return None
886943
def register(self, id):
        
        assert isinstance(id, basestring)
        if id in self.used_:
            #FIXME
            errors.error("common: the configuration '$(id)' is in use")

        if id not in self.all_:
            self.all_.add(id)

            # Indicate that a new configuration has been added.
            return True
        else:
            return False
709282
def add(self, provider, front=False):
        
        if provider:
            i = self.provider_id_slot(provider)
            if i is not None:
                self.providers[i] = provider

            elif front:
                self.providers.insert(0, provider)

            else:
                self.providers.append(provider)
53493
def connect(self, slot):
        
        self._ensure_slot_args(slot)
        if not self.is_connected(slot):
            self.slots.append(slot)
695466
def search_adapter_info(wid, flavour=None):
    
    t = (type(wid), flavour)
    if t in __memoize__:
        return __memoize__[t]

    for w in __def_adapter:
        if (isinstance(wid, w[WIDGET]) and flavour == w[FLAVOUR]):
            __memoize__[t] = w
            return w

    raise TypeError("Adapter type " + str(t) + " not found among supported adapters")
1138406
def add_physical_item(self, instance, item):
        
        (name, dev_type) = self.device_typename(item)
        self.topology['devices'][name] = {}
        self.topology['devices'][name]['hv_id'] = self.hv_id
        self.topology['devices'][name]['node_id'] = self.nid
        self.topology['devices'][name]['from'] = dev_type['from']
        self.topology['devices'][name]['type'] = dev_type['type']
        self.topology['devices'][name]['desc'] = dev_type['desc']

        if 'ext_conf' in dev_type:
            self.topology['devices'][name]['ext_conf'] = dev_type['ext_conf']

        for s_item in sorted(self.old_top[instance][item]):
            if self.old_top[instance][item][s_item] is not None:
                self.topology['devices'][name][s_item] = \
                    self.old_top[instance][item][s_item]

        if instance != 'GNS3-DATA' and \
                self.topology['devices'][name]['type'] == 'Router':
            if 'model' not in self.topology['devices'][name]:
                self.topology['devices'][name]['model'] = \
                    self.topology['conf'][self.hv_id]['model']
            else:
                self.topology['devices'][name]['model'] = MODEL_TRANSFORM[
                    self.topology['devices'][name]['model']]
        elif dev_type['type'] == 'VirtualBoxVM':
            self.topology['devices'][name]['vbox_id'] = self.vbox_id
            self.vbox_id += 1
        elif dev_type['type'] == 'QemuVM':
            self.topology['devices'][name]['qemu_id'] = self.qemu_id
            self.qemu_id += 1

        if instance != 'GNS3-DATA' \
            and 'hx' not in self.topology['devices'][name] \
                and 'hy' not in self.topology['devices'][name]:
            self.topology['devices'][name]['hx'] = dev_type['label_x']
            self.topology['devices'][name]['hy'] = -25.0
        self.nid += 1
628984
def add_vip_incremento(self, id):
        
        vip_map = dict()

        vip_map['id'] = id

        self.lista_vip.append(vip_map)
962541
def addWidget(self, widget, align=Qt.AlignLeft, before=None):
        
        # self.uiToolbarLAYOUT points to a deleted C/C++ object in PySide...
        layout = self.findChild(QHBoxLayout, 'uiToolbarLAYOUT')
        
        if before is not None:
            index = None
            for i in range(layout.count()):
                if layout.itemAt(i).widget() == before:
                    index = i
                    break
            
            if index is not None:
                layout.insertWidget(index, widget)
            else:
                layout.addWidget(widget)
            
        if align == Qt.AlignLeft:
            layout.insertWidget(0, widget)
        else:
            layout.addWidget(widget)
191685
def add(self, widget, condition=lambda: 42):
        

        assert callable(condition)
        assert isinstance(widget, BaseWidget)
        self._widgets.append((widget, condition))

        return widget