code: def flatten_list(alist):
      """
      Flattens an arbitrarily nested list to 1D.
      :param alist: a list or np.array (with at least one dimension),
                    arbitrarily nested.
      :return: a 1D Python list with the flattened elements as returned by a
               depth-first search.
      """
      return list(_flatten_list_gen(alist))
  
imports: import numpy
label_desc: Use image node_id 5 for calling a global function with example usage: flatten_list(alist) and returns: list