parameters: (self, f, grouper=None, *args, **kwargs)
return_statement: return self._wrap_result(result)
docstring: Dispatch to _upsample; we are stripping all of the _upsample kwargs and
          performing the original function call on the grouped object.
docstring_summary: Dispatch to _upsample; we are stripping all of the _upsample kwargs and
          performing the original function call on the grouped object.
docstring_tokens: Dispatch to _upsample ; we are stripping all of the _upsample kwargs and performing the original function call on the grouped object .
function: def _apply(self, f, grouper=None, *args, **kwargs):
          """
          Dispatch to _upsample; we are stripping all of the _upsample kwargs and
          performing the original function call on the grouped object.
          """
  
          def func(x):
              x = self._shallow_copy(x, groupby=self.groupby)
  
              if isinstance(f, str):
                  return getattr(x, f)(**kwargs)
  
              return x.apply(f, *args, **kwargs)
  
          result = self._groupby.apply(func)
          return self._wrap_result(result)
function_tokens: def _apply ( self , f , grouper = None , * args , * * kwargs ) : def func ( x ) : x = self . _shallow_copy ( x , groupby = self . groupby ) if isinstance ( f , str ) : return getattr ( x , f ) ( * * kwargs ) return x . apply ( f , * args , * * kwargs ) result = self . _groupby . apply ( func ) return self . _wrap_result ( result )