[docs]classCachedAccessor:""" Custom property-like object. A descriptor for caching accessors. Parameters ---------- name : str Namespace that will be accessed under, e.g. ``df.foo``. accessor : cls Class with the extension methods. References ---------- .. [1] https://github.com/pandas-dev/pandas/blob/v1.1.0/pandas/core/accessor.py#L285-L289 """def__init__(self,name:str,accessor)->None:self._name=nameself._accessor=accessordef__get__(self,instance,owner):ifinstanceisNone:returnself._accessoraccessor=self._accessor(instance)object.__setattr__(instance,self._name,accessor)returnaccessor