code: def get_remote_file_to_local(
      remote_path: str,
      local_path: str,
      over_write: Optional[bool] = False,
  ) -> int:
      if remote_path.startswith("hdfs"):  # hdfs://url:port/file_path
          return file_utils.get_remote_file_to_local(
              remote_path=remote_path,
              local_path=local_path,
              over_write=over_write,
          )
      elif remote_path.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_path.split("://")[1].split("/")
          bucket = path_parts.pop(0)
          key = "/".join(path_parts)
          try:
              s3_client.download_file(bucket, key, local_path)
              return 0
          except Exception as e:
              print(str(e))
              return -1
      else:
          if remote_path.startswith("file://"):
              remote_path = remote_path[len("file://") :]
          shutil.copy(remote_path, local_path)
          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 bigdl.dllib.utils import file_utils
  from typing import TYPE_CHECKING, List, Callable, Union, Optional
label_desc: Use image node_id 14 for calling a global function with example usage: get_remote_file_to_local(remote_path, local_path, over_write) and returns: file_utils, int, int, unknown