code: def test(data_set, backbone, batch_size, nfolds=10):
      print("testing verification..")
      data_list = data_set[0]
      issame_list = data_set[1]
      embeddings_list = []
      time_consumed = 0.0
      for i in range(len(data_list)):
          data = data_list[i]
          embeddings = None
          ba = 0
          while ba < data.shape[0]:
              bb = min(ba + batch_size, data.shape[0])
              count = bb - ba
              _data = data[bb - batch_size : bb]
              time0 = datetime.datetime.now()
              img = ((_data / 255) - 0.5) / 0.5
              net_out: torch.Tensor = backbone(img)
              _embeddings = net_out.detach().cpu().numpy()
              time_now = datetime.datetime.now()
              diff = time_now - time0
              time_consumed += diff.total_seconds()
              if embeddings is None:
                  embeddings = np.zeros(
                      (data.shape[0], _embeddings.shape[1])
                  )
              embeddings[ba:bb, :] = _embeddings[
                  (batch_size - count) :, :
              ]
              ba = bb
          embeddings_list.append(embeddings)
  
      _xnorm = 0.0
      _xnorm_cnt = 0
      for embed in embeddings_list:
          for i in range(embed.shape[0]):
              _em = embed[i]
              _norm = np.linalg.norm(_em)
              _xnorm += _norm
              _xnorm_cnt += 1
      _xnorm /= _xnorm_cnt
  
      embeddings = embeddings_list[0].copy()
      embeddings = sklearn.preprocessing.normalize(embeddings)
      acc1 = 0.0
      std1 = 0.0
      embeddings = embeddings_list[0] + embeddings_list[1]
      embeddings = sklearn.preprocessing.normalize(embeddings)
      print(embeddings.shape)
      print("infer time", time_consumed)
      _, _, accuracy, val, val_std, far = evaluate(
          embeddings, issame_list, nrof_folds=nfolds
      )
      acc2, std2 = np.mean(accuracy), np.std(accuracy)
      return acc1, std1, acc2, std2, _xnorm, embeddings_list
  
imports: import datetime
  import os
  import pickle
  import mxnet
  import numpy
  import sklearn
  import torch
  from mxnet import ndarray
  from scipy import interpolate
  from sklearn.decomposition import PCA
  from sklearn.model_selection import KFold
label_desc: Use image node_id 7 for calling a global function with example usage: test(data_set, backbone, batch_size, nfolds) and returns: acc1,  std1,  acc2,  std2,  _xnorm,  embeddings_list