code: def copyFileToHdfs(
      localFilePath, hdfsFilePath, hdfsClient, override=True
  ):
      """Copy a local file to HDFS directory"""
      if not os.path.exists(localFilePath):
          raise Exception("Local file Path does not exist!")
      if os.path.isdir(localFilePath):
          raise Exception("localFile should not a directory!")
      if hdfsClient.exists(hdfsFilePath):
          if override:
              hdfsClient.delete(hdfsFilePath)
          else:
              return False
      try:
          hdfsClient.copy_from_local(localFilePath, hdfsFilePath)
          return True
      except Exception as exception:
          nni_log(
              LogType.Error,
              "Copy local file {0} to hdfs file {1} error: {2}".format(
                  localFilePath, hdfsFilePath, str(exception)
              ),
          )
          return False
  
imports: import os
  import posixpath
  from .log_utils import LogType, nni_log
label_desc: Use image node_id 4 for calling a global function with example usage: copyFileToHdfs(localFilePath, hdfsFilePath, hdfsClient, override) and returns: True, False, False