code: def test_artifact_version(wandb_init):
      def create_test_artifact(content: str):
          art = wandb.Artifact("test-artifact", "test-type")
          with open("boom.txt", "w") as f:
              f.write(content)
          art.add_file("boom.txt", "test-name")
          return art
  
      # Create an artifact sequence + portfolio (auto-created if it doesn't exist)
      project = "test"
      run = wandb_init(project=project)
  
      art = create_test_artifact("aaaaa")
      run.log_artifact(art, aliases=["a"])
      art.wait()
  
      art = create_test_artifact("bbbb")
      run.log_artifact(art, aliases=["b"])
      run.link_artifact(art, f"{project}/my-sample-portfolio")
      art.wait()
      run.finish()
  
      # Pull down from portfolio, verify version is indexed from portfolio not sequence
      artifact = Api().artifact(
          name=f"{project}/my-sample-portfolio:latest", type="test-type"
      )
  
      assert artifact.version == "v0"
      assert artifact.source_version == "v1"
  
file_path: wandb/tests/pytest_tests/system_tests/test_artifacts/test_public_api.py
imports: import os
  import pytest
  import wandb
  from wandb import Api
label_desc: Use image node_id 4 for calling a global function with example usage: test_artifact_version(wandb_init) and returns: art