code: def deploy_model(
      model,
      model_name: str,
      authentication: dict,
      platform: str = "aws",
      prep_pipe_=None,
  ):
      """
      (In Preview)
  
      This generic function deploys the transformation pipeline and trained model object for
      production use. The platform of deployment can be defined under the platform
      param along with the applicable authentication tokens which are passed as a
      dictionary to the authentication param.
  
      Notes
      -----
      For AWS users:
      Before deploying a model to an AWS S3 ('aws'), environment variables must be
      configured using the command line interface. To configure AWS env. variables,
      type aws configure in your python command line. The following information is
      required which can be generated using the Identity and Access Management (IAM)
      portal of your amazon console account:
  
      - AWS Access Key ID
      - AWS Secret Key Access
      - Default Region Name (can be seen under Global settings on your AWS console)
      - Default output format (must be left blank)
  
      For GCP users:
      --------------
      Before deploying a model to Google Cloud Platform (GCP), user has to create Project
      on the platform from console. To do that, user must have google cloud account or
      create new one. After creating a service account, down the JSON authentication file
      and configure  GOOGLE_APPLICATION_CREDENTIALS= <path-to-json> from command line. If
      using google-colab then authentication can be done using `google.colab` auth method.
      Read below link for more details.
  
      https://cloud.google.com/docs/authentication/production
  
      - Google Cloud Project
      - Service Account Authentication
  
      For Azure users:
      ---------------
      Before deploying a model to Microsoft's Azure (Azure), environment variables
      for connection string must be set. In order to get connection string, user has
      to create account of Azure. Once it is done, create a Storage account. In the settings
      section of storage account, user can get the connection string.
  
      Read below link for more details.
      https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-python?toc=%2Fpython%2Fazure%2FTOC.json
  
      - Azure Storage Account
  
      Parameters
      ----------
      model : object
          A trained model object should be passed as an estimator.
  
      model_name : str
          Name of model to be passed as a string.
  
      authentication : dict
          Dictionary of applicable authentication tokens.
  
          When platform = 'aws':
          {'bucket' : 'Name of Bucket on S3', 'path': (optional) folder name under the bucket}
  
          When platform = 'gcp':
          {'project': 'gcp_pycaret', 'bucket' : 'pycaret-test'}
  
          When platform = 'azure':
          {'container': 'pycaret-test'}
  
      platform: str, default = 'aws'
          Name of platform for deployment. Current available options are: 'aws', 'gcp' and 'azure'
  
      Returns
      -------
      Success_Message
  
      Warnings
      --------
      - This function uses file storage services to deploy the model on cloud platform.
        As such, this is efficient for batch-use. Where the production objective is to
        obtain prediction at an instance level, this may not be the efficient choice as
        it transmits the binary pickle file between your local python environment and
        the platform.
  
      """
  
      function_params_str = ", ".join(
          [f"{k}={v}" for k, v in locals().items()]
      )
  
      logger = get_logger()
  
      logger.info("Initializing deploy_model()")
      logger.info(f"deploy_model({function_params_str})")
  
      allowed_platforms = ["aws", "gcp", "azure"]
  
      if platform not in allowed_platforms:
          logger.error(
              f"(Value Error): Platform {platform} is not supported by pycaret or illegal option"
          )
          raise ValueError(
              f"Platform {platform} is not supported by pycaret or illegal option"
          )
  
      if platform:
          if not authentication:
              raise ValueError("Authentication is missing.")
  
      # general dependencies
      import os
  
      logger.info("Saving model in active working directory")
      logger.info(
          "SubProcess save_model() called =================================="
      )
      save_model(
          model,
          prep_pipe_=prep_pipe_,
          model_name=model_name,
          verbose=False,
      )
      logger.info(
          "SubProcess save_model() end =================================="
      )
  
      if platform == "aws":
          logger.info("Platform : AWS S3")
  
          # checking if boto3 is available
          _check_soft_dependencies(
              "boto3", extra=None, severity="error"
          )
          import boto3
  
          # initialize s3
          logger.info("Initializing S3 client")
          s3 = boto3.client("s3")
          filename = f"{model_name}.pkl"
          if "path" in authentication:
              key = os.path.join(
                  authentication.get("path"), f"{model_name}.pkl"
              )
          else:
              key = f"{model_name}.pkl"
          bucket_name = authentication.get("bucket")
  
          if bucket_name is None:
              logger.error(
                  "S3 bucket name missing. Provide `bucket` as part of authentication parameter."
              )
              raise ValueError(
                  "S3 bucket name missing. Provide `bucket` name as part of authentication parameter."
              )
  
          import botocore.exceptions
  
          try:
              s3.upload_file(filename, bucket_name, key)
          except botocore.exceptions.NoCredentialsError:
              logger.error(
                  "Boto3 credentials not configured. Refer boto3 documentation "
                  "(https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html)"
              )
              logger.error("Model deployment to AWS S3 failed.")
              raise ValueError(
                  "Boto3 credentials not configured. Refer boto3 documentation "
                  "(https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html)"
              )
          os.remove(filename)
          print("Model Successfully Deployed on AWS S3")
          logger.info("Model Successfully Deployed on AWS S3")
          logger.info(str(model))
  
      elif platform == "gcp":
          logger.info("Platform : GCP")
  
          _check_soft_dependencies(
              "google",
              extra=None,
              severity="error",
              install_name="google-cloud-storage",
          )
  
          # initialize deployment
          filename = f"{model_name}.pkl"
          key = f"{model_name}.pkl"
          bucket_name = authentication.get("bucket")
          project_name = authentication.get("project")
  
          if bucket_name is None or project_name is None:
              logger.error(
                  "Project and Bucket name missing. Provide `bucket` and `project` as part of "
                  "authentication parameter"
              )
              raise ValueError(
                  "Project and Bucket name missing. Provide `bucket` and `project` as part of "
                  "authentication parameter"
              )
  
          try:
              _create_bucket_gcp(project_name, bucket_name)
              _upload_blob_gcp(project_name, bucket_name, filename, key)
          except Exception:
              _upload_blob_gcp(project_name, bucket_name, filename, key)
          os.remove(filename)
          print("Model Successfully Deployed on GCP")
          logger.info("Model Successfully Deployed on GCP")
          logger.info(str(model))
  
      elif platform == "azure":
          logger.info("Platform : Azure Blob Storage")
  
          _check_soft_dependencies(
              "azure",
              extra=None,
              severity="error",
              install_name="azure-storage-blob",
          )
  
          # initialize deployment
          filename = f"{model_name}.pkl"
          key = f"{model_name}.pkl"
          container_name = authentication.get("container")
  
          if container_name is None:
              logger.error(
                  "Storage Container name missing. Provide `container` as part of authentication parameter"
              )
              raise ValueError(
                  "Storage Container name missing. Provide `container` as part of authentication parameter"
              )
  
          try:
              _create_container_azure(container_name)
              _upload_blob_azure(container_name, filename, key)
              del container_client
          except Exception:
              _upload_blob_azure(container_name, filename, key)
  
          os.remove(filename)
  
          print("Model Successfully Deployed on Azure Storage Blob")
          logger.info(
              "Model Successfully Deployed on Azure Storage Blob"
          )
          logger.info(str(model))
  
      logger.info(
          "deploy_model() successfully completed......................................"
      )
      gc.collect()
  
file_path: pycaret/pycaret/internal/persistence.py
imports: import gc
  import os
  from typing import Dict, Optional
  import joblib
  from sklearn.pipeline import Pipeline
  from pycaret.utils._dependencies import _check_soft_dependencies
  from pycaret.utils.generic import MLUsecase, get_logger
label_desc: Use image node_id 1 for calling a global function with example usage: deploy_model(model, model_name, authentication, platform, prep_pipe_) without return types