code: def _shift_answers(orig_answers, orig_starts, piece_start, piece_end):
      # Re-align answer index for each piece when we split a long document.
      answer_starts = []
      answers = []
      has_answer = False
      for ans, start in zip(orig_answers, orig_starts):
          if start >= piece_start and start < piece_end:
              answer_starts.append(start - piece_start)
              answers.append(ans)
              has_answer = True
      return answers, answer_starts, has_answer
  
imports: import json
  import math
  from random import choice
  from typing import List, Optional
  from pytext.data.sources.data_source import DataSource, generator_property, JSONString, SafeFileWrapper
  from pytext.data.sources.tsv import TSV
  from pytext.utils.file_io import PathManager
  from pytext.utils.path import get_absolute_path
label_desc: Use image node_id 1 for calling a global function with example usage: _shift_answers(orig_answers, orig_starts, piece_start, piece_end) and returns: answers,  answer_starts,  has_answer