Looks up a reference from the widget based on its object name.
        
        :param      name | <str>
                    cls  | <subclass of QtGui.QObject>
        
        :return     <QtGui.QObject> || None
975179
def findReference(self, name, cls=QtGui.QWidget):
        
        return self.scene().findReference(name, cls)
1280748
def _dbus_get_object(bus_name, object_name):
    

    try:
        bus = dbus.SessionBus()
        obj = bus.get_object(bus_name, object_name)
        return obj

    except (NameError, dbus.exceptions.DBusException):
        return None
782863
def getReferenceSetByName(self, name):
        
        if name not in self._referenceSetNameMap:
            raise exceptions.ReferenceSetNameNotFoundException(name)
        return self._referenceSetNameMap[name]
1164496
def get_page_object_by_name(context, name):
    
    selected_object = None

    try:
        for obj_type in context['page']['content']:
            for obj in context['page']['content'][obj_type]:
                if obj.name == name:
                    selected_object = obj
                    break
        if selected_object is None:
            for obj_type in context['page']['content']:
                for obj in context['page']['ext_content'][obj_type]:
                    if obj.name == name:
                        selected_object = obj
                        break
    except TypeError:
        pass
    return selected_object
31816
def load_name(self, name):
        
        locator = self._make_locator()

        path = locator.find_name(name, self.search_dirs)

        return self.read(path)
604891
def find_widget(self, name):
        
        result = None
        for column in self._columns:
            for widget in column:
                if widget.name is not None and name == widget.name:
                    result = widget
                    break
        return result
385041
def _qname(self, name):
        
        if isinstance(name, QName):
            return name
        if not isinstance(name, str):
            raise TypeError("{} must be str".format(name))
        if name == '':
            return name
        if name.startswith('{'):
            return name
        prefix, tag = name.split(':', maxsplit=1)
        uri = self.NS[prefix]
        return QName(uri, tag)
375537
def get_one_optional(self, name):
        
        locator = self._locate(name)
        return self._references.get_one_optional(locator) if locator != None else None
304867
def getattr(self, name, context=None):
        
        if name in self.instance_attrs:
            return self.instance_attrs[name]
        if name in self.special_attributes:
            return [self.special_attributes.lookup(name)]
        raise exceptions.AttributeInferenceError(target=self, attribute=name)
1297399
def get_name_curr(self, name):
        
        self._register_name(name)

        return self._var_name_mappers[name].get_current()
490748
def lookup(self, name: str):
        ''''''
        # <module>
        if name in self._moduleMap:
            return self._moduleMap[name]
        # <module>.<Symbol>
        (module_name, type_name, fragment_name) = self.split_typename(name)
        if not module_name and type_name:
            click.secho('not able to lookup symbol: {0}'.format(name), fg='red')
            return None
        module = self._moduleMap[module_name]
        return module.lookup(type_name, fragment_name)
543235
def get_object(self, view_name, view_args, view_kwargs):
        
        lookup_value = view_kwargs.get(self.lookup_url_kwarg)
        parent_lookup_value = view_kwargs.get(self.parent_lookup_field)
        lookup_kwargs = {
            self.lookup_field: lookup_value,
        }
        # Try to lookup parent attr
        if parent_lookup_value:
            lookup_kwargs.update({self.parent_lookup_field: parent_lookup_value})
        return self.get_queryset().get(**lookup_kwargs)
925066
def get_object_name(object):
    

    if type(object) is property:
        return object.fget.__name__
    elif hasattr(object, "__name__"):
        return object.__name__
    elif hasattr(object, "__class__"):
        return object.__class__.__name__
    else:
        return NULL_OBJECT_NAME
423186
def getname(obj):
    
    for name_attribute in ('__qualname__', '__name__'):
        try:
            # an object always has a class, as per Python data model
            return getattr(obj, name_attribute, getattr(obj.__class__, name_attribute))
        except AttributeError:
            pass
    raise TypeError('object of type %r does not define a canonical name' % type(obj))
1071638
def load_object_by_name(obj_name):
    
    parts = obj_name.split('.')
    t = __import__('.'.join(parts[:-1]), fromlist=(parts[-1],))
    return getattr(t, parts[-1])
289961
def get_object(self, binding_name, cls):
        
        return self._state.get_object(self, binding_name, cls)
57440
def name_for(obj):
    
    if isinstance(obj, str):
        return obj

    cls = obj if isclass(obj) else obj.__class__

    if hasattr(cls, "__alias__"):
        return underscore(cls.__alias__)
    else:
        return underscore(cls.__name__)