code: def find_tokens_to_replace(
      wh_node_head, main_head, question_tokens, question
  ):
      redundant_tokens_to_replace = []
      question_tokens_to_replace = []
  
      if main_head:
          redundant_tokens_to_replace = find_tokens(
              [], main_head, wh_node_head
          )
      what_tokens_fnd = re.findall(
          "what (.*) (is|was|does|did) (.*)", question, re.IGNORECASE
      )
      if what_tokens_fnd:
          what_tokens = what_tokens_fnd[0][0].split()
          if len(what_tokens) <= 2:
              redundant_tokens_to_replace += what_tokens
  
      wh_node_head_desc = [
          node for node in wh_node_head.children if node.text != "?"
      ]
      wh_node_head_dep = [
          node.dep_
          for node in wh_node_head.children
          if (
              node.text != "?"
              and node.dep_ not in ["aux", "prep"]
              and node.text.lower() not in pronouns
          )
      ]
      for node in wh_node_head_desc:
          if (
              node.dep_ == "nsubj"
              and len(wh_node_head_dep) > 1
              or node.text.lower() in pronouns
              or node.dep_ == "aux"
          ):
              question_tokens_to_replace.append(node.text)
              for elem in node.subtree:
                  question_tokens_to_replace.append(elem.text)
  
      question_tokens_to_replace = list(set(question_tokens_to_replace))
  
      redundant_replace_substr = []
      for token in question_tokens:
          if token in redundant_tokens_to_replace:
              redundant_replace_substr.append(token)
          else:
              if redundant_replace_substr:
                  break
  
      redundant_replace_substr = " ".join(redundant_replace_substr)
  
      question_replace_substr = []
  
      for token in question_tokens:
          if token in question_tokens_to_replace:
              question_replace_substr.append(token)
          else:
              if question_replace_substr:
                  break
  
      question_replace_substr = " ".join(question_replace_substr)
  
      return redundant_replace_substr, question_replace_substr
  
file_path: DeepPavlov/deeppavlov/models/kbqa/sentence_answer.py
imports: import importlib
  import re
  from logging import getLogger
  import pkg_resources
  import spacy
label_desc: Use image node_id 4 for calling a global function with example usage: find_tokens_to_replace(wh_node_head, main_head, question_tokens, question) and returns: redundant_replace_substr,  question_replace_substr