code: def func(start):
      # print("start")
      if args.mode == "valid":
          val_hr = np.load(
              "./dataset/wikikg90m_kddcup2021/processed/val_hr.npy",
              mmap_mode="r",
          )
          val_t_candidate = np.load(
              "./dataset/wikikg90m_kddcup2021/processed/val_t_candidate.npy",
              mmap_mode="r",
          )
      else:
          val_hr = np.load(
              "./dataset/wikikg90m_kddcup2021/processed/test_hr.npy",
              mmap_mode="r",
          )
          val_t_candidate = np.load(
              "./dataset/wikikg90m_kddcup2021/processed/test_t_candidate.npy",
              mmap_mode="r",
          )
  
      if args.relation_path is not None:
          relatioin_emb = np.load(args.relation_path, mmap_mode="r")
      entity_emb = np.load(args.tmp_path, mmap_mode="r")
  
      buf_size = 1000
      end = start + buf_size
      head = entity_emb[val_hr[start:end, 0:1]]  # B,1,H
      relation = relatioin_emb[val_hr[start:end, 1:2]]  # B,1,H
      tails = entity_emb[val_t_candidate[start:end]]  # B,1001,H
  
      if args.score_func == "TransE":
          score = transEscore(head, relation, tails)
      elif args.score_func == "RotatE":
          score = rotatEscore(head, relation, tails)
      elif args.score_func == "m2v":
          score = m2vscore(head, relation, tails)
      else:
          raise ValueError
  
      return score
  
file_path: PGL/examples/kddcup2021/WikiKG90M/post_smoothing/get_score.py
imports: import numpy
  from glob import glob
  from tqdm import tqdm
  import sys
  import argparse
  import logging
  from multiprocessing import Pool
label_desc: Use image node_id 4 for calling a global function with example usage: func(start) and returns: score