code: def query(self, variables, query=None):
      public_api_query_str = "query Artifact($id: ID!) {"
      public_api_query_str2 = (
          "query ArtifactWithCurrentManifest($id: ID!) {"
      )
      public_api_query_str3 = "query ArtifactManifest("
      art_id = variables.get("id")
      art_name = variables.get("name")
      assert art_id or art_name
  
      is_public_api_query = query and (
          query.startswith(public_api_query_str)
          or query.startswith(public_api_query_str2)
          or query.startswith(public_api_query_str3)
      )
  
      if art_name:
          collection_name, version = art_name.split(":", 1)
          artifact = None
          artifacts = self._artifacts.get(collection_name)
          if artifacts:
              if version == "latest":
                  version_num = len(artifacts)
              else:
                  assert version.startswith("v")
                  version_num = int(version[1:])
              artifact = artifacts[version_num - 1]
              # TODO: add alias info?
      elif art_id:
          artifact = self._artifacts_by_id[art_id]
  
      if is_public_api_query:
          response = {"data": {"artifact": artifact}}
      else:
          response = {"data": {"project": {"artifact": artifact}}}
      return response
  
file_path: wandb/tests/pytest_tests/unit_tests_old/utils/artifact_emu.py
imports: import copy
label_desc: Use image node_id 5 for calling the ArtifactEmulator obj's underlying member method code with example usage: obj.query(variables, query) and returns: response