def _GetModuleOrNone(module_name):
 module = None
 if module_name:
  try:
   module = __import__(module_name)
  except ImportError:
   pass
  else:
   for name in module_name.split('.')[1:]:
    module = getattr(module, name)
 return module

def _GetModuleOrNone ( module_name ) : module = None if module_name : try : module = __import__ ( module_name ) except ImportError : pass else : for name in module_name . split ( '.' ) [ 1 : ] : module = getattr ( module , name ) return module
returns a module if it exists or none .