Add subinterface to Quartus interface

        :param buff: line buffer for output
        :param intfName: name of top interface
        :param signal: subinterface to create port for
        :param logicName: name of port in Quartus
966928
def quartus_add_interface_port(self, buff: List[str], intfName: str, signal,
                                   logicName: str, packager: "IpCorePackager"):
        
        d = signal._direction
        if d == INTF_DIRECTION.MASTER:
            dir_ = "Output"
        elif d == INTF_DIRECTION.SLAVE:
            dir_ = "Input"
        else:
            raise ValueError(d)

        _, width, _ = packager.getTypeWidth(packager.getInterfaceType(signal), do_eval=True)

        buff.append("add_interface_port %s %s %s %s %s" % (
            intfName,
            packager.getInterfacePhysicalName(signal),
            logicName,
            dir_,
            width
        ))
1246763
def add_device_net(self, name, destname=None):
        

        if not self.running:
            return False

        if os.path.exists("/sys/class/net/%s/phy80211/name" % name):
            with open("/sys/class/net/%s/phy80211/name" % name) as fd:
                phy = fd.read().strip()

            if subprocess.call(['iw', 'phy', phy, 'set', 'netns',
                                str(self.init_pid)]) != 0:
                return False

            if destname:
                def rename_interface(args):
                    old, new = args

                    return subprocess.call(['ip', 'link', 'set',
                                            'dev', old, 'name', new])

                return self.attach_wait(rename_interface, (name, destname),
                                        namespaces=(CLONE_NEWNET)) == 0

            return True

        if not destname:
            destname = name

        if not os.path.exists("/sys/class/net/%s/" % name):
            return False

        return subprocess.call(['ip', 'link', 'set',
                                'dev', name,
                                'netns', str(self.init_pid),
                                'name', destname]) == 0
138490
def addOutputPort(self, node: LNode, name: str,
                      out: Optional[Union[RtlSignalBase, LPort]],
                      side=PortSide.EAST):
        
        oPort = node.addPort(name, PortType.OUTPUT, side)
        if out is not None:
            if isinstance(out, LPort):
                self.node.addEdge(oPort, out)
            elif out.hidden:
                raise ValueError("Hidden signals should not be connected to outside", name)
            elif self.isVirtual:
                # This node is inlined inside of parent.
                # Mark that this output of subnode should be connected
                # to output of parent node.
                ctx, _ = self.netCtxs.getDefault(out)
                ctx.addDriver(oPort)
            else:
                # connect my signal to my output port
                _out = self.portCtx.getInside(out, PortType.OUTPUT)
                self.node.addEdge(oPort, _out, originObj=out)
                # mark connection of output port to parent net
                ooPort = self.portCtx.getOutside(out, PortType.OUTPUT)
                ctx, _ = self.rootNetCtxs.getDefault(out)
                ctx.addDriver(ooPort)

        return oPort
377169
def connect(self, interface, event, object_path, handler):
        
        if object_path:
            def callback(connection, sender_name, object_path,
                         interface_name, signal_name, parameters):
                return handler(*unpack_variant(parameters))
        else:
            def callback(connection, sender_name, object_path,
                         interface_name, signal_name, parameters):
                return handler(object_path, *unpack_variant(parameters))
        return self.connection.signal_subscribe(
            self.bus_name,
            interface,
            event,
            object_path,
            None,
            Gio.DBusSignalFlags.NONE,
            callback,
        )
291343
def logical_intf_helper(interface):
    
    if interface is None:
        return LogicalInterface.get_or_create(name='default_eth').href
    elif isinstance(interface, LogicalInterface):
        return interface.href
    elif interface.startswith('http'):
        return interface
    return LogicalInterface.get_or_create(name=interface).href
513279
def _ltf(ins):
    ''' 
    '''
    op1, op2 = tuple(ins.quad[2:])
    output = _float_oper(op1, op2)
    output.append('call __LTF')
    output.append('push af')
    REQUIRES.add('ltf.asm')
    return output
567759
def listens_to(name, sender=None, weak=True):
    
    def decorator(f):
        if sender:
            return signal(name).connect(f, sender=sender, weak=weak)
        return signal(name).connect(f, weak=weak)
    return decorator
1198631
@Override
    public void addCircuit(int cic, int dpc) {
        cicMap.put(getChannelID(cic, dpc), dpc);
    }
1196104
def add_interface(self, interface):
        
        if not isinstance(interface, Interface):
            raise TypeError

        self._interfaces[interface.name] = interface
883308
def register():
    ''''''
    for sig_name in _SIGNAL_HANDLERS_DB.keys():
        if not hasattr(signals, sig_name):
            _LOGGER.error((
                'The i18n_subsites plugin requires the {} '
                'signal available for sure in Pelican 3.4.0 and later, '
                'plugin will not be used.').format(sig_name))
            return

    for sig_name, handler in _SIGNAL_HANDLERS_DB.items():
        sig = getattr(signals, sig_name)
        sig.connect(handler)
400530
def _aload32(ins):
    ''' 
    '''
    output = _addr(ins.quad[2])

    output.append('call __ILOAD32')
    output.append('push de')
    output.append('push hl')

    REQUIRES.add('iload32.asm')

    return output
1283512
def _add_linux_ethernet(self, port_info, bridge_name):
        
        interface = port_info["interface"]
        if gns3server.utils.interfaces.is_interface_bridge(interface):

            network_interfaces = [interface["name"] for interface in self._interfaces()]
            i = 0
            while True:
                tap = "gns3tap{}-{}".format(i, port_info["port_number"])
                if tap not in network_interfaces:
                    break
                i += 1

            yield from self._ubridge_send('bridge add_nio_tap "{name}" "{interface}"'.format(name=bridge_name, interface=tap))
            yield from self._ubridge_send('brctl addif "{interface}" "{tap}"'.format(tap=tap, interface=interface))
        else:
            yield from self._ubridge_send('bridge add_nio_linux_raw {name} "{interface}"'.format(name=bridge_name, interface=interface))
239213
def setUp(self, port, soc, input):
        '''
        
        '''
        name = soc.getOperationName()
        bop = port.getBinding().operations.get(name)
        op = port.getBinding().getPortType().operations.get(name)

        assert op is not None, 'port has no operation %s' %name
        assert bop is not None, 'port has no binding operation %s' %name

        self.input = input
        self.op = op
        self.bop = bop
826906
def send(self, signal, plugin, **kwargs):
        
        if signal not in self.signals.keys():
            raise UnknownSignal("Unknown signal %s" % signal)
        self.__log.debug("Sending signal %s for %s" % (signal, plugin.name))
        rv = self.signals[signal].send(plugin, **kwargs)
        return rv
528772
def connect_signal_changed(self, name, function):
        
        x = self._find_parameter(name.split("/"))

        # if it pooped.
        if x==None: return None

        # connect it
        x.sigValueChanged.connect(function)
        
        # Keep track of the functions
        if name in self._connection_lists: self._connection_lists[name].append(function)
        else:                              self._connection_lists[name] = [function]

        return self
1282753
def send_signal(self, signal_name, signal_args=None):
		
		try:
			self.__queues[signal_name].push(signal_args)
			for callback in self.__direct_callbacks[signal_name]:
				if callback is not None:
					callback(self, signal_name, signal_args)
		except KeyError:
			raise WUnknownSignalException('Unknown signal "%s"' % signal_name)
1267604
def with_subchannel(f,*args):
    ""
    def f_with_update(*args):
        try:
            f(*args)
            if monitor_subchannel:
                update_subchannel_msgs(force=True)
        except AttributeError: #if kc is None
            echo("not connected to IPython", 'Error')
    return f_with_update