def import_by_name(name, prefixes=[None]):
 tried = []
 for prefix in prefixes:
  try:
   if prefix:
    prefixed_name = '.'.join([prefix, name])
   else:
    prefixed_name = name
   (obj, parent) = _import_by_name(prefixed_name)
   return (prefixed_name, obj, parent)
  except ImportError:
   tried.append(prefixed_name)
 raise ImportError(('no module named %s' % ' or '.join(tried)))

def import_by_name ( name , prefixes = [ None ] ) : tried = [ ] for prefix in prefixes : try : if prefix : prefixed_name = '.' . join ( [ prefix , name ] ) else : prefixed_name = name ( obj , parent ) = _import_by_name ( prefixed_name ) return ( prefixed_name , obj , parent ) except ImportError : tried . append ( prefixed_name ) raise ImportError ( ( 'no module named %s' % ' or ' . join ( tried ) ) )
import a python object that has the given *name* .