code: def _ravel(in_val):
      if not isinstance(in_val, list):
          return in_val
      flat_list = []
      for val in in_val:
          raveled_val = _ravel(val)
          if isinstance(raveled_val, list):
              flat_list.extend(raveled_val)
          else:
              flat_list.append(raveled_val)
      return flat_list
  
imports: import os
  import re
  import numpy
  from ..base import traits, TraitedSpec, DynamicTraitedSpec, File, Undefined, isdefined, OutputMultiPath, InputMultiPath, BaseInterface, BaseInterfaceInputSpec, Str, SimpleInterface
  from ..io import IOBase, add_traits
  from ...utils.filemanip import ensure_list, copyfile, split_filename
label_desc: Use image node_id 1 for calling a global function with example usage: _ravel(in_val) and returns: flat_list, in_val