code: def verification_11(
      template_norm_feats=None,
      unique_templates=None,
      p1=None,
      p2=None,
      batch_size=10000,
  ):
      try:
          print(">>>> Trying cupy.")
          import cupy as cp
  
          template_norm_feats = cp.array(template_norm_feats)
          score_func = lambda feat1, feat2: cp.sum(
              feat1 * feat2, axis=-1
          ).get()
          test = score_func(
              template_norm_feats[:batch_size],
              template_norm_feats[:batch_size],
          )
      except:
          score_func = lambda feat1, feat2: np.sum(feat1 * feat2, -1)
  
      template2id = np.zeros(max(unique_templates) + 1, dtype=int)
      template2id[unique_templates] = np.arange(len(unique_templates))
  
      steps = int(np.ceil(len(p1) / batch_size))
      score = []
      for id in tqdm(range(steps), "Verification"):
          feat1 = template_norm_feats[
              template2id[p1[id * batch_size : (id + 1) * batch_size]]
          ]
          feat2 = template_norm_feats[
              template2id[p2[id * batch_size : (id + 1) * batch_size]]
          ]
          score.extend(score_func(feat1, feat2))
      return np.array(score)
  
imports: import os
  import cv2
  import numpy
  import pandas
  from tqdm import tqdm
  from skimage import transform
  from sklearn.preprocessing import normalize
  from sklearn.metrics import roc_curve, auc
label_desc: Use image node_id 9 for calling a global function with example usage: verification_11(template_norm_feats, unique_templates, p1, p2, batch_size) and returns: np