def _get_split_instance(artifact_list, split):
  """Get an instance of TfxType with matching split from given list.

  Args:
    artifact_list: A list of TfxType objects whose length must be one.
    split: Name of split.

  Returns:
    The single TfxType object in artifact_list with matching split.

  Raises:
    ValueError: If number with matching split in artifact_list is not one.
  """
  matched = [x for x in artifact_list if x.split == split]
  if len(matched) != 1:
    raise ValueError('{} elements matches split {}'.format(len(matched), split))
  return matched[0]