code: def generated_search_src_sequence(
      generated, src_sequence, end_sequence_search_tokens=None
  ):
      if len(generated) == 0:
          # All src tokens are valid before generation
          return src_sequence
  
      matched_tuples = match_sublist(
          the_list=src_sequence, to_match=generated
      )
  
      valid_token = list()
      for _, end in matched_tuples:
          next_index = end + 1
          if next_index < len(src_sequence):
              valid_token += [src_sequence[next_index]]
  
      if end_sequence_search_tokens:
          valid_token += end_sequence_search_tokens
  
      return valid_token
  
file_path: DeepKE/src/deepke/name_entity_re/cross/seq2seq/constraint_decoder/constraint_decoder.py
imports: from collections import defaultdict
  import os
  from typing import List
label_desc: Use image node_id 5 for calling a global function with example usage: generated_search_src_sequence(generated, src_sequence, end_sequence_search_tokens) and returns: valid_token, src_sequence