class_docstr: Class to identify syft worker images.
  If a user provides an image's identifier with
  "docker.io/openmined/test-nginx:0.7.8", the convention we use for
  image name, tag and repo for now is
      tag = 0.7.8
      repo = openmined/test-nginx
      repo_with_tag = openmined/test-nginx:0.7.8
      full_name = docker.io/openmined/test-nginx
      full_name_with_tag = docker.io/openmined/test-nginx:0.7.8
  
  References:
      https://docs.docker.com/engine/reference/commandline/tag/#tag-an-image-referenced-by-name-and-tag
class_docstr_tok: ["Class","to","identify","syft","worker","images",".","If","a","user","provides","an","image","'s","identifier","with","''","docker.io\/openmined\/test-nginx:0.7.8","''",",","the","convention","we","use","for","image","name",",","tag","and","repo","for","now","is","tag","=","0.7.8","repo","=","openmined\/test-nginx","repo_with_tag","=","openmined\/test-nginx:0.7.8","full_name","=","docker.io\/openmined\/test-nginx","full_name_with_tag","=","docker.io\/openmined\/test-nginx:0.7.8","References",":","https",":","\/\/docs.docker.com\/engine\/reference\/commandline\/tag\/","#","tag-an-image-referenced-by-name-and-tag"]
docstr: Build a SyftWorkerImageTag from Docker tag & a previously created SyftImageRegistry object.
docstr_tok: ["Build","a","SyftWorkerImageTag","from","Docker","tag","&","a","previously","created","SyftImageRegistry","object","."]
code: def with_registry(cls, tag: str, registry: SyftImageRegistry) -> Self:
      """Build a SyftWorkerImageTag from Docker tag & a previously created SyftImageRegistry object."""
      registry_str, repo, tag = SyftWorkerImageIdentifier.parse_str(tag)
  
      # if we parsed a registry string, make sure it matches the registry object
      if registry_str and registry_str != registry.url:
          raise ValueError(
              f"Registry URL mismatch: {registry_str} != {registry.url}"
          )
  
      return cls(repo=repo, tag=tag, registry=registry)
  
file_path: PySyft/packages/syft/src/syft/service/worker/image_identifier.py
imports: from typing import Optional
  from typing import Tuple
  from typing import Union
  from typing_extensions import Self
  from ...serde.serializable import serializable
  from ...types.base import SyftBaseModel
  from .image_registry import SyftImageRegistry
label_desc: Use image node_id 1 for calling the SyftWorkerImageIdentifier obj's underlying member method code with example usage: obj.with_registry(cls, tag, registry) and returns: cls