code: def change_indices(line, delta):
      """
      Adjust all indices in the given sentence by delta.  Useful when removing a word, for example
      """
      if line.startswith("#"):
          return line
  
      pieces = line.split("\t")
      if MWT_RE.match(pieces[0]):
          indices = pieces[0].split("-")
          pieces[0] = "%d-%d" % (
              int(indices[0]) + delta,
              int(indices[1]) + delta,
          )
          line = "\t".join(pieces)
          return line
  
      if MWT_OR_COPY_RE.match(pieces[0]):
          index_pieces = pieces[0].split(".", maxsplit=1)
          pieces[0] = "%d.%s" % (
              int(index_pieces[0]) + delta,
              index_pieces[1],
          )
      elif not INT_RE.match(pieces[0]):
          raise NotImplementedError(
              "Unknown index type: %s" % pieces[0]
          )
      else:
          pieces[0] = str(int(pieces[0]) + delta)
      if pieces[6] != "_":
          # copy nodes don't have basic dependencies in the es_ancora treebank
          dep = int(pieces[6])
          if dep != 0:
              pieces[6] = str(int(dep) + delta)
      if pieces[8] != "_":
          dep_pieces = pieces[8].split(":", maxsplit=1)
          if DIGIT_RE.search(dep_pieces[1]):
              raise NotImplementedError(
                  "Need to handle multiple additional deps:\n%s" % line
              )
          if int(dep_pieces[0]) != 0:
              pieces[8] = (
                  str(int(dep_pieces[0]) + delta) + ":" + dep_pieces[1]
              )
      line = "\t".join(pieces)
      return line
  
imports: import argparse
  import glob
  import os
  import random
  import re
  import tempfile
  from collections import Counter
  from stanza.models.common.constant import treebank_to_short_name
  import stanza.utils.datasets.common
  from stanza.utils.datasets.common import read_sentences_from_conllu, write_sentences_to_conllu, INT_RE, MWT_RE, MWT_OR_COPY_RE
  import stanza.utils.datasets.tokenization.convert_ml_cochin
  import stanza.utils.datasets.tokenization.convert_my_alt
  import stanza.utils.datasets.tokenization.convert_vi_vlsp
  import stanza.utils.datasets.tokenization.convert_th_best
  import stanza.utils.datasets.tokenization.convert_th_lst20
  import stanza.utils.datasets.tokenization.convert_th_orchid
label_desc: Use image node_id 15 for calling a global function with example usage: change_indices(line, delta) and returns: line, line, line