code: def arrange_targets(self, tensor_dict):
      # has_answer = True if answer exists
      has_answer = tensor_dict["has_answer"]
      if not self.is_kd:
          _, _, _, _, answer_start_idx, answer_end_idx = tensor_dict[
              "squad_input"
          ]
          return answer_start_idx, answer_end_idx, has_answer
      else:
          (
              _,
              _,
              _,
              _,
              answer_start_idx,
              answer_end_idx,
              start_logits,
              end_logits,
              has_answer_logits,
          ) = tensor_dict["squad_input"]
          return (
              answer_start_idx,
              answer_end_idx,
              has_answer,
              start_logits,
              end_logits,
              has_answer_logits,
          )
  
imports: from typing import Union
  import torch
  import torch.nn
  from pytext.common.constants import Stage
  from pytext.data.squad_for_bert_tensorizer import SquadForBERTTensorizer, SquadForRoBERTaTensorizer
  from pytext.data.tensorizers import LabelTensorizer
  from pytext.data.utils import Vocabulary
  from pytext.models.bert_classification_models import NewBertModel
  from pytext.models.decoders.mlp_decoder import MLPDecoder
  from pytext.models.model import BaseModel
  from pytext.models.module import create_module
  from pytext.models.output_layers.squad_output_layer import SquadOutputLayer
  from pytext.models.representations.huggingface_bert_sentence_encoder import HuggingFaceBertSentenceEncoder
  from pytext.models.representations.huggingface_electra_sentence_encoder import HuggingFaceElectraSentenceEncoder
  from pytext.models.representations.transformer_sentence_encoder_base import TransformerSentenceEncoderBase
  from pytext.utils.usage import log_class_usage
label_desc: Use image node_id 4 for calling the BertSquadQAModel obj's underlying member method code with example usage: obj.arrange_targets(tensor_dict) and returns: answer_start_idx,  answer_end_idx,  has_answer, answer_start_idx,  answer_end_idx,  has_answer,  start_logits,  end_logits,  has_answer_logits