code: def gen_paper_cocitation(InFile_PaperReference, norm=True):
      paper2reference_list = load_paper_reference(InFile_PaperReference)
      paper2cited_list = reverse_dict_list(paper2reference_list)
  
      pair2CocitedCnt = {}
      total_cnt, cur_cnt = len(paper2cited_list), 0
      _t0 = time.time()
      for paperid, who_cite_it_list in paper2cited_list.items():
          cur_cnt += 1
          if cur_cnt % 100 == 0:
              print(
                  "\rprocess paper num {0} / {1}...time elapses: {2:.1f}s".format(
                      cur_cnt, total_cnt, time.time() - _t0
                  ),
                  end="",
              )
          for source_paperid in who_cite_it_list:
              if source_paperid not in paper2reference_list:
                  continue
              for its_reference_list in paper2reference_list[
                  source_paperid
              ]:
                  if paperid != its_reference_list:
                      pair = (
                          (paperid, its_reference_list)
                          if paperid < its_reference_list
                          else (its_reference_list, paperid)
                      )
                      if pair not in pair2CocitedCnt:
                          pair2CocitedCnt[pair] = 0
                      pair2CocitedCnt[pair] += 1
      print("\tDone.")
  
      pair2CoReferenceCnt = {}
      total_cnt, cur_cnt = len(paper2reference_list), 0
      _t0 = time.time()
      for paperid, its_reference_list in paper2reference_list.items():
          cur_cnt += 1
          if cur_cnt % 100 == 0:
              print(
                  "\rprocess paper num {0} / {1}...time elapses: {2:.1f}s".format(
                      cur_cnt, total_cnt, time.time() - _t0
                  ),
                  end="",
              )
          for reference_paperid in its_reference_list:
              if reference_paperid not in paper2cited_list:
                  continue
              for its_cited_list in paper2cited_list[reference_paperid]:
                  if paperid != its_cited_list:
                      pair = (
                          (paperid, its_cited_list)
                          if paperid < its_cited_list
                          else (its_cited_list, paperid)
                      )
                      if pair not in pair2CoReferenceCnt:
                          pair2CoReferenceCnt[pair] = 0
                      pair2CoReferenceCnt[pair] += 1
      print("\tDone.")
  
      if norm:
          pair2CocitedCnt = normalize_score(
              pair2CocitedCnt, paper2cited_list, 10, 0.145
          )
          pair2CoReferenceCnt = normalize_score(
              pair2CoReferenceCnt, paper2reference_list, 10, 0.311
          )
  
      return pair2CocitedCnt, pair2CoReferenceCnt
  
imports: import codecs
  import pickle
  import time
  import os
  from datetime import datetime
  import random
  import numpy
  import math
  from multiprocessing import Process
  from utils.general import *
  from utils.data_helper import *
label_desc: Use image node_id 15 for calling a global function with example usage: gen_paper_cocitation(InFile_PaperReference, norm) and returns: pair2CocitedCnt,  pair2CoReferenceCnt