code: def TD(
      types,
      f=None,
      astype=None,
      in_=None,
      out=None,
      cfunc_alias=None,
      dispatch=None,
  ):
      """
      Generate a TypeDescription instance for each item in types
      """
      if f is not None:
          if isinstance(f, str):
              func_data = build_func_data(types, f)
          elif len(f) != len(types):
              raise ValueError("Number of types and f do not match")
          else:
              func_data = f
      else:
          func_data = (None,) * len(types)
      if isinstance(in_, str):
          in_ = (in_,) * len(types)
      elif in_ is None:
          in_ = (None,) * len(types)
      elif len(in_) != len(types):
          raise ValueError("Number of types and inputs do not match")
      if isinstance(out, str):
          out = (out,) * len(types)
      elif out is None:
          out = (None,) * len(types)
      elif len(out) != len(types):
          raise ValueError("Number of types and outputs do not match")
      tds = []
      for t, fd, i, o in zip(types, func_data, in_, out):
          # [(dispatch file name without extension '.dispatch.c*', list of types)]
          if dispatch:
              dispt = ([k for k, v in dispatch if t in v] + [None])[0]
          else:
              dispt = None
          tds.append(
              TypeDescription(
                  t,
                  f=fd,
                  in_=i,
                  out=o,
                  astype=astype,
                  cfunc_alias=cfunc_alias,
                  dispatch=dispt,
              )
          )
      return tds
  
imports: import os
  import re
  import struct
  import sys
  import textwrap
  import argparse
  import string
label_desc: Use image node_id 4 for calling a global function with example usage: TD(types, f, astype, in_, out, cfunc_alias, dispatch) and returns: tds