code: def expose(inputs: Dict[str, BaseType], outputs: Dict[str, BaseType]):
      """Expose a function/method via a web API for serving model inference.
  
      The ``@expose`` decorator has two arguments, inputs and outputs, which
      describe how the inputs to predict are decoded from the request and how
      the outputs of predict are encoded to a response.
  
      Must decorate one (and only one) method when used within a subclass
      of ``ModelComponent``.
  
      Parameters
      ----------
      inputs
          accepts a dictionary mapping keys to decorated method parameter
          names (must be one to one mapping) with values corresponding to
          an instantiated specification of a Flash Serve Data Type (ie.
          ``Number()``, ``Image()``, ``Text()``, etc...)
      outputs
          accepts a dictionary mapping outputs of the decorated method to
          keys and data type (similar to inputs). However, unlike ``inputs``
          the output keys are less strict in their names. IF the method
          returns a dictionary, the keys must match one-to-one. However, if
          the method returns a sorted sequence (list / tuple) the keys can be
          arbitrary, so long as no reserved names are used (primarily python
          keywords). For result sequences, the order in which keys are defined
          maps to the appropriate element index in the result (ie.
          ``key 0 -> sequence[0]``, ``key 1 -> sequence[1]``, etc.)
  
      TODO
      ----
      *  Examples in the docstring.
  
      """
      _validate_expose_inputs_outputs_args(inputs)
      _validate_expose_inputs_outputs_args(outputs)
  
      def wrapper(fn):
          @wraps(fn)
          def wrapped(func):
              func.flashserve_meta = UnboundMeta(
                  exposed=func, inputs=inputs, outputs=outputs
              )
              return func
  
          return wrapped(fn)
  
      return wrapper
  
file_path: lightning-flash/src/flash/core/serve/decorators.py
imports: from dataclasses import dataclass, field, fields
  from functools import partial, wraps
  from keyword import iskeyword
  from types import FunctionType, MethodType
  from typing import Dict, List, Sequence, Tuple, Union
  from uuid import uuid4
  from flash.core.serve.core import Connection, ParameterContainer, Servable, make_param_dict, make_parameter_container
  from flash.core.serve.types.base import BaseType
  from flash.core.serve.utils import fn_outputs_to_keyed_map
  from flash.core.utilities.imports import _CYTOOLZ_AVAILABLE, _TOPIC_SERVE_AVAILABLE
label_desc: Use image node_id 2 for calling a global function with example usage: expose(inputs, outputs) and returns: wrapper, wrapped, func