code: def _flatten_list_gen(alist):
      """
      Performs a depth-first visit of an arbitrarily nested list and yields its
      element in order.
      :param alist: a list or np.array (with at least one dimension),
                    arbitrarily nested.
      """
      for item in alist:
          if isinstance(item, (list, tuple, np.ndarray)):
              for i in _flatten_list_gen(item):
                  yield i
          else:
              yield item
  
imports: import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: _flatten_list_gen(alist) without return types