code: def validate_type(magic_kind):
      """Ensure that the given magic_kind is valid.
  
      Check that the given magic_kind is one of the accepted spec types (stored
      in the global `magic_spec`), raise ValueError otherwise.
      """
      if magic_kind not in magic_spec:
          raise ValueError(
              "magic_kind must be one of %s, %s given" % magic_kinds,
              magic_kind,
          )
  
imports: import os
  import re
  import sys
  from getopt import getopt, GetoptError
  from traitlets.config.configurable import Configurable
  from .None import oinspect
  from .error import UsageError
  from .inputtransformer2 import ESC_MAGIC, ESC_MAGIC2
  from ..utils.ipstruct import Struct
  from ..utils.process import arg_split
  from ..utils.text import dedent
  from traitlets import Bool, Dict, Instance, observe
  from logging import error
label_desc: Use image node_id 6 for calling a global function with example usage: validate_type(magic_kind) without return types