code: def type(self):
          
          builtin_descriptors = {"classmethod", "staticmethod"}
  
          for decorator in self.extra_decorators:
              if decorator.func.name in builtin_descriptors:
                  return decorator.func.name
  
          frame = self.parent.frame()
          type_name = "function"
          if isinstance(frame, ClassDef):
              if self.name == "__new__":
                  return "classmethod"
              if sys.version_info >= (3, 6) and self.name == "__init_subclass__":
                  return "classmethod"
  
              type_name = "method"
  
          if not self.decorators:
              return type_name
  
          for node in self.decorators.nodes:
              if isinstance(node, node_classes.Name):
                  if node.name in builtin_descriptors:
                      return node.name
  
              if isinstance(node, node_classes.Call):
                  # Handle the following case:
                  # @some_decorator(arg1, arg2)
                  # def func(...)
                  #
                  try:
                      current = next(node.func.infer())
                  except exceptions.InferenceError:
                      continue
                  _type = _infer_decorator_callchain(current)
                  if _type is not None:
                      return _type
  
              try:
                  for inferred in node.infer():
                      # Check to see if this returns a static or a class method.
                      _type = _infer_decorator_callchain(inferred)
                      if _type is not None:
                          return _type
  
                      if not isinstance(inferred, ClassDef):
                          continue
                      for ancestor in inferred.ancestors():
                          if not isinstance(ancestor, ClassDef):
                              continue
                          if ancestor.is_subtype_of("%s.classmethod" % BUILTINS):
                              return "classmethod"
                          if ancestor.is_subtype_of("%s.staticmethod" % BUILTINS):
                              return "staticmethod"
              except exceptions.InferenceError:
                  pass
          return type_name
docs: The function type for this node.
  
          Possible values are: method, function, staticmethod, classmethod.
  
          :type: str