class_docstr: Transforms an input by adding summaries of person and movies provided
  by csv.
  
  Example::
      ori: Titanic is my favorite movie
      trans: The Boys Club is my favorite movie
class_docstr_tok: ["Transforms","an","input","by","adding","summaries","of","person","and","movies","provided","by","csv",".","Example",":",":","ori",":","Titanic","is","my","favorite","movie","trans",":","The","Boys","Club","is","my","favorite","movie"]
docstr: Get the indices of the words to be replaced and the new names to
  replace them
  
  :param list tup_list: a n-tuple list to speed up searching
  :return list indices: indices of tokens that should be replaced
  :return list names: The names that correspond to indices and is
      used to replace them
docstr_tok: ["Get","the","indices","of","the","words","to","be","replaced","and","the","new","names","to","replace","them",":","param","list","tup_list",":","a","n-tuple","list","to","speed","up","searching",":","return","list","indices",":","indices","of","tokens","that","should","be","replaced",":","return","list","names",":","The","names","that","correspond","to","indices","and","is","used","to","replace","them"]
code: def _get_entity_location(self, tup_list):
      r"""
      Get the indices of the words to be replaced and the new names to
      replace them
  
      :param list tup_list: a n-tuple list to speed up searching
      :return list indices: indices of tokens that should be replaced
      :return list names: The names that correspond to indices and is
          used to replace them
      """
  
      def check_collision(index, r):
          for i, range1 in enumerate(r):
              l1, r1 = range1
              l2, r2 = index
              if max(l1, l2) < min(r1, r2):
                  return True
          return False
  
      candidates_indices = []
  
      for item in tup_list:
          current_str = item["string"]
          current_indices = item["indices"]
  
          if current_str in self.entity_dict and not check_collision(
              current_indices, candidates_indices
          ):
              candidates_indices.append(current_indices)
  
      return candidates_indices
  
file_path: textflint/textflint/generation/transformation/SA/swap_special_ent.py
imports: import random
  from ..transformation import Transformation
  from ....common.settings import SA_PERSON_PATH, SA_MOVIE_PATH
  from ....common.utils.install import download_if_needed
  from ....common.utils.load import sa_dict_loader
label_desc: Use image node_id 4 for calling the SwapSpecialEnt obj's underlying member method code with example usage: obj._get_entity_location(tup_list) and returns: candidates_indices, False, True