code: def ResolveSplitsConfig(
      splits_config_str: Optional[str], examples: List[types.Artifact]
  ) -> transform_pb2.SplitsConfig:
      """Resolve SplitsConfig proto for the transfrom request."""
      result = transform_pb2.SplitsConfig()
      if splits_config_str:
          proto_utils.json_to_proto(splits_config_str, result)
          if not result.analyze:
              raise ValueError(
                  "analyze cannot be empty when splits_config is set."
              )
          return result
  
      result.analyze.append("train")
  
      # All input artifacts should have the same set of split names.
      split_names = set(
          artifact_utils.decode_split_names(examples[0].split_names)
      )
  
      for artifact in examples:
          artifact_split_names = set(
              artifact_utils.decode_split_names(artifact.split_names)
          )
          if split_names != artifact_split_names:
              raise ValueError(
                  "Not all input artifacts have the same split names: (%s, %s)"
                  % (split_names, artifact_split_names)
              )
  
      result.transform.extend(split_names)
      logging.info(
          "Analyze the 'train' split and transform all splits when "
          "splits_config is not set."
      )
      return result
  
file_path: tfx/tfx/components/transform/executor_utils.py
imports: import functools
  import os
  from typing import Any, Callable, Dict, List, Mapping, Optional, Sequence
  from absl import logging
  from tfx import types
  from tfx.components.transform import labels
  from tfx.components.util import value_utils
  from tfx.proto import transform_pb2
  from tfx.types import artifact_utils
  from tfx.types import standard_component_specs
  from tfx.utils import json_utils
  from tfx.utils import proto_utils
label_desc: Use image node_id 4 for calling a global function with example usage: ResolveSplitsConfig(splits_config_str, examples) and returns: result, result