code: def flatten_nested_lists(L):
      """Each element of L could be a list or any object other than a list. This function
      returns a list of non-list objects, where the internal lists or lists_of_lists
      have been 'flattened'.
      """
      ret = []
      for elem in L:
          if isinstance(elem, list):
              ret.extend(flatten_nested_lists(elem))
          else:
              ret.append(elem)
      return ret
  
imports: from __future__ import print_function
  from __future__ import division
  import numpy
  from scipy.sparse import dok_matrix
  from scipy.linalg import solve_triangular
label_desc: Use image node_id 23 for calling a global function with example usage: flatten_nested_lists(L) and returns: ret