code: def _shift(
      hypo_tokens: List[str], ref_tokens: List[str]
  ) -> Tuple[int, List[str]]:
      candidates = {}
      for h_ofs, r_ofs, length in _find_pairs(hypo_tokens, ref_tokens):
          new = hypo_tokens[:h_ofs] + hypo_tokens[h_ofs + length :]
          new = (
              new[:r_ofs]
              + hypo_tokens[h_ofs : h_ofs + length]
              + new[r_ofs:]
          )
          new_n_edits = get_edit_distance(new, ref_tokens)
          candidates[new_n_edits] = new
      if len(candidates) == 0:
          return get_edit_distance(hypo_tokens, ref_tokens), hypo_tokens
      best = sorted(candidates)[0]
      return best, candidates[best]
  
file_path: vizseq/vizseq/scorers/_ter.py
imports: from typing import List, Tuple
  from functools import lru_cache
label_desc: Use image node_id 4 for calling a global function with example usage: _shift(hypo_tokens, ref_tokens) and returns: best,  candidates, get_edit_distance,  hypo_tokens