code: def get_attr(name):
      
      i = name.rfind('.')
      cls = str(name[i+1:])
      module = str(name[:i])
  
      mod = __import__(module, fromlist=[cls])
      return getattr(mod, cls)
docs: get a class or function by name