def get_entity(expression):
 if expression:
  namespace = sys.modules.copy()
  namespace.update(__main__.__dict__)
  try:
   return eval(expression, namespace)
  except BaseException:
   return None

def get_entity ( expression ) : if expression : namespace = sys . modules . copy ( ) namespace . update ( __main__ . __dict__ ) try : return eval ( expression , namespace ) except BaseException : return None
return the object corresponding to expression evaluated in a namespace spanning sys .