code: def __getattr__(self, name: str) -> Any:
      if name not in self._extensions:
          raise AttributeError(Errors.E046.format(name=name))
      default, method, getter, setter = self._extensions[name]
      if getter is not None:
          return getter(self._obj)
      elif method is not None:
          method_partial = functools.partial(method, self._obj)
          # Hack to port over docstrings of the original function
          # See https://stackoverflow.com/q/27362727/6400719
          method_docstring = method.__doc__ or ""
          method_docstring_prefix = (
              "This method is a partial function and its first argument "
              "(the object it's called on) will be filled automatically. "
          )
          method_partial.__doc__ = (
              method_docstring_prefix + method_docstring
          )
          return method_partial
      else:
          key = self._get_key(name)
          if key in self._doc.user_data:
              return self._doc.user_data[key]
          elif isinstance(default, self.mutable_types):
              # Handle mutable default arguments (see #2581)
              new_default = copy.copy(default)
              self.__setattr__(name, new_default)
              return new_default
          return default
  
file_path: spaCy/spacy/tokens/underscore.py
imports: import copy
  import functools
  from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union
  from ..errors import Errors
label_desc: Use image node_id 3 for calling the Underscore obj's underlying member method code with example usage: obj.__getattr__(name) and returns: getter, method_partial, default, self, new_default