code: def testNestFlatten(
      self, structure, expected, paths, expand_composites=True
  ):
      result = nest.flatten(
          structure, expand_composites=expand_composites
      )
      self.assertEqual(result, expected)
  
      result_with_paths = nest.flatten_with_tuple_paths(
          structure, expand_composites=expand_composites
      )
      self.assertEqual(result_with_paths, list(zip(paths, expected)))
  
      string_paths = [
          "/".join(str(p) for p in path) for path in paths
      ]  # pylint: disable=g-complex-comprehension
      result_with_string_paths = nest.flatten_with_joined_string_paths(
          structure, expand_composites=expand_composites
      )
      self.assertEqual(
          result_with_string_paths, list(zip(string_paths, expected))
      )
  
      flat_paths_result = list(
          nest.yield_flat_paths(
              structure, expand_composites=expand_composites
          )
      )
      self.assertEqual(flat_paths_result, paths)
  
imports: import gc
  import sys
  import weakref
  from absl.testing import parameterized
  import numpy
  from tensorflow.python.framework import composite_tensor
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import indexed_slices
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.framework import test_util
  from tensorflow.python.framework import type_spec
  from tensorflow.python.ops.ragged import ragged_factory_ops
  from tensorflow.python.platform import googletest
  from tensorflow.python.util import nest
label_desc: Use image node_id 1 for calling the CompositeTensorTest obj's underlying member method code with example usage: obj.testNestFlatten(structure, expected, paths, expand_composites) without return types