code: def _process_gen_dict(gen_dict):
      """Process `gen_dict` key, values into `general_info`"""
      general_info = {}
      for key, value in gen_dict.items():
          # get props for this hdr field
          props = _hdr_key_dict[key]
          # turn values into meaningful dtype
          if len(props) == 2:
              # only dtype spec and no shape
              value = props[1](value)
          elif len(props) == 3:
              # array with dtype and shape
              value = np.fromstring(value, props[1], sep=" ")
              # if shape is None, allow arbitrary length
              if props[2] is not None:
                  value.shape = props[2]
          general_info[props[0]] = value
      return general_info
  
imports: import re
  import warnings
  from collections import OrderedDict
  from copy import deepcopy
  from io import StringIO
  from locale import getpreferredencoding
  import numpy
  from .affines import apply_affine, dot_reduce, from_matvec
  from .eulerangles import euler2mat
  from .fileslice import fileslice, strided_scalar
  from .nifti1 import unit_codes
  from .openers import ImageOpener
  from .spatialimages import SpatialHeader, SpatialImage
  from .volumeutils import Recoder, array_from_file
label_desc: Use image node_id 2 for calling a global function with example usage: _process_gen_dict(gen_dict) and returns: general_info