code: def get_object_name(obj):
      
      name_dispatch = {
          ast.Name: "id",
          ast.Attribute: "attr",
          ast.Call: "func",
          ast.FunctionDef: "name",
          ast.ClassDef: "name",
          ast.Subscript: "value",
      }
  
      # This is a new ast type in Python 3
      if hasattr(ast, "arg"):
          name_dispatch[ast.arg] = "arg"
  
      while not isinstance(obj, str):
          assert type(obj) in name_dispatch
          obj = getattr(obj, name_dispatch[type(obj)])
  
      return obj
docs: Return the name of a given object