code: def ais_endpoint_to_dir(endpoint: str) -> str:
      """Convert AIS endpoint to a valid dir name.
      Used to build cache location.
  
      Args:
          endpoint: AIStore endpoint in format https://host:port
  
      Returns:
          Directory formed as `host/port`.
      """
      if not endpoint.startswith("http://"):
          raise ValueError(
              f"Unexpected format for ais endpoint: {endpoint}"
          )
  
      endpoint = endpoint.replace("http://", "")
      host, port = endpoint.split(":")
      return os.path.join(host, port)
  
imports: import os
  import pathlib
  import shutil
  import subprocess
  from typing import Tuple
  from nemo import __version__
  from nemo import constants
  from nemo.utils import logging
label_desc: Use image node_id 8 for calling a global function with example usage: ais_endpoint_to_dir(endpoint) and returns: os