def eval_import(s):
 if (':' not in s):
  return simple_import(s)
 (module_name, expr) = s.split(':', 1)
 module = import_module(module_name)
 obj = eval(expr, module.__dict__)
 return obj

def eval_import ( s ) : if ( ':' not in s ) : return simple_import ( s ) ( module_name , expr ) = s . split ( ':' , 1 ) module = import_module ( module_name ) obj = eval ( expr , module . __dict__ ) return obj
import a module .