code: def list_s3_file(file_path, env):
      path_parts = file_path.split("/")
      bucket = path_parts.pop(0)
      key = "/".join(path_parts)
  
      access_key_id = env["AWS_ACCESS_KEY_ID"]
      secret_access_key = env["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")
      # file
      if os.path.splitext(file_path)[1] != "":
          return ["s3://" + file_path]
      else:
          keys = []
          resp = s3_client.list_objects_v2(Bucket=bucket, Prefix=key)
          for obj in resp["Contents"]:
              keys.append(obj["Key"])
          file_paths = [
              os.path.join("s3://" + bucket, file) for file in keys
          ]
          return file_paths
  
imports: from bigdl.dllib.utils.file_utils import get_file_list, callZooFunc
  from bigdl.dllib.utils.utils import convert_row_to_numpy
  from bigdl.dllib.utils.common import *
  from bigdl.dllib.utils.log4Error import *
  import pyspark.sql.functions
  from typing import TYPE_CHECKING, Dict, List, Optional, Type, Union
  from numpy import float32, int32
label_desc: Use image node_id 1 for calling a global function with example usage: list_s3_file(file_path, env) and returns: list, file_paths