pandas/core/base.py
def _add_delegate_accessors(cls, delegate, accessors, typ):
        """
        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'

        """

        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)

            setattr(cls,name,f)

        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'

        
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'
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 '
def _add_delegate_accessors(cls, delegate, accessors, typ):
        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)
            setattr(cls,name,f)
def _add_delegate_accessors ( cls , delegate , accessors , typ ) : 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 ) setattr ( cls , name , f )
add accessors to cls from the delegate class
Parameters
add accessors to cls from the delegate class Parameters
"""
        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'

        """
cls
delegate
accessors
typ