code: def augment_brackets(sents, ratio=0.1):
      """
      If there are no sentences with [], transform some () into []
      """
      new_sents = []
      for sent in sents:
          text_idx = find_text_idx(sent)
          text_line = sent[text_idx]
          if text_line.count("[") > 0 or text_line.count("]") > 0:
              # found a square bracket, so, never mind
              return sents
  
      for sent in sents:
          if random.random() > ratio:
              continue
  
          text_idx = find_text_idx(sent)
          text_line = sent[text_idx]
          if text_line.count("(") == 0 and text_line.count(")") == 0:
              continue
  
          text_line = text_line.replace("(", "[").replace(")", "]")
          new_sent = list(sent)
          new_sent[text_idx] = text_line
          for idx, line in enumerate(new_sent):
              if line.startswith("#"):
                  continue
              pieces = line.split("\t")
              if pieces[1] == "(":
                  pieces[1] = "["
              elif pieces[1] == ")":
                  pieces[1] = "]"
              new_sent[idx] = "\t".join(pieces)
          new_sents.append(new_sent)
  
      if len(new_sents) > 0:
          print(
              "Added %d sentences with parens replaced with square brackets"
              % len(new_sents)
          )
  
      return sents + new_sents
  
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 17 for calling a global function with example usage: augment_brackets(sents, ratio) and returns: unknown, sents