code: def excute_func(tid, lock):
      """execute func"""
      while 1:
          lock.acquire()
          hdfs_file_list = []
          with open(".download_locker") as f:
              hdfs_file_list = json.load(f)
          if len(hdfs_file_list) == 0:
              lock.release()
              break
          hdfs_file = hdfs_file_list[0]
          del hdfs_file_list[0]
          with open(".download_locker", "w") as f:
              json.dump(hdfs_file_list, f)
          lock.release()
          print(
              "[%s][%d] download file[%s], remain %s..."
              % (
                  time.strftime(
                      "%Y-%m-%d %H:%M:%S", time.localtime(time.time())
                  ),
                  tid,
                  hdfs_file,
                  len(hdfs_file_list),
              )
          )
          hdfs_file_ls = hdfs_file.split("/")
          cmd = hadoop_fs + " -get %s %s/%s/%s" % (
              hdfs_file,
              base_graph_data_path,
              hdfs_file_ls[-2],
              hdfs_file_ls[-1],
          )
          if os.system(cmd) != 0:
              print(
                  "[%s][%d] exec cmd:[%s] fail, please check!"
                  % (
                      time.strftime(
                          "%Y-%m-%d %H:%M:%S",
                          time.localtime(time.time()),
                      ),
                      tid,
                      cmd,
                  )
              )
              exit(-1)
          print(
              "[%s][%d] download file[%s] finished"
              % (
                  time.strftime(
                      "%Y-%m-%d %H:%M:%S", time.localtime(time.time())
                  ),
                  tid,
                  hdfs_file,
              )
          )
          sys.stdout.flush()
  
file_path: PGL/apps/PGLBox/scripts/download_graph_data.py
imports: import os
  import sys
  import math
  import time
  import json
  import subprocess
  import multiprocessing
  from multiprocessing import Process
  from multiprocessing import Lock
label_desc: Use image node_id 4 for calling a global function with example usage: excute_func(tid, lock) without return types