def token_drop(token_list, num_changes):
  """Drop tokens at random from the original token_list."""
  original_len = len(token_list)
  for _ in range(num_changes):
    random_index = random.randint(0, len(token_list) - 1)
    del token_list[random_index]
  assert len(token_list) == original_len - num_changes
  return token_list
Drop tokens at random from the original token_list.
language/bert_extraction/steal_bert_classifier/data_generation/preprocess_util.py