code: def test_registry_from_uri(url, expected, mocker):
      mocker.patch(
          "wandb.sdk.launch.registry.azure_container_registry.AzureContainerRegistry",
          MagicMock(return_value="azure_container_registry"),
      )
      mocker.patch(
          "wandb.sdk.launch.registry.google_artifact_registry.GoogleArtifactRegistry",
          MagicMock(return_value="google_artifact_registry"),
      )
      mocker.patch(
          "wandb.sdk.launch.registry.elastic_container_registry.ElasticContainerRegistry",
          MagicMock(return_value="elastic_container_registry"),
      )
  
      if expected is None:
          with pytest.raises(LaunchError):
              registry_from_uri(url)
      else:
          assert registry_from_uri(url) == expected
  
file_path: wandb/tests/pytest_tests/unit_tests/test_launch/test_builder/test_build.py
imports: import hashlib
  from unittest.mock import MagicMock
  import pytest
  from wandb.sdk.launch.builder import build
  from wandb.sdk.launch.builder.build import registry_from_uri
  from wandb.sdk.launch.errors import LaunchError
label_desc: Use image node_id 1 for calling a global function with example usage: test_registry_from_uri(url, expected, mocker) without return types