code: def make_arrays(funcdict):
      # functions array contains an entry for every type implemented NULL
      # should be placed where PyUfunc_ style function will be filled in
      # later
      code1list = []
      code2list = []
      dispdict = {}
      names = sorted(funcdict.keys())
      for name in names:
          uf = funcdict[name]
          funclist = []
          datalist = []
          siglist = []
          k = 0
          sub = 0
  
          for t in uf.type_descriptions:
              cfunc_alias = t.cfunc_alias if t.cfunc_alias else name
              cfunc_fname = None
              if t.func_data is FullTypeDescr:
                  tname = english_upper(chartoname[t.type])
                  datalist.append("(void *)NULL")
                  if t.out == "?":
                      cfunc_fname = (
                          f"{tname}_{t.in_}_bool_{cfunc_alias}"
                      )
                  else:
                      cfunc_fname = (
                          f"{tname}_{t.in_}_{t.out}_{cfunc_alias}"
                      )
              elif isinstance(t.func_data, FuncNameSuffix):
                  datalist.append("(void *)NULL")
                  tname = english_upper(chartoname[t.type])
                  cfunc_fname = (
                      f"{tname}_{cfunc_alias}_{t.func_data.suffix}"
                  )
              elif t.func_data is None:
                  datalist.append("(void *)NULL")
                  tname = english_upper(chartoname[t.type])
                  cfunc_fname = f"{tname}_{cfunc_alias}"
              else:
                  try:
                      thedict = arity_lookup[uf.nin, uf.nout]
                  except KeyError as e:
                      raise ValueError(
                          f"Could not handle {name}[{t.type}] "
                          f"with nin={uf.nin}, nout={uf.nout}"
                      ) from None
  
                  astype = ""
                  if not t.astype is None:
                      astype = "_As_%s" % thedict[t.astype]
                  astr = "%s_functions[%d] = PyUFunc_%s%s;" % (
                      name,
                      k,
                      thedict[t.type],
                      astype,
                  )
                  code2list.append(astr)
                  if t.type == "O":
                      astr = "%s_data[%d] = (void *) %s;" % (
                          name,
                          k,
                          t.func_data,
                      )
                      code2list.append(astr)
                      datalist.append("(void *)NULL")
                  elif t.type == "P":
                      datalist.append('(void *)"%s"' % t.func_data)
                  else:
                      astr = "%s_data[%d] = (void *) %s;" % (
                          name,
                          k,
                          t.func_data,
                      )
                      code2list.append(astr)
                      datalist.append("(void *)NULL")
                      # datalist.append('(void *)%s' % t.func_data)
                  sub += 1
  
              if cfunc_fname:
                  funclist.append(cfunc_fname)
                  if t.dispatch:
                      dispdict.setdefault(t.dispatch, []).append(
                          (name, k, cfunc_fname, t.in_ + t.out)
                      )
              else:
                  funclist.append("NULL")
  
              for x in t.in_ + t.out:
                  siglist.append(
                      "NPY_%s" % (english_upper(chartoname[x]),)
                  )
  
              k += 1
  
          if funclist or siglist or datalist:
              funcnames = ", ".join(funclist)
              signames = ", ".join(siglist)
              datanames = ", ".join(datalist)
              code1list.append(
                  "static PyUFuncGenericFunction %s_functions[] = {%s};"
                  % (name, funcnames)
              )
              code1list.append(
                  "static void * %s_data[] = {%s};" % (name, datanames)
              )
              code1list.append(
                  "static char %s_signatures[] = {%s};"
                  % (name, signames)
              )
              uf.empty = False
          else:
              uf.empty = True
  
      for dname, funcs in dispdict.items():
          code2list.append(
              textwrap.dedent(
                  f"""
              #ifndef NPY_DISABLE_OPTIMIZATION
              #include "{dname}.dispatch.h"
              #endif
          """
              )
          )
          for ufunc_name, func_idx, cfunc_name, inout in funcs:
              code2list.append(
                  textwrap.dedent(
                      f"""\
                  NPY_CPU_DISPATCH_TRACE("{ufunc_name}", "{''.join(inout)}");
                  NPY_CPU_DISPATCH_CALL_XB({ufunc_name}_functions[{func_idx}] = {cfunc_name});
              """
                  )
              )
      return "\n".join(code1list), "\n".join(code2list)
  
imports: import os
  import re
  import struct
  import sys
  import textwrap
  import argparse
  import string
label_desc: Use image node_id 7 for calling a global function with example usage: make_arrays(funcdict) and returns: str,  str