code: def join_src(conf):
      """
      Input:
          src \t 0 \t indegree ; nfeat
          src \t runs \t dst0 \t rela0 \t direct0
          src \t runs \t dst1 \t rela1 \t direct1
          src \t runs \t dst2 \t rela2 \t direct2
  
      Output:
          src \t 0 \t indegree ; nfeat
          dst0 \t runs \t indegree ; src0_nfeat \t rela0 \t direct0
          dst1 \t runs \t indegree ; src1_nfeat \t rela1 \t direct1
  
      """
      src_feat = None
      last_src = None
      for line in sys.stdin:
          # src, mode, dst_or_src_feat = line.strip('\r\n').split("\t")
          fields = line.strip("\r\n").split("\t")
          src, mode = fields[0], fields[1]
          if last_src != src:
              src_feat = None
          last_src = src
  
          if mode != "0":
              if src_feat is not None:
                  # sys.stdout.write("%s\t%s\t%s\n" % (dst_or_src_feat, mode, src_feat))
                  dst, r_type, direct = fields[2], fields[3], fields[4]
                  sys.stdout.write(
                      "%s\t%s\t%s\t%s\t%s\n"
                      % (dst, mode, src_feat, r_type, direct)
                  )
  
          elif mode == "0":
              src_feat = fields[2]
              sys.stdout.write(line.strip("\r\n") + "\n")
  
file_path: PGL/examples/kddcup2021/WikiKG90M/post_smoothing/rotate/hadoop_prep.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  from __future__ import absolute_import
  import sys
  import yaml
  from easydict import EasyDict
  import argparse
  import numpy
  import json
  import six
label_desc: Use image node_id 5 for calling a global function with example usage: join_src(conf) without return types