code: def load_numpy(path: str) -> "ndarray":
      """
  
      Load arrays or pickled objects from ``.npy``, ``.npz`` or pickled files.
      It supports local, hdfs, s3 file systems.
  
      :param path: file path
      :return: array, tuple, dict, etc.
          Data stored in the file. For ``.npz`` files, the returned instance
          of NpzFile class must be closed to avoid leaking file descriptors.
      """
      import numpy as np
  
      if path.startswith("hdfs"):  # hdfs://url:port/file_path
          import pyarrow as pa
  
          fs = pa.hdfs.connect()
          with fs.open(path, "rb") as f:
              return np.load(f)
      elif 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
          from io import BytesIO
  
          s3_client = boto3.Session(
              aws_access_key_id=access_key_id,
              aws_secret_access_key=secret_access_key,
          ).client("s3")
          path_parts = path.split("://")[1].split("/")
          bucket = path_parts.pop(0)
          key = "/".join(path_parts)
          data = s3_client.get_object(Bucket=bucket, Key=key)
          return np.load(BytesIO(data["Body"].read()))
      else:  # Local path
          if path.startswith("file://"):
              path = path[len("file://") :]
          return np.load(path)
  
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 3 for calling a global function with example usage: load_numpy(path) and returns: np, np, np