code: def map_index(pieces):
      idxs = []
      for i, piece in enumerate(pieces):
          if i == 0:
              idxs.append([0, len(piece)])
          else:
              _, last = idxs[-1]
              idxs.append([last, last + len(piece)])
      return idxs
  
imports: import json
  from argparse import ArgumentParser
  from transformers import BertTokenizer, RobertaTokenizer, AutoTokenizer
label_desc: Use image node_id 1 for calling a global function with example usage: map_index(pieces) and returns: idxs