code: def get_hdfs_client(args):
      global _hdfs_client
  
      if _hdfs_client is not None:
          return _hdfs_client
      # backward compatibility
      hdfs_host = None
  
      if args.hdfs_host:
          hdfs_host = args.hdfs_host
      elif args.pai_hdfs_host:
          hdfs_host = args.pai_hdfs_host
      else:
          return None
  
      if hdfs_host is not None and args.nni_hdfs_exp_dir is not None:
          try:
              if args.webhdfs_path:
                  _hdfs_client = HdfsClient(
                      hosts="{0}:80".format(hdfs_host),
                      user_name=args.pai_user_name,
                      webhdfs_path=args.webhdfs_path,
                      timeout=5,
                  )
              else:
                  # backward compatibility
                  _hdfs_client = HdfsClient(
                      hosts="{0}:{1}".format(hdfs_host, "50070"),
                      user_name=args.pai_user_name,
                      timeout=5,
                  )
          except Exception as e:
              nni_log(
                  LogType.Error, "Create HDFS client error: " + str(e)
              )
              raise e
      return _hdfs_client
  
imports: import argparse
  import ctypes
  import json
  import logging
  import os
  import re
  import shlex
  import sys
  import threading
  import time
  from subprocess import Popen
  import pkg_resources
  from pyhdfs import HdfsClient
  from .constants import LOG_DIR, MULTI_PHASE, NNI_EXP_ID, NNI_PLATFORM, NNI_SYS_DIR, NNI_TRIAL_JOB_ID
  from .hdfsClientUtility import copyDirectoryToHdfs, copyHdfsDirectoryToLocal, copyHdfsFileToLocal
  from .log_utils import LogType, RemoteLogger, StdOutputType, nni_log
  from .rest_utils import rest_get, rest_post
  from .url_utils import gen_parameter_meta_url, gen_send_version_url
label_desc: Use image node_id 1 for calling a global function with example usage: get_hdfs_client(args) and returns: _hdfs_client, _hdfs_client, None