Returns ports list can be used by File

        File ports includes ethernet ports and link aggregation ports.
505067
def get_file_port(self):
        
        eths = self.get_ethernet_port(bond=False)
        las = self.get_link_aggregation()
        return eths + las
790547
def get_cap_files(self, *ports):
        
        cap_files = {}
        for port in ports:
            if port.cap_file_name:
                with open(port.cap_file_name) as f:
                    cap_files[port] = f.read().splitlines()
            else:
                cap_files[port] = None
        return cap_files
677650
def connected_svcports(self):
        '''

        '''
        return [p for p in self.ports \
                if p.__class__.__name__ == 'CorbaPort' and p.is_connected]
641198
def get_connections(self):
        """"""

        if float(self._dsversion) < 10:
            connections = self._extract_legacy_connection()
        else:
            connections = self._extract_federated_connections()
        return connections
785906
def available_ports(self):
        
        from mbuild.port import Port
        return [port for port in self.labels.values()
                if isinstance(port, Port) and not port.used]
728967
def getPortNumberList(self):
        
        port_list = (c_uint8 * PATH_MAX_DEPTH)()
        result = libusb1.libusb_get_port_numbers(
            self.device_p, port_list, len(port_list))
        mayRaiseUSBError(result)
        return list(port_list[:result])
1243479
def p_portlist(self, p):
        ''
        p[0] = Portlist(ports=p[2], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
40447
def getPorts(self):
        """"""
        if self.ports: # no need to get ports if ports are al
            return self.ports
        if not self._gotPorts:
            self.ports = [
                portpicker.pick_unused_port(), # game_port
                portpicker.pick_unused_port(), # base_port
                portpicker.pick_unused_port(), # shared_port / init port
            ]
            self._gotPorts = True
        return self.ports
198967
def connected_inports(self):
        '''

        '''
        return [p for p in self.ports \
                if p.__class__.__name__ == 'DataInPort' and p.is_connected]
45184
def switchport_list(self):
        """"""
        urn = "{urn:brocade.com:mgmt:brocade-interface-ext}"
        result = []
        request_interface = self.get_interface_switchport_request()
        interface_result = self._callback(request_interface, 'get')
        for interface in interface_result.findall('%sswitchport' % urn):
            vlans = []
            interface_type = self.get_node_value(interface, '%sinterface-type',
                                                 urn)
            interface_name = self.get_node_value(interface, '%sinterface-name',
                                                 urn)
            mode = self.get_node_value(interface, '%smode', urn)
            intf = interface.find('%sactive-vlans' % urn)
            for vlan_node in intf.findall('%svlanid' % urn):
                vlan = vlan_node.text
                vlans.append(vlan)
            results = {'vlan-id': vlans,
                       'mode': mode,
                       'interface-name': interface_name,
                       'interface_type': interface_type}
            result.append(results)
        return result
33347
def get_active_ports(self):
        

        if not self.resource_groups:
            return self.ports
        else:
            active_ports = OrderedDict()
            for resource_group in self.resource_groups.values():
                for active_port in resource_group.active_ports:
                    active_ports[active_port] = self.ports[active_port]
            return active_ports
649553
def get_vm_ports(port_id=None):
    """"""
    return get_ports(device_owners=[n_const.DEVICE_OWNER_COMPUTE_PREFIX,
                                    t_const.TRUNK_SUBPORT_OWNER],
                     vnic_type=portbindings.VNIC_NORMAL, port_id=port_id)
397462
def get_files (self):
        """"""
        files = []
        def add_entry (line):
            """Parse list line and add the entry it points to to the file
            list."""
            log.debug(LOG_CHECK, "Directory entry %r", line)
            from ..ftpparse import ftpparse
            fpo = ftpparse(line)
            if fpo is not None and fpo["name"]:
                name = fpo["name"]
                if fpo["trycwd"]:
                    name += "/"
                if fpo["trycwd"] or fpo["tryretr"]:
                    files.append(name)
        self.url_connection.dir(add_entry)
        return files
114740
def _get_switchports(profile):
        """"""
        switchports = []
        if profile.get('local_link_information'):
            for link in profile['local_link_information']:
                if 'switch_info' in link and 'port_id' in link:
                    switch = link['switch_info']
                    interface = link['port_id']
                    switchports.append((switch, interface))
                else:
                    LOG.warning("Incomplete link information: %s", link)
        return switchports
1228771
def list_exports(exports='/etc/exports'):
    '''
    
    '''
    ret = {}
    with salt.utils.files.fopen(exports, 'r') as efl:
        for line in salt.utils.stringutils.to_unicode(efl.read()).splitlines():
            if not line:
                continue
            if line.startswith('#'):
                continue
            comps = line.split()

            # Handle the case where the same path is given twice
            if not comps[0] in ret:
                ret[comps[0]] = []

            newshares = []
            for perm in comps[1:]:
                if perm.startswith('/'):
                    newshares.append(perm)
                    continue
                permcomps = perm.split('(')
                permcomps[1] = permcomps[1].replace(')', '')
                hosts = permcomps[0]
                if not isinstance(hosts, six.string_types):
                    # Lists, etc would silently mangle /etc/exports
                    raise TypeError('hosts argument must be a string')
                options = permcomps[1].split(',')
                ret[comps[0]].append({'hosts': hosts, 'options': options})
            for share in newshares:
                ret[share] = ret[comps[0]]
    return ret
916081
def cmd_link_ports(self):
        ''''''
        ports = mavutil.auto_detect_serial(preferred_list=['*FTDI*',"*Arduino_Mega_2560*", "*3D_Robotics*", "*USB_to_UART*", '*PX4*', '*FMU*'])
        for p in ports:
            print("%s : %s : %s" % (p.device, p.description, p.hwid))
1002541
def _comports():
    '''
    
    '''
    return (pd.DataFrame(list(map(list, serial.tools.list_ports.comports())),
                         columns=['port', 'descriptor', 'hardware_id'])
            .set_index('port'))