code: def save_pkl(data, path):
      if path.startswith("hdfs"):  # hdfs://url:port/file_path
          import uuid
  
          file_name = str(uuid.uuid1()) + ".pkl"
          temp_path = os.path.join(tempfile.gettempdir(), file_name)
          with open(temp_path, "wb") as f:
              SafePickle.dump(data, f)
          put_local_file_to_remote(temp_path, path)
      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
  
          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)
          content = SafePickle.dumps(data)
          s3_client.put_object(Bucket=bucket, Key=key, Body=content)
      else:
          if path.startswith("file://"):
              path = path[len("file://") :]
          with open(path, "wb") as f:
              SafePickle.dump(data, f)
  
imports: from contextlib import closing
  import socket
  import sys
  import tempfile
  import shutil
  from bigdl.dllib.utils import log4Error
  from bigdl.dllib.utils.common import callBigDlFunc
  from bigdl.dllib.utils.file_utils import get_file_list, is_local_path
  from bigdl.orca.data import SparkXShards
  from bigdl.orca.data.utils import get_size
  from bigdl.orca.data.file import put_local_dir_tree_to_remote, put_local_file_to_remote, get_remote_file_to_local, get_remote_dir_to_local
  from bigdl.dllib.utils.utils import convert_row_to_numpy
  from functools import partial
  import numpy
  from bigdl.orca.common import SafePickle
  import os
  import subprocess
  from bigdl.dllib.utils.log4Error import *
label_desc: Use image node_id 27 for calling a global function with example usage: save_pkl(data, path) without return types