code: def as_list(func):
      
      @wraps(func)
      def wrapper(*args, **kwargs):
          response = func(*args, **kwargs)
          if isinstance(response, Response):
              return response
          return as_json_list(
              response,
              **_serializable_params(request.args, check_groupby=True))
      return wrapper
docs: A decorator used to return a JSON response of a list of model
          objects. It expects the decorated function to return a list
          of model instances. It then converts the instances to dicts
          and serializes them into a json response
  
          Examples:
  
              >>> @app.route('/api')
              ... @as_list
              ... def list_customers():
              ...     return Customer.all()