code: def import_object(path):
      
      spl = path.split('.')
      if len(spl) == 1:
          return importlib.import_module(path)
      # avoid last part for the moment
      cls = spl[-1]
      mods = '.'.join(spl[:-1])
  
      mm = importlib.import_module(mods)
      # try to get the last part as an attribute
      try:
          obj = getattr(mm, cls)
          return obj
      except AttributeError:
          pass
  
      # Try to import the last part
      rr = importlib.import_module(path)
      return rr
docs: Import an object given its fully qualified name.