code: def encode_split_names(splits: List[str]) -> str:
      """Get the encoded representation of a list of split names."""
      rewritten_splits = []
      for split in splits:
          # TODO(b/146759051): Remove workaround for RuntimeParameter object once
          # this bug is clarified.
          if split.__class__.__name__ == "RuntimeParameter":
              logging.warning(
                  "RuntimeParameter provided for split name: this functionality may "
                  "not be supported in the future."
              )
              split = str(split)
              # Intentionally ignore split format check to pass through the template for
              # now. This behavior is very fragile and should be fixed (see
              # b/146759051).
          elif not re.match("^([A-Za-z0-9][A-Za-z0-9_-]*)?$", split):
              # TODO(ccy): Disallow empty split names once the importer removes split as
              # a property for all artifacts.
              raise ValueError(
                  "Split names are expected to be alphanumeric (allowing dashes and "
                  "underscores, provided they are not the first character); got "
                  f"{repr(split)} instead."
              )
          rewritten_splits.append(split)
      return json.dumps(rewritten_splits)
  
file_path: tfx/tfx/types/standard_artifact_utils.py
imports: import json
  import os
  import re
  from typing import List
  from absl import logging
  from packaging import version
  from tfx.types import artifact
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 4 for calling a global function with example usage: encode_split_names(splits) and returns: json