code: def _validate_expose_inputs_outputs_args(kwargs: Dict[str, BaseType]):
      """Checks format & type of arguments passed to `@expose` inputs/outputs parameters.
  
      Parameters
      ----------
      kwargs
          dict of inputs to check.
  
      Raises
      ------
      SyntaxError
          If the inputs / outputs exposed dict are invalid:
          *  Keys must be str type
      TypeError
          If the inputs / outputs exposed dict are invalid:
          *  values must be instance of `BaseType`.
      ValueError
          If the inputs / output dicts are not of length >= 1
      RuntimeError:
          If input keys passed to `@expose` do not match the corresponding
          (decorated) method parameter names. (TODO!!)
  
      Examples
      --------
      >>> from flash.core.serve.types import Number
      >>> inp = {'hello': Number()}
      >>> out = {'out': Number()}
      >>> _validate_expose_inputs_outputs_args(inp)
      >>> _validate_expose_inputs_outputs_args(out)
  
      """
      if not isinstance(kwargs, dict):
          raise TypeError(
              f"`expose` values must be {dict}. recieved {kwargs}"
          )
  
      if len(kwargs) < 1:
          raise ValueError(
              f"cannot set dict of length < 1 for field=`{field}`"
          )
  
      for k, v in kwargs.items():
          if not k.isidentifier() or iskeyword(k):
              raise SyntaxError(
                  f"`expose key={k} must be valid python attribute"
              )
          if not isinstance(v, BaseType):
              raise TypeError(
                  f"expose key {k}, v={v} must be subclass of {BaseType}"
              )
  
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 1 for calling a global function with example usage: _validate_expose_inputs_outputs_args(kwargs) without return types