code: def validate_callback_arg(arg):
      if not isinstance(getattr(arg, "component_property", None), str):
          raise exceptions.IncorrectTypeException(
              dedent(
                  f"""
                  component_property must be a string, found {arg.component_property!r}
                  """
              )
          )
  
      if hasattr(arg, "component_event"):
          raise exceptions.NonExistentEventException(
              """
              Events have been removed.
              Use the associated property instead.
              """
          )
  
      if isinstance(arg.component_id, dict):
          validate_id_dict(arg)
  
      elif isinstance(arg.component_id, str):
          validate_id_string(arg)
  
      else:
          raise exceptions.IncorrectTypeException(
              dedent(
                  f"""
                  component_id must be a string or dict, found {arg.component_id!r}
                  """
              )
          )
  
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 2 for calling a global function with example usage: validate_callback_arg(arg) without return types