code: def _add_factory_condition_to_test_cases(
      test_cases: List[Dict[Any, Any]]
  ):
      """Adds use_factory = True/False to test cases."""
  
      def copy_with_factory_setting(d: Dict[Any, Any], factory: bool):
          result = d.copy()
          result["testcase_name"] = d["testcase_name"] + (
              "nofactory" if factory else ""
          )
          result["use_factory"] = factory
          return result
  
      result = [
          copy_with_factory_setting(tc, False) for tc in test_cases
      ]
      result += [
          copy_with_factory_setting(tc, True) for tc in test_cases
      ]
      return result
  
imports: import inspect
  import tempfile
  from typing import Any, Callable, Dict, Iterator, List
  from absl.testing import parameterized
  import pyarrow
  import tensorflow
  from tfx.components.experimental.data_view import constants
  from tfx.components.util import examples_utils
  from tfx.components.util import tfxio_utils
  from tfx.proto import example_gen_pb2
  from tfx.types import standard_artifacts
  from tfx_bsl.coders import tf_graph_record_decoder
  from tfx_bsl.tfxio import parquet_tfxio
  from tfx_bsl.tfxio import raw_tf_record
  from tfx_bsl.tfxio import record_based_tfxio
  from tfx_bsl.tfxio import record_to_tensor_tfxio
  from tfx_bsl.tfxio import tf_example_record
  from tfx_bsl.tfxio import tf_sequence_example_record
  from google.protobuf import text_format
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: _add_factory_condition_to_test_cases(test_cases) and returns: result, result