code: def get_t2h_h2t_feat(t_candidate, hr, path):
      t2h_h2t_feat = np.zeros(t_candidate.shape, dtype=np.float16)
      for i in tqdm(range(t_candidate.shape[0])):
          h = hr[i, 0]
          if h not in t2h_prob:
              continue
          for j in range(t_candidate.shape[1]):
              tail = t_candidate[i, j]
              if tail not in t2h_prob:
                  continue
              for e in t2h_prob[h]:
                  if e not in t2h_prob[tail]:
                      continue
                  prob = t2h_prob[h][e] * h2t_prob[e][tail]
                  t2h_h2t_feat[i][j] += prob
      np.save(path, t2h_h2t_feat)
      return t2h_h2t_feat
  
file_path: PGL/examples/kddcup2021/WikiKG90M/feature/dump_feat/3_t2h_h2t_feat.py
imports: from __future__ import division
  from __future__ import absolute_import
  from __future__ import print_function
  from __future__ import unicode_literals
  import sys
  import argparse
  import logging
  import numpy
  import pickle
  from tqdm import tqdm
  import math
  from multiprocessing import Pool
label_desc: Use image node_id 1 for calling a global function with example usage: get_t2h_h2t_feat(t_candidate, hr, path) and returns: t2h_h2t_feat