Return a Bus object for a certain vehicle ID `vid` using API
        instance `api`.
500571
def get(_class, api, vid):
        
        busses = api.vehicles(vid=vid)['vehicle']   
        return _class.fromapi(api, api.vehicles(vid=vid)['vehicle'])
774972
def get_by_id_or_404(self, id, **kwargs):
        """"""
        obj = self.get_by_id(id=id, **kwargs)

        if obj:
            return obj

        raise Http404
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
1129079
def get_course_video_image_url(course_id, edx_video_id):
    
    try:
        video_image = CourseVideo.objects.select_related('video_image').get(
            course_id=course_id, video__edx_video_id=edx_video_id
        ).video_image
        return video_image.image_url()
    except ObjectDoesNotExist:
        return None
26023
def signalbus(self):
        """"""

        try:
            signalbus = self.__signalbus
        except AttributeError:
            signalbus = self.__signalbus = SignalBus(self, init_app=False)
        return signalbus
885754
def getEffort(self, vehID, time, edgeID):
        
        self._connection._beginMessage(tc.CMD_GET_VEHICLE_VARIABLE,
                                       tc.VAR_EDGE_EFFORT, vehID, 1 + 4 + 1 + 4 + 1 + 4 + len(edgeID))
        self._connection._string += struct.pack(
            "!BiBi", tc.TYPE_COMPOUND, 2, tc.TYPE_INTEGER, time)
        self._connection._packString(edgeID)
        return self._connection._checkResult(tc.CMD_GET_VEHICLE_VARIABLE, tc.VAR_EDGE_EFFORT, vehID).readDouble()
118577
def gyisland(self, dae):
        """"""
        if self.system.Bus.islanded_buses:
            a = self.system.Bus.islanded_buses
            v = [self.system.Bus.n + item for item in a]
            dae.set_jac(Gy, 1e-6, a, a)
            dae.set_jac(Gy, 1e-6, v, v)
377344
def get_by_id(self, id_networkv4):
        

        uri = 'api/networkv4/%s/' % id_networkv4

        return super(ApiNetworkIPv4, self).get(uri)
6016
def get_obj(self, vimtype, name, return_all=False, path=""):
        """"""
        obj = list()
        if path:
            obj_folder = self.content.searchIndex.FindByInventoryPath(path)
            container = self.content.viewManager.CreateContainerView(
                obj_folder, vimtype, True
            )
        else:
            container = self.content.viewManager.CreateContainerView(
                self.content.rootFolder, vimtype, True)

        for c in container.view:
            if name in [c.name, c._GetMoId()]:
                if return_all is False:
                    return c
                    break
                else:
                    obj.append(c)

        if len(obj) > 0:
            return obj
        else:
            # for backwards-compat
            return None
1079002
def show_driver(devname):
    '''
    
    '''

    try:
        module = ethtool.get_module(devname)
    except IOError:
        log.error('Driver information not implemented on %s', devname)
        return 'Not implemented'

    try:
        businfo = ethtool.get_businfo(devname)
    except IOError:
        log.error('Bus information no available on %s', devname)
        return 'Not available'

    ret = {
        'driver': module,
        'bus_info': businfo,
    }

    return ret
557880
def get_descriptor_by_id(self, id, is_master_id=None):
        
        route_values = {}
        if id is not None:
            route_values['id'] = self._serialize.url('id', id, 'str')
        query_parameters = {}
        if is_master_id is not None:
            query_parameters['isMasterId'] = self._serialize.query('is_master_id', is_master_id, 'bool')
        response = self._send(http_method='GET',
                              location_id='a230389a-94f2-496c-839f-c929787496dd',
                              version='5.0-preview.1',
                              route_values=route_values,
                              query_parameters=query_parameters)
        return self._deserialize('str', response)
1236082
def busses():
    """
    return (Bus(g) for k, g in groupby(
            sorted(core.find(find_all=True), key=lambda d: d.bus),
            lambda d: d.bus))
924016
def get_title_or_id_from_uid(uid):
    
    obj = api.get_object_by_uid(uid, default=None)
    if obj is None:
        return ""
    title_or_id = api.get_title(obj) or api.get_id(obj)
    return title_or_id
677176
def get(_class, api, rt):
        
             
        if not _class.all_routes:
            _class.all_routes = _class.update_list(api, api.routes()['route'])

        return _class.all_routes[str(rt)]
536770
def get_object_by_uid(self, uid):
        
        logger.debug("get_object_by_uid::UID={}".format(uid))
        obj = api.get_object_by_uid(uid, None)
        if obj is None:
            logger.warn("!! No object found for UID #{} !!")
        return obj
54950
def request_name(self, bus_name, flags) :
        ""
        if not self._registered_bus_names_listeners :
            self.connection.bus_add_match_action \
              (
                rule = "type=signal,interface=org.freedesktop.DBus,member=NameAcquired",
                func = self._bus_name_acquired,
                user_data = self
              )
            self.connection.bus_add_match_action \
              (
                rule = "type=signal,interface=org.freedesktop.DBus,member=NameLost",
                func = self._bus_name_lost,
                user_data = self
              )
            self._registered_bus_names_listeners = True
        #end if
        return \
            self.connection.bus_request_name(bus_name, flags)
445167
def getobject(bunchdt, key, name):
    """"""
    # TODO : throw exception if more than one object, or return more objects
    idfobjects = bunchdt[key]
    if idfobjects:
        # second item in list is a unique ID
        unique_id = idfobjects[0].objls[1]
    theobjs = [idfobj for idfobj in idfobjects if
               idfobj[unique_id].upper() == name.upper()]
    try:
        return theobjs[0]
    except IndexError:
        return None