def import_dotted_path(path):
 try:
  (module_path, member_name) = path.rsplit(u'.', 1)
  module = import_module(module_path)
  return getattr(module, member_name)
 except (ValueError, ImportError, AttributeError) as e:
  raise ImportError((u'Could not import the name: %s: %s' % (path, e)))

def import_dotted_path ( path ) : try : ( module_path , member_name ) = path . rsplit ( u'.' , 1 ) module = import_module ( module_path ) return getattr ( module , member_name ) except ( ValueError , ImportError , AttributeError ) as e : raise ImportError ( ( u'Could not import the name: %s: %s' % ( path , e ) ) )
takes a dotted path to a member name in a module .