Returns an (addr, name, COD) device tuple from a IOBluetoothDevice object.
328463
def _getdevicetuple(iobtdevice):
    
    addr = _macutil.formatdevaddr(iobtdevice.getAddressString())
    name = iobtdevice.getName()
    cod = iobtdevice.getClassOfDevice()
    return (addr, name, cod)
253141
def _device_to_sysfs_path(device):
    """"""
    return '%s-%s' % (
        device.getBusNumber(),
        '.'.join([str(item) for item in device.GetPortNumberList()]))
356458
def _get_binary_from_ipv4(self, ip_addr):
        """"""

        return struct.unpack("!L", socket.inet_pton(socket.AF_INET,
                                                    ip_addr))[0]
545092
def GetDevicePath(device_handle):
  
  # Obtain device path from IO Registry
  io_service_obj = iokit.IOHIDDeviceGetService(device_handle)
  str_buffer = ctypes.create_string_buffer(DEVICE_PATH_BUFFER_SIZE)
  iokit.IORegistryEntryGetPath(io_service_obj, K_IO_SERVICE_PLANE, str_buffer)

  return str_buffer.value
499324
def get_device_name(file_name, sys_obj_id, delimiter=":"):
    

    try:
        with open(file_name, "rb") as csv_file:
            csv_reader = csv.reader(csv_file, delimiter=delimiter)
            for row in csv_reader:
                if len(row) >= 2 and row[0] == sys_obj_id:
                    return row[1]
    except IOError:
        pass  # file does not exists

    return sys_obj_id
175133
def GetRawDevice(path):
  """"""
  device_map = GetMountpoints()

  path = utils.SmartUnicode(path)
  mount_point = path = utils.NormalizePath(path, "/")

  result = rdf_paths.PathSpec(pathtype=rdf_paths.PathSpec.PathType.OS)

  # Assign the most specific mount point to the result
  while mount_point:
    try:
      result.path, fs_type = device_map[mount_point]
      if fs_type in [
          "ext2", "ext3", "ext4", "vfat", "ntfs", "Apple_HFS", "hfs", "msdos"
      ]:
        # These are read filesystems
        result.pathtype = rdf_paths.PathSpec.PathType.OS
      else:
        result.pathtype = rdf_paths.PathSpec.PathType.UNSET

      # Drop the mount point
      path = utils.NormalizePath(path[len(mount_point):])

      return result, path
    except KeyError:
      mount_point = os.path.dirname(mount_point)
1294350
def get_device_info(self, bigip):
        '''
        '''

        coll = bigip.tm.cm.devices.get_collection()
        device = [device for device in coll if device.selfDevice == 'true']
        assert len(device) == 1
        return device[0]
848211
def get_devices(filename, bundled):
    

    loader = Loader(filename, bundled)

    data = loader.data

    devices = Devices()

    # Iterate through the resources and generate each individual device
    # on demand.

    for resource_name, resource_dict in data.get('resources', {}).items():
        device_name = resource_dict['device']

        dd = loader.get_device_dict(device_name,
                                    resource_dict.get('filename', None),
                                    resource_dict.get('bundled', False),
                                    SPEC_VERSION_TUPLE[0])

        devices.add_device(resource_name,
                           get_device(device_name, dd, loader, resource_dict))

    return devices
1279676
def name(self):
		

		pchar = self._libinput.libinput_device_get_name(self._handle)
		return string_at(pchar).decode()
141896
def show_devices(verbose=False, **kwargs):
    
    kwargs["find_all"] = True
    devices = find(**kwargs)
    strings = ""
    for device in devices:
        if not verbose:
            strings +=  "%s, %s\n" % (device._str(), _try_lookup(
                _lu.device_classes, device.bDeviceClass))
        else:
            strings += "%s\n\n" % str(device)

    return _DescriptorInfo(strings)
1021969
def get_operation_device(self, operation_name):
    
    operation = self._name_to_operation(operation_name)
    if isinstance(operation, tf.Operation):
      return operation.device
    else:  # mtf.Operation
      return None
747452
def _get_usb_device(self, skip=0):
        
        try:
            # PyUSB >= 1.0, this is a workaround for a problem with libusbx
            # on Windows.
            import usb.core
            import usb.legacy
            devices = [usb.legacy.Device(d) for d in usb.core.find(
                find_all=True, idVendor=YUBICO_VID)]
        except ImportError:
            # Using PyUsb < 1.0.
            import usb
            devices = [d for bus in usb.busses() for d in bus.devices]
        for device in devices:
            if device.idVendor == YUBICO_VID:
                if device.idProduct in PID.all(otp=True):
                    if skip == 0:
                        return device
                    skip -= 1
        return None
678599
def devices(self):
        
        data = self.query(MyPlexDevice.key)
        return [MyPlexDevice(self, elem) for elem in data]
560486
def get_dfu_devices(*args, **kwargs):
    
    # convert to list for compatibility with newer pyusb
    return list(usb.core.find(*args, find_all=True,
                              custom_match=FilterDFU(), **kwargs))
129896
def DbGetExportdDeviceListForClass(self, argin):
        
        self._log.debug("In DbGetExportdDeviceListForClass()")
        argin = replace_wildcard(argin)
        return self.db.get_exported_device_list_for_class(argin)
1234605
def get_device_address(device):
    
    if device is None:
        return None
    command = ['ip', 'route', 'list', 'dev', device]
    ip_routes = subprocess.check_output(command).strip()
    for line in ip_routes.split('\n'):
        seen = ''
        for a in line.split():
            if seen == 'src':
                return a
            seen = a
    return None
33334
def recover_devices(cls):
        

        if "_devices" in globals():
            return

        global _devices
        confs_dir = os.path.abspath(os.path.normpath(cfg.CONF.dhcp_confs))
        for netid in os.listdir(confs_dir):
            conf_dir = os.path.join(confs_dir, netid)
            intf_filename = os.path.join(conf_dir, 'interface')
            try:
                with open(intf_filename, 'r') as f:
                    ifname = f.read()
                _devices[netid] = ifname
            except IOError:
                LOG.error('Unable to read interface file: %s',
                          intf_filename)
            LOG.debug("Recovered device %s for network %s'",
                      ifname, netid)