def namedAny(name):
 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' % (name,)))
 obj = topLevelPackage
 for n in names[1:]:
  obj = getattr(obj, n)
 return obj

def namedAny ( name ) : 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' % ( name , ) ) ) obj = topLevelPackage for n in names [ 1 : ] : obj = getattr ( obj , n ) return obj
retrieve a python object by its fully qualified name from the global python module namespace .