code: def prepare_for_operationalization(
      cluster_id, api_client, dbfs_path, overwrite, spark_version
  ):
      """
      Installs appropriate versions of several libraries to support operationalization.
  
      Args:
          cluster_id (str): cluster_id representing the cluster to prepare for operationalization
          api_client (ApiClient): the ApiClient object used to authenticate to the workspace
          dbfs_path (str): the path on dbfs to upload libraries to
          overwrite (bool): whether to overwrite existing files on dbfs with new files of the same name
          spark_version (str): str version indicating which version of spark is installed on the databricks cluster
  
      Returns:
          A dictionary of libraries installed
      """
      print("Preparing for operationlization...")
  
      cosmosdb_jar_url = COSMOSDB_JAR_FILE_OPTIONS[spark_version]
  
      # download the cosmosdb jar
      local_jarname = os.path.basename(cosmosdb_jar_url)
      # only download if you need it:
      if overwrite or not os.path.exists(local_jarname):
          print("Downloading {}...".format(cosmosdb_jar_url))
          local_jarname, _ = urlretrieve(
              cosmosdb_jar_url, local_jarname
          )
      else:
          print("File {} already downloaded.".format(local_jarname))
  
      # upload jar to dbfs:
      upload_path = Path(dbfs_path, local_jarname).as_posix()
      print(
          "Uploading CosmosDB driver to databricks at {}".format(
              upload_path
          )
      )
      if dbfs_file_exists(api_client, upload_path) and overwrite:
          print("Overwriting file at {}".format(upload_path))
      DbfsApi(api_client).cp(
          recursive=False,
          src=local_jarname,
          dst=upload_path,
          overwrite=overwrite,
      )
  
      # setup the list of libraries to install:
      # jar library setup
      libs2install = [{"jar": upload_path}]
      # setup libraries to install:
      libs2install.extend(
          [{"pypi": {"package": i}} for i in PYPI_O16N_LIBS]
      )
      print(
          "Installing jar and pypi libraries required for operationalization..."
      )
      LibrariesApi(api_client).install_libraries(
          cluster_id, libs2install
      )
      return libs2install
  
file_path: recommenders/tools/databricks_install.py
imports: import argparse
  import textwrap
  import os
  from pathlib import Path
  import pkg_resources
  import sys
  import time
  from urllib.request import urlretrieve
  from requests.exceptions import HTTPError
  from databricks_cli.configure.provider import ProfileConfigProvider
  from databricks_cli.configure.config import _get_api_client
  from databricks_cli.clusters.api import ClusterApi
  from databricks_cli.dbfs.api import DbfsApi
  from databricks_cli.libraries.api import LibrariesApi
  from databricks_cli.dbfs.dbfs_path import DbfsPath
  from recommenders.utils.spark_utils import MMLSPARK_PACKAGE, MMLSPARK_REPO
label_desc: Use image node_id 3 for calling a global function with example usage: prepare_for_operationalization(cluster_id, api_client, dbfs_path, overwrite, spark_version) and returns: libs2install