code: def put_local_files_with_prefix_to_remote(
      local_path_prefix: str, remote_dir: str
  ) -> int:
      file_list = glob.glob(local_path_prefix + "*")
      if remote_dir.startswith("hdfs"):  # hdfs://url:port/file_path
          cmd = "hdfs dfs -put -f {}* {}".format(
              local_path_prefix, remote_dir
          )
          p = subprocess.run(cmd, capture_output=True)
          if p.returncode != 0:
              logger.error("Error: {}".format(str(p.stderr)))
              return -1
          return 0
      elif remote_dir.startswith("s3"):  # s3://bucket/file_path
          access_key_id = os.environ["AWS_ACCESS_KEY_ID"]
          secret_access_key = os.environ["AWS_SECRET_ACCESS_KEY"]
          import boto3
  
          s3_client = boto3.Session(
              aws_access_key_id=access_key_id,
              aws_secret_access_key=secret_access_key,
          ).client("s3")
          path_parts = remote_dir.split("://")[1].split("/")
          bucket = path_parts.pop(0)
          prefix = "/".join(path_parts)
          local_dir = os.path.dirname(local_path_prefix)
          try:
              [
                  s3_client.upload_file(
                      os.path.join(local_dir, file),
                      bucket,
                      os.path.join(prefix, file),
                  )
                  for file in file_list
              ]
          except Exception as e:
              logger.error(str(e))
              return -1
          return 0
      else:
          if remote_dir.startswith("file://"):
              remote_dir = remote_dir[len("file://") :]
          try:
              [
                  shutil.copy(local_file, remote_dir)
                  for local_file in file_list
              ]
          except Exception as e:
              logger.error(str(e))
              return -1
          return 0
  
imports: import os
  import subprocess
  import logging
  import shutil
  import functools
  import glob
  from distutils.dir_util import copy_tree
  from bigdl.dllib.utils.log4Error import invalidOperationError
  from typing import TYPE_CHECKING, List, Callable, Union, Optional
label_desc: Use image node_id 13 for calling a global function with example usage: put_local_files_with_prefix_to_remote(local_path_prefix, remote_dir) and returns: int, unknown, int, int, unknown, unknown