code: def metalayerize(user_func):
      
  
      def returned(layers, *args, **kwargs):
          def begin_update(X, *args, **kwargs):
              return user_func(layers, X, *args, **kwargs)
  
          return FunctionLayer(begin_update, *args, **kwargs)
  
      return returned
docs: Wrap a function over a sequence of layers and an input into a layer.