code: def get_hht_feat(t_candidate, hr, path):
      hht_feat = np.zeros(t_candidate.shape, dtype=np.float16)
      for i in tqdm(range(t_candidate.shape[0])):
          h1 = hr[i, 0]
          if h1 not in hh_byt_prob:
              continue
          for j in range(t_candidate.shape[1]):
              tail = t_candidate[i, j]
              if tail in t2h_prob:
                  for h2 in t2h_prob[tail]:
                      if h2 not in hh_byt_prob[h1]:
                          continue
                      prob = hh_byt_prob[h1][h2] * h2t_prob[h2][tail]
                      hht_feat[i, j] += prob
      np.save(path, hht_feat)
      return hht_feat
  
file_path: PGL/examples/kddcup2021/WikiKG90M/feature/dump_feat/5_hht_feat_byprob.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_hht_feat(t_candidate, hr, path) and returns: hht_feat