def _text_reference_reader(text_file):
  """Returns list of references in both the single and multi-reference setting.

  Performs lowercasing and white-space tokenization on each line before
  returning.

  Args:
    text_file: String filename.
  """
  single_reference_exists = os.path.isfile(text_file)

  # Check for multi-references.
  multi_reference_paths = glob.glob(text_file + "[0-9]")

  # Either the file should exist or it should correspond to multiple reference
  # files but not both.
  assert ((single_reference_exists or multi_reference_paths) and
          (not single_reference_exists or not multi_reference_paths))

  if single_reference_exists:
    references = _text_reader(text_file)
    references = [[x] for x in references]
    return references
  else:
    # In the multi-reference case, we should have 3 reference files.
    assert len(multi_reference_paths) == 3
    references0 = _text_reader(multi_reference_paths[0])
    references1 = _text_reader(multi_reference_paths[1])
    references2 = _text_reader(multi_reference_paths[2])

    assert len(references0) == len(references1)
    assert len(references0) == len(references2)
    multi_references = []
    for i in range(len(references0)):
      multi_reference = [references0[i], references1[i], references2[i]]
      multi_references.append(multi_reference)

    return multi_references
Returns list of references in both the single and multi-reference setting.

  Performs lowercasing and white-space tokenization on each line before
  returning.

  Args:
    text_file: String filename.
  
language/totto/totto_parent_eval.py