code: def _reduce_method(cls, func):
          
  
          def wrapped_func(self, **kwargs):
              from .dataset import Dataset
              reduced = OrderedDict()
              for key, da in self.obj.data_vars.items():
                  if self.dim in da.dims:
                      reduced[key] = getattr(self.rollings[key],
                                             func.__name__)(**kwargs)
                  else:
                      reduced[key] = self.obj[key]
              return Dataset(reduced, coords=self.obj.coords)
          return wrapped_func
docs: Return a wrapped function for injecting numpy and bottoleneck methods.
          see ops.inject_datasetrolling_methods