Return the most qualified name of an object

    :param obj: object to fetch name
    :return: name of ``obj``
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))
1096955
def get_id_by_name(self, obj, name):
        
        list = self.list(obj, filter='name = "{}"'.format(name),
                         only_id=True, limit=1)
        return list[name] if name in list.keys() else False
891329
def get_unique_name(self, obj, name='', name_from_system=''):
        
        ns = self.namespace
        newname = name
        if not newname:
            newname = name_from_system

        if not newname:
            newname = u"Nameless_" + obj.__class__.__name__

        if not newname in ns:
            return newname

        counter = 0
        while True:
            newname1 = u"%s_%.2d" % (newname, counter)
            if not newname1 in ns:
                return newname1
            counter += 1
725479
def _fullqualname_method_py3(obj):
    

    if inspect.isclass(obj.__self__):
        cls = obj.__self__.__qualname__
    else:
        cls = obj.__self__.__class__.__qualname__

    return obj.__self__.__module__ + '.' + cls + '.' + obj.__name__
925400
function(obj) {
  if (isBranch(obj)) {
    return obj.name;
  } else if (isTask(obj)) {
    if (obj.path.length < 1) {
      assert(false);
    }
    return obj.path[0];
  } else {
    assert(false);
  }
}
1295189
public static String getName(Object obj) {
		try {
			return obj.getClass().getAnnotation(XmlRootElement.class).name();
		} catch (NullPointerException e) {
			return obj.getClass().getAnnotation(XmlType.class).name();
		}
	}
1136108
def _kname(obj):
    ''''''
    if isinstance(obj, dict):
        return [obj.get("metadata", {}).get("name", "")]
    elif isinstance(obj, (list, tuple)):
        names = []
        for i in obj:
            names.append(i.get("metadata", {}).get("name", ""))
        return names
    else:
        return "Unknown type"
647804
def find_obj(self, env, prefix, name, obj_type, searchorder=0):
        
        # Skip parens
        if name[-2:] == '()':
            name = name[:-2]

        if not name:
            return []

        object_types = list(self.object_types)
        if obj_type is not None:
            object_types = self.objtypes_for_role(obj_type)

        objects = self.data['objects']
        newname = None
        fullname = name
        if prefix is not None:
            fullname = '.'.join([prefix, name])

        if searchorder == 1:
            if prefix and fullname in objects and objects[fullname][1] in object_types:
                newname = fullname
            elif name in objects and objects[name][1] in object_types:
                newname = name
            else:
                try:
                    matches = [obj_name for obj_name in objects
                               if obj_name.endswith('.' + name)]
                    newname = matches.pop()
                except IndexError:
                    pass
        else:
            if name in objects:
                newname = name
            elif prefix and fullname in objects:
                newname = fullname

        if newname is None:
            return None
        return newname, objects.get(newname, (None, None))
1035327
def objname(self, obj=None):
        
        obj = obj or self.obj
        _objname = self.pretty_objname(obj, color=None)
        _objname = "'{}'".format(colorize(_objname, "blue"))
        return _objname
834491
def _get_member_ref_str(name, obj, role='obj', known_refs=None):
    """"""
    if known_refs is not None:
        if name in known_refs:
            return known_refs[name]
    ref = _get_fullname(name, obj)
    return ":%s:`%s <%s>`" % (role, name, ref)
435008
def obj_for_name(obj_name):
    
    parts = obj_name.split('.')
    module = ".".join(parts[:-1])
    m = __import__( module )
    for comp in parts[1:]:
        m = getattr(m, comp)
    return m
1369460
public static List<String> getPropertyNames(Object obj) {
		List<String> properties = new ArrayList<String>();

		Class<?> objClass = obj.getClass();

		// Get all properties
		for (Field field : objClass.getFields()) {
			if (matchField(field, field.getName()))
				properties.add(field.getName());
		}

		// Get all properties
		for (Method method : objClass.getMethods()) {
			if (method.getName().startsWith("get") && matchPropertyGetter(method, method.getName())) {
				String name = method.getName().substring(3);
				name = name.substring(0, 1).toLowerCase() + name.substring(1);
				properties.add(name);
			}
		}

		return properties;
	}
896724
function(obj) {

            this.guid.id = this.guid.id || 1;
            obj.id = (obj.id === undefined ? 'j_' + this.guid.id++ : obj.id);
            return obj.id;
        }
274937
protected QualifiedName getOrComputeFullyQualifiedName(final EObject obj) {
		return cache.get(Tuples.pair(obj, "fqn"), obj.eResource(), ()->computeFullyQualifiedName(obj));
	}
1219169
def qualified_name_import(cls):
    

    parts = qualified_name(cls).split('.')

    return "from {} import {}".format('.'.join(parts[:-1]), parts[-1])
1329428
def qualified_class_name(o):
    """"""
    module = o.__class__.__module__
    if module is None or module == str.__class__.__module__:
        return o.__class__.__name__
    return module + '.' + o.__class__.__name__
512690
def _handle_object(self, name, obj):
        
        if type(obj) in twitter_object_handlers_lookup:
            return twitter_object_handlers_lookup[type(obj)](name, obj)
        else:
            return {name: obj}