code: def _process_ids(
      ids, n=None
  ):  # NOTE: n only needed when ids is single value
      """convert ids to list of tuples of (iterations, ids)
  
      ids is a list of ints, an int, or None
      n is target length (generally used when ids is a single-value)
      """
      if ids is None:
          return [(i,) for i in range(n)] if n else None
      if isinstance(ids, int):
          return [(i, ids) for i in range(n)] if n else ids
      if not len(ids):
          return [(i,) for i in range(n)] if n else []
      # ids is [(iter,id)] where id may be None
      if len(ids) and isinstance(ids[0], tuple):
          step = ids
      else:
          step = ids[:]
          for i, j in enumerate(ids):
              step[i] = (
                  (list(zip(*step[:i]))[1].count(j), j) if i else (i, j)
              )
      if len(ids) == ids.count(None):
          step = [(i,) for (i, j) in step]
      else:
          step = list(step)
      return step[:n]
  
imports: from mystic.tools import list_or_tuple_or_ndarray
  from mystic.tools import isNull
  import sys
label_desc: Use image node_id 5 for calling a global function with example usage: _process_ids(ids, n) and returns: step, unknown, unknown, unknown