code: def find_head_idx(source, target):
      target_len = len(target)
      for i in range(len(source)):
          if source[i : i + target_len] == target:
              return i
      return -1
  
file_path: DeepKE/src/deepke/triple_extraction/PRGC/dataloader_utils.py
imports: import json
  import random
  from multiprocessing import Pool
  import functools
  import numpy
  from collections import defaultdict
  from itertools import chain
  import os
  from .util import Label2IdxSub, Label2IdxObj
label_desc: Use image node_id 2 for calling a global function with example usage: find_head_idx(source, target) and returns: unknown, i