def _sentence_is_in_split(sentence_index: int, split: str) -> bool:
  """Checks if sentence with given positional index is in the split.

  In order to deterministically sample train/dev/test sentences, this function
  assumes every 9th sentence of a treebank file belongs to the development
  set, and every 10th sentence of a treebank file belongs to the test set. All
  other sentences belong to the training set.

  Args:
    sentence_index: sequential index of the sentence in the source CoNLL-U
        format treebank file (assuming first sentence has index 0).
    split: treebank split (could be 'train', 'test', 'dev').

  Returns:
    True if sentence with given positional index belongs to the specified split.
    Otherwise, returns False.
  """
  if split == "train":
    return sentence_index % 10 < 8
  elif split == "dev":
    return sentence_index % 10 == 8
  elif split == "test":
    return sentence_index % 10 == 9
  else:
    return True