code: def create(self, variables):
      collection_name = variables["artifactCollectionNames"][0]
      state = "PENDING"
      aliases = []
      latest = None
      art_id = variables.get("digest", "")
  
      # Find most recent artifact
      versions = self._artifacts.get(collection_name)
      if versions:
          last_version = versions[-1]
          latest = {
              "id": last_version["digest"],
              "versionIndex": len(versions) - 1,
          }
      art_seq = {"id": art_id, "latestArtifact": latest}
  
      aliases.append(
          dict(artifactCollectionName=collection_name, alias="latest")
      )
  
      base_url = self._base_url
      direct_url = f"{base_url}/storage?file=wandb_manifest.json"
      art_data = {
          "id": art_id,
          "digest": "abc123",
          "state": state,
          "labels": [],
          "aliases": aliases,
          "artifactSequence": art_seq,
          "versionIndex": 0,
          "currentManifest": dict(file=dict(directUrl=direct_url)),
      }
  
      response = {
          "data": {
              "createArtifact": {"artifact": copy.deepcopy(art_data)}
          }
      }
  
      # save in artifact emu object
      art_seq["name"] = collection_name
      art_data["artifactSequence"] = art_seq
      art_data["state"] = "COMMITTED"
      art_type = variables.get("artifactTypeName")
      if art_type:
          art_data["artifactType"] = {"id": 1, "name": art_type}
      art_save = copy.deepcopy(art_data)
      self._artifacts.setdefault(collection_name, []).append(art_save)
      self._artifacts_by_id[art_id] = art_save
  
      # save in context
      self._ctx["artifacts_created"].setdefault(collection_name, {})
      self._ctx["artifacts_created"][collection_name].setdefault(
          "num", 0
      )
      self._ctx["artifacts_created"][collection_name]["num"] += 1
      if art_type:
          self._ctx["artifacts_created"][collection_name][
              "type"
          ] = art_type
  
      return response
  
file_path: wandb/tests/pytest_tests/unit_tests_old/utils/artifact_emu.py
imports: import copy
label_desc: Use image node_id 2 for calling the ArtifactEmulator obj's underlying member method code with example usage: obj.create(variables) and returns: response