code: def _get_artifact_by_type(
      self, artifact_type: str, run: DockerRunData
  ) -> DockerRunArtifactData:
      if run.artifacts is None:
          raise ArtifactNotExist(f"Run has no artifacts.")
      try:
          artifact = next(
              art for art in run.artifacts if art.type == artifact_type
          )
      except StopIteration:
          raise ArtifactNotExist(
              f"No artifact with type '{artifact_type}' in artifacts."
          )
      return artifact
  
file_path: lightly/lightly/api/api_workflow_artifacts.py
imports: import os
  import warnings
  from lightly.api import download
  from lightly.openapi_generated.swagger_client.models import DockerRunArtifactData, DockerRunArtifactType, DockerRunData
label_desc: Use image node_id 11 for calling the _ArtifactsMixin obj's underlying member method code with example usage: obj._get_artifact_by_type(artifact_type, run) and returns: artifact