code: def _get_next_as_optional_test_combinations():
      # pylint: disable=g-long-lambda
      cases = [
          (
              "Dense",
              np.array([1, 2, 3], dtype=np.int32),
              lambda: constant_op.constant(
                  [4, 5, 6], dtype=dtypes.int32
              ),
              True,
          ),
          (
              "Sparse",
              sparse_tensor.SparseTensorValue(
                  indices=[[0, 0], [1, 1]],
                  values=np.array([-1.0, 1.0], dtype=np.float32),
                  dense_shape=[2, 2],
              ),
              lambda: sparse_tensor.SparseTensor(
                  indices=[[0, 1], [1, 0]],
                  values=[37.0, 42.0],
                  dense_shape=[2, 2],
              ),
              False,
          ),
          (
              "Nest",
              {
                  "a": np.array([1, 2, 3], dtype=np.int32),
                  "b": sparse_tensor.SparseTensorValue(
                      indices=[[0, 0], [1, 1]],
                      values=np.array([-1.0, 1.0], dtype=np.float32),
                      dense_shape=[2, 2],
                  ),
              },
              lambda: {
                  "a": constant_op.constant(
                      [4, 5, 6], dtype=dtypes.int32
                  ),
                  "b": sparse_tensor.SparseTensor(
                      indices=[[0, 1], [1, 0]],
                      values=[37.0, 42.0],
                      dense_shape=[2, 2],
                  ),
              },
              False,
          ),
      ]
  
      def reduce_fn(x, y):
          name, value, value_fn, gpu_compatible = y
          return x + combinations.combine(
              np_value=value,
              tf_value_fn=combinations.NamedObject(name, value_fn),
              gpu_compatible=gpu_compatible,
          )
  
      return functools.reduce(reduce_fn, cases, [])
  
imports: import functools
  from absl.testing import parameterized
  import numpy
  from tensorflow.python.data.kernel_tests import test_base
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.data.ops import iterator_ops
  from tensorflow.python.data.ops import optional_ops
  from tensorflow.python.data.util import structure
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import combinations
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import tensor_spec
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 2 for calling a global function with example usage: _get_next_as_optional_test_combinations() and returns: functools, unknown