code: def test_delete_collection(wandb_init):
      with wandb_init(project="test") as run:
          art = wandb.Artifact("test-artifact", "test-type")
          with art.new_file("test.txt", "w") as f:
              f.write("testing")
          run.log_artifact(art)
          run.link_artifact(art, "test/test-portfolio")
  
      project = Api().artifact_type("test-type", project="test")
      portfolio = project.collection("test-portfolio")
      portfolio.delete()
  
      with pytest.raises(wandb.errors.CommError):
          Api().artifact(
              name=f"{project.entity}/test/test-portfolio:latest",
              type="test-type",
          )
  
      # The base artifact should still exist.
      Api().artifact(
          name=f"{project.entity}/test/test-artifact:latest",
          type="test-type",
      )
  
      sequence = project.collection("test-artifact")
      sequence.delete()
  
      # Until now.
      with pytest.raises(wandb.errors.CommError):
          Api().artifact(
              name=f"{project.entity}/test/test-artifact:latest",
              type="test-type",
          )
  
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 5 for calling a global function with example usage: test_delete_collection(wandb_init) without return types