code: def _convert_arrays(array, func):
      # Converts array or arrays
      if isinstance(array, (list, tuple)):
          # The same object encountered multiple times in the container is
          # converted into the same object.
          d = {}
          ret = []
          for arr in array:
              if arr is None:
                  ret.append(None)
              else:
                  arr2 = d.get(id(arr))
                  if arr2 is None:
                      arr2 = func(arr)
                      d[id(arr)] = arr2
                  ret.append(arr2)
          return type(array)(ret)
      else:
          return func(array)
  
label_desc: Use image node_id 1 for calling a global function with example usage: _convert_arrays(array, func) and returns: type, func