code: def validate_callback(outputs, inputs, state, extra_args, types):
      Input, Output, State = types
      if extra_args:
          if not isinstance(extra_args[0], (Output, Input, State)):
              raise exceptions.IncorrectTypeException(
                  dedent(
                      f"""
                      Callback arguments must be `Output`, `Input`, or `State` objects,
                      optionally wrapped in a list or tuple. We found (possibly after
                      unwrapping a list or tuple):
                      {repr(extra_args[0])}
                      """
                  )
              )
  
          raise exceptions.IncorrectTypeException(
              dedent(
                  f"""
                  In a callback definition, you must provide all Outputs first,
                  then all Inputs, then all States. After this item:
                  {(outputs + inputs + state)[-1]!r}
                  we found this item next:
                  {extra_args[0]!r}
                  """
              )
          )
  
      for args in [outputs, inputs, state]:
          for arg in args:
              validate_callback_arg(arg)
  
imports: from collections.abc import MutableSequence
  import re
  from textwrap import dedent
  from keyword import iskeyword
  import flask
  from ._grouping import grouping_len, map_grouping
  from .development.base_component import Component
  from .None import exceptions
  from ._utils import patch_collections_abc, stringify_id, to_json, coerce_to_list, clean_property_name
label_desc: Use image node_id 1 for calling a global function with example usage: validate_callback(outputs, inputs, state, extra_args, types) without return types