code: def test_resolve_payload_format_and_data_view_uri(
      self,
      payload_formats,
      data_view_uris=None,
      data_view_create_times=None,
      expected_payload_format=None,
      expected_data_view_uri=None,
      expected_error_type=None,
      expected_error_msg_regex=None,
  ):
      examples = []
      if data_view_uris is None:
          data_view_uris = [None] * len(payload_formats)
      if data_view_create_times is None:
          data_view_create_times = [None] * len(payload_formats)
      for payload_format, data_view_uri, data_view_create_time in zip(
          payload_formats, data_view_uris, data_view_create_times
      ):
          artifact = standard_artifacts.Examples()
          examples_utils.set_payload_format(artifact, payload_format)
          if data_view_uri is not None:
              artifact.set_string_custom_property(
                  constants.DATA_VIEW_URI_PROPERTY_KEY, data_view_uri
              )
          if data_view_create_time is not None:
              if isinstance(data_view_create_time, int):
                  artifact_setter_fn = artifact.set_int_custom_property
              else:
                  artifact_setter_fn = (
                      artifact.set_string_custom_property
                  )
              artifact_setter_fn(
                  constants.DATA_VIEW_CREATE_TIME_KEY,
                  data_view_create_time,
              )
          examples.append(artifact)
      if expected_error_type is None:
          (
              payload_format,
              data_view_uri,
          ) = tfxio_utils.resolve_payload_format_and_data_view_uri(
              examples
          )
          self.assertEqual(payload_format, expected_payload_format)
          self.assertEqual(data_view_uri, expected_data_view_uri)
      else:
          with self.assertRaisesRegex(
              expected_error_type, expected_error_msg_regex
          ):
              _ = tfxio_utils.resolve_payload_format_and_data_view_uri(
                  examples
              )
  
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 4 for calling the TfxioUtilsTest obj's underlying member method code with example usage: obj.test_resolve_payload_format_and_data_view_uri(payload_formats, data_view_uris, data_view_create_times, expected_payload_format, expected_data_view_uri, expected_error_type, expected_error_msg_regex) without return types