code: def gen_paper_pairs_from_same_author(
      author2paper_list,
      paper2author_list,
      paper2date,
      outfile,
      item_set,
  ):
      total_cnt, cur_cnt = len(author2paper_list), 0
      _t0 = time.time()
      with open(outfile, "w") as wt:
          for author, paper_list in author2paper_list.items():
              cur_cnt += 1
              if cur_cnt % 100 == 0:
                  print(
                      "\rprocess author num {0} / {1}...time elapses: {2:.1f}s".format(
                          cur_cnt, total_cnt, time.time() - _t0
                      ),
                      end="",
                  )
              paper_list = [p for p in paper_list if p[1] == 1]
              n = len(paper_list)
              if n <= 1:
                  continue
              for i in range(n - 1):
                  if paper_list[i][0] not in item_set:
                      continue
                  for j in range(1, n):
                      if paper_list[j][0] not in item_set:
                          continue
                      if year_delta_check(
                          paper_list[i][0], paper_list[j][0], paper2date
                      ) and author_overlap_check(
                          paper_list[i][0],
                          paper_list[j][0],
                          paper2author_list,
                      ):
                          wt.write(
                              "{0},{1}\n".format(
                                  paper_list[i][0], paper_list[j][0]
                              )
                          )
  
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 18 for calling a global function with example usage: gen_paper_pairs_from_same_author(author2paper_list, paper2author_list, paper2date, outfile, item_set) without return types