class_docstr: Elastic Container Registry class.
docstr: Initialize the Elastic Container Registry.
  
  Arguments:
      uri: The uri of the repository.
      account_id: The AWS account id.
      region: The AWS region of the container registry.
      repository: The name of the repository.
  
  Raises:
      LaunchError: If there is an error initializing the Elastic Container Registry helper.
docstr_tok: ["Initialize","the","Elastic","Container","Registry",".","Arguments",":","uri",":","The","uri","of","the","repository",".","account_id",":","The","AWS","account","id",".","region",":","The","AWS","region","of","the","container","registry",".","repository",":","The","name","of","the","repository",".","Raises",":","LaunchError",":","If","there","is","an","error","initializing","the","Elastic","Container","Registry","helper","."]
code: def __init__(
      self,
      uri: Optional[str] = None,
      account_id: Optional[str] = None,
      region: Optional[str] = None,
      repo_name: Optional[str] = None,
  ) -> None:
      """Initialize the Elastic Container Registry.
  
      Arguments:
          uri: The uri of the repository.
          account_id: The AWS account id.
          region: The AWS region of the container registry.
          repository: The name of the repository.
  
      Raises:
          LaunchError: If there is an error initializing the Elastic Container Registry helper.
      """
      if uri:
          self.uri = uri
          if any([account_id, region, repo_name]):
              raise LaunchError(
                  "Could not create ElasticContainerRegistry from config. Either 'uri' or "
                  "'account_id', 'region', and 'repo_name' are required."
              )
          match = ELASTIC_CONTAINER_REGISTRY_URI_REGEX.match(
              self.uri,
          )
          if not match:
              raise LaunchError(
                  f"Could not create ElasticContainerRegistry from config. The uri "
                  f"{self.uri} is invalid."
              )
          self.account_id = match.group("account")
          self.region = match.group("region")
          self.repo_name = match.group("repository")
      else:
          if not all([account_id, region, repo_name]):
              raise LaunchError(
                  "Could not create ElasticContainerRegistry from config. Either 'uri' or "
                  "'account_id', 'region', and 'repo_name' are required."
              )
          self.account_id = account_id
          self.region = region
          self.repo_name = repo_name
          self.uri = f"{self.account_id}.dkr.ecr.{self.region}.amazonaws.com/{self.repo_name}"
      if self.account_id is None:
          raise LaunchError(
              "Could not create ElasticContainerRegistry from config. Either 'uri' or "
              "'account_id' is required."
          )
      if self.region is None:
          raise LaunchError(
              "Could not create ElasticContainerRegistry from config. Either 'uri' or "
              "'region' is required."
          )
      if self.repo_name is None:
          raise LaunchError(
              "Could not create ElasticContainerRegistry from config. Either 'uri' or "
              "'repository' is required."
          )
  
file_path: wandb/wandb/sdk/launch/registry/elastic_container_registry.py
imports: import base64
  import logging
  from typing import Dict, Optional, Tuple
  from wandb.sdk.launch.errors import LaunchError
  from wandb.sdk.launch.registry.abstract import AbstractRegistry
  from wandb.sdk.launch.utils import ELASTIC_CONTAINER_REGISTRY_URI_REGEX, event_loop_thread_exec
  from wandb.util import get_module
label_desc: Use image node_id 1 to create a new ElasticContainerRegistry object from inherited base classes: AbstractRegistry with example: obj = ElasticContainerRegistry(uri, account_id, region, repo_name)