class_docstr: an abstract base class for delegating methods/properties
docstr: Add accessors to cls from the delegate class.
  
  Parameters
  ----------
  cls : the class to add the methods/properties to
  delegate : the class to get methods/properties & doc-strings
  acccessors : string list of accessors to add
  typ : 'property' or 'method'
  overwrite : boolean, default False
     overwrite the method/property in the target class if it exists
docstr_tok: ["Add","accessors","to","cls","from","the","delegate","class",".","Parameters","--","--","--","--","--","cls",":","the","class","to","add","the","methods\/properties","to","delegate",":","the","class","to","get","methods\/properties","&","doc-strings","acccessors",":","string","list","of","accessors","to","add","typ",":","'property","'","or","'method'","overwrite",":","boolean",",","default","False","overwrite","the","method\/property","in","the","target","class","if","it","exists"]
code: def _add_delegate_accessors(
      cls, delegate, accessors, typ, overwrite=False
  ):
      """
      Add accessors to cls from the delegate class.
  
      Parameters
      ----------
      cls : the class to add the methods/properties to
      delegate : the class to get methods/properties & doc-strings
      acccessors : string list of accessors to add
      typ : 'property' or 'method'
      overwrite : boolean, default False
         overwrite the method/property in the target class if it exists
      """
  
      def _create_delegator_property(name):
          def _getter(self):
              return self._delegate_property_get(name)
  
          def _setter(self, new_values):
              return self._delegate_property_set(name, new_values)
  
          _getter.__name__ = name
          _setter.__name__ = name
  
          return property(
              fget=_getter,
              fset=_setter,
              doc=getattr(delegate, name).__doc__,
          )
  
      def _create_delegator_method(name):
          def f(self, *args, **kwargs):
              return self._delegate_method(name, *args, **kwargs)
  
          f.__name__ = name
          f.__doc__ = getattr(delegate, name).__doc__
  
          return f
  
      for name in accessors:
          if typ == "property":
              f = _create_delegator_property(name)
          else:
              f = _create_delegator_method(name)
  
          # don't overwrite existing methods/properties
          if overwrite or not hasattr(cls, name):
              setattr(cls, name, f)
  
imports: import warnings
  from pandas.util._decorators import Appender
label_desc: Use image node_id 4 for calling the PandasDelegate obj's underlying member method code with example usage: obj._add_delegate_accessors(cls, delegate, accessors, typ, overwrite) and returns: property, f, self, self, self