def namedModule(name):
 topLevel = __import__(name)
 packages = name.split('.')[1:]
 m = topLevel
 for p in packages:
  m = getattr(m, p)
 return m

def namedModule ( name ) : topLevel = __import__ ( name ) packages = name . split ( '.' ) [ 1 : ] m = topLevel for p in packages : m = getattr ( m , p ) return m
return a module given its name .