code: def get_word_index(tokens, char_index):
      """
      Given word return word index.
      """
      for i, token in enumerate(tokens):
          if token["char_end"] == 0:
              continue
          if (
              token["char_begin"] <= char_index
              and char_index <= token["char_end"]
          ):
              return i
      return 0
  
file_path: nni/examples/trials/weight_sharing/ga_squad/data.py
imports: import csv
  import json
  from random import shuffle
  import numpy
label_desc: Use image node_id 8 for calling a global function with example usage: get_word_index(tokens, char_index) and returns: int, i