code: def _flatten_nested_list(x):
      """
      Recursively flatten the list
      """
      if not isinstance(x, (tuple, list)):
          return [x]
  
      return reduce(lambda a, y: a + _flatten_nested_list(y), x, [])
  
imports: from functools import reduce
  import numpy
  import tensorflow
  import pennylane
  from pennylane.measurements import SampleMP, StateMP
  from .tensorflow import _compute_vjp, _jac_restructured, _res_restructured, _to_tensors, set_parameters_on_copy_and_unwrap
label_desc: Use image node_id 1 for calling a global function with example usage: _flatten_nested_list(x) and returns: reduce, list