code: def resampling_scheme(func):
      
  
      @functools.wraps(func)
      def modif_func(W, M=None):
          M = W.shape[0] if M is None else M
          return func(W, M)
  
      rs_funcs[func.__name__] = modif_func
      modif_func.__doc__ = rs_doc % func.__name__.capitalize()
      return modif_func
docs: Decorator for resampling schemes.