

def namedAny(name):
    "\n    Retrieve a Python object by its fully qualified name from the global Python\n    module namespace.  The first part of the name, that describes a module,\n    will be discovered and imported.  Each subsequent part of the name is\n    treated as the name of an attribute of the object specified by all of the\n    name which came before it.  For example, the fully-qualified name of this\n    object is 'twisted.python.reflect.namedAny'.\n\n    @type name: L{str}\n    @param name: The name of the object to return.\n\n    @raise InvalidName: If the name is an empty string, starts or ends with\n        a '.', or is otherwise syntactically incorrect.\n\n    @raise ModuleNotFound: If the name is syntactically correct but the\n        module it specifies cannot be imported because it does not appear to\n        exist.\n\n    @raise ObjectNotFound: If the name is syntactically correct, includes at\n        least one '.', but the module it specifies cannot be imported because\n        it does not appear to exist.\n\n    @raise AttributeError: If an attribute of an object along the way cannot be\n        accessed, or a module along the way is not found.\n\n    @return: the Python object identified by 'name'.\n    "
    if (not name):
        raise InvalidName('Empty module name')
    names = name.split('.')
    if ('' in names):
        raise InvalidName(("name must be a string giving a '.'-separated list of Python identifiers, not %r" % (name,)))
    topLevelPackage = None
    moduleNames = names[:]
    while (not topLevelPackage):
        if moduleNames:
            trialname = '.'.join(moduleNames)
            try:
                topLevelPackage = _importAndCheckStack(trialname)
            except _NoModuleFound:
                moduleNames.pop()
        elif (len(names) == 1):
            raise ModuleNotFound(('No module named %r' % (name,)))
        else:
            raise ObjectNotFound(('%r does not name an object' % (topLevelPackage,)))
    obj = topLevelPackage
    for n in names[1:]:
        obj = getattr(obj, n)
    return obj

dataset/ETHPy150Open Julian/jsonschema/jsonschema/_reflect.py namedAny/VarMisuse@154/714 `name`->`topLevelPackage`