code: def dump_func(file_obj, node_index, node_embed):
      """paddle dump embedding
  
      输入:
  
          file_obj: 文件锁对象
          node_index: 节点ID
          node_embed: 节点embedding
          写出路径： output_path/part-%s worker-index
          写出格式: index \t label1 \t label1_score \t label2 \t label2_score
  
      """
      out = (
          static.default_main_program()
          .current_block()
          .create_var(name="dump_out", dtype="float32", shape=[1])
      )
  
      def _dump_func(vec_id, node_vec):
          """
          Dump Vectors for inference
          """
          if True:
              buffer
              file_obj.acquire()
              vec_lines = []
              for _node_id, _vec_feat in zip(
                  np.array(vec_id), np.array(node_vec)
              ):
                  _node_id = str(
                      _node_id.astype("int64").astype("uint64")[0]
                  )
                  _vec_feat = " ".join(["%.5lf" % w for w in _vec_feat])
  
                  vec_lines.append("%s\t%s\n" % (_node_id, _vec_feat))
  
              if len(vec_lines) > 0:
                  file_obj.vec_path.write("".join(vec_lines))
                  vec_lines = []
              file_obj.release()
          return np.array([1], dtype="float32")
  
      o = static.py_func(_dump_func, [node_index, node_embed], out=out)
      return o
  
imports: import os
  import sys
  import math
  import time
  import numpy
  import pickle
  import paddle
  import paddle.fluid
  import paddle.fluid.layers
  import paddle.static
  from paddle.common_ops_import import LayerHelper, check_type, check_variable_and_dtype
  from paddle.fluid.framework import Variable
  import pgl
  from pgl.utils.logger import log
label_desc: Use image node_id 3 for calling a global function with example usage: dump_func(file_obj, node_index, node_embed) and returns: o, np