code: def registry_from_uri(uri: str) -> AbstractRegistry:
      """Create a registry helper object from a uri.
  
      This function parses the URI and determines which supported registry it
      belongs to. It then creates a registry helper object for that registry.
      The supported remote registry types are:
      - Azure Container Registry
      - Google Container Registry
      - AWS Elastic Container Registry
  
      The format of the URI is as follows:
      - Azure Container Registry: <registry-name>.azurecr.io/<repo-name>/<image-name>
      - Google Container Registry: <location>-docker.pkg.dev/<project-id>/<repo-name>/<image-name>
      - AWS Elastic Container Registry: <account-id>.dkr.ecr.<region>.amazonaws.com/<repo-name>/<image-name>
  
      Our classification of the registry is based on the domain name. For example,
      if the uri contains `.azurecr.io`, we classify it as an Azure
      Container Registry. If the uri contains `.dkr.ecr`, we classify
      it as an AWS Elastic Container Registry. If the uri contains
      `-docker.pkg.dev`, we classify it as a Google Artifact Registry.
  
      This function will attempt to load the approriate cloud helpers for the
  
      `https://` prefix is optional for all of the above.
  
      Arguments:
          uri: The uri to create a registry from.
  
      Returns:
          The registry.
  
      Raises:
          LaunchError: If the registry helper cannot be loaded for the given URI.
      """
      if uri.startswith("https://"):
          uri = uri[len("https://") :]
  
      if AZURE_CONTAINER_REGISTRY_URI_REGEX.match(uri) is not None:
          from wandb.sdk.launch.registry.azure_container_registry import (
              AzureContainerRegistry,
          )
  
          return AzureContainerRegistry(uri=uri)
  
      elif GCP_ARTIFACT_REGISTRY_URI_REGEX.match(uri) is not None:
          from wandb.sdk.launch.registry.google_artifact_registry import (
              GoogleArtifactRegistry,
          )
  
          return GoogleArtifactRegistry(uri=uri)
  
      elif ELASTIC_CONTAINER_REGISTRY_URI_REGEX.match(uri) is not None:
          from wandb.sdk.launch.registry.elastic_container_registry import (
              ElasticContainerRegistry,
          )
  
          return ElasticContainerRegistry(uri=uri)
  
      else:
          raise LaunchError(
              f"Unsupported registry URI: {uri}. Unable to load helper."
          )
  
imports: import hashlib
  import json
  import logging
  import os
  import shlex
  import shutil
  import sys
  import tempfile
  from typing import Any, Dict, List, Optional, Tuple
  import pkg_resources
  import yaml
  from dockerpycreds.utils import find_executable
  from six.moves import shlex_quote
  import wandb
  import wandb.docker
  import wandb.env
  from wandb.apis.internal import Api
  from wandb.sdk.launch.loader import builder_from_config, environment_from_config, registry_from_config
  from .._project_spec import EntryPoint, EntrypointDefaults, LaunchProject, fetch_and_validate_project
  from ..errors import ExecutionError, LaunchError
  from ..registry.abstract import AbstractRegistry
  from ..utils import AZURE_CONTAINER_REGISTRY_URI_REGEX, ELASTIC_CONTAINER_REGISTRY_URI_REGEX, GCP_ARTIFACT_REGISTRY_URI_REGEX, LAUNCH_CONFIG_FILE, LOG_PREFIX, event_loop_thread_exec, resolve_build_and_registry_config
label_desc: Use image node_id 1 for calling a global function with example usage: registry_from_uri(uri) and returns: AzureContainerRegistry, GoogleArtifactRegistry, ElasticContainerRegistry