code: def test_artifact_type():
      artifact = wandb.Artifact("name", type="dataset")
      target_type = TypeRegistry.types_by_name().get(
          "artifactVersion"
      )()
      type_of_artifact = TypeRegistry.type_of(artifact)
  
      artifact_string = "wandb-artifact://test/project/astring:latest"
      type_of_artifact_string = TypeRegistry.type_of(artifact)
  
      artifact_config_shape = {
          "_type": "artifactVersion",
          "_version": "v0",
          "id": artifact.id,
          "version": "v0",
          "sequenceName": artifact.name.split(":")[0],
          "usedAs": "test_reference_download",
      }
      type_of_artifact_dict = TypeRegistry.type_of(
          artifact_config_shape
      )
  
      assert type_of_artifact.assign(artifact_string) == target_type
      assert (
          type_of_artifact.assign(artifact_config_shape) == target_type
      )
      assert type_of_artifact_dict.assign(artifact) == target_type
      assert (
          type_of_artifact_dict.assign(artifact_string) == target_type
      )
      assert (
          type_of_artifact_string.assign(artifact_config_shape)
          == target_type
      )
      assert type_of_artifact_string.assign(artifact) == target_type
  
      # test nested
      nested_artifact = {"nested_artifact": artifact}
      type_of_nested_artifact = TypeRegistry.type_of(nested_artifact)
      nested_artifact_string = {"nested_artifact": artifact_string}
      type_of_nested_artifact_string = TypeRegistry.type_of(
          nested_artifact_string
      )
      nested_artifact_config_dict = {
          "nested_artifact": artifact_config_shape
      }
      type_of_nested_artifact_dict = TypeRegistry.type_of(
          nested_artifact_config_dict
      )
      nested_target_type = TypedDictType(
          {
              "nested_artifact": TypeRegistry.types_by_name().get(
                  "artifactVersion"
              )()
          }
      )
      assert (
          type_of_nested_artifact.assign(nested_artifact_string)
          == nested_target_type
      )
      assert (
          type_of_nested_artifact_dict.assign(
              nested_artifact_config_dict
          )
          == nested_target_type
      )
      assert (
          type_of_nested_artifact_dict.assign(nested_artifact)
          == nested_target_type
      )
      assert (
          type_of_nested_artifact_dict.assign(nested_artifact_string)
          == nested_target_type
      )
      assert (
          type_of_nested_artifact_string.assign(
              nested_artifact_config_dict
          )
          == nested_target_type
      )
      assert (
          type_of_nested_artifact_string.assign(nested_artifact)
          == nested_target_type
      )
  
imports: import datetime
  import numpy
  import pytest
  import wandb
  from wandb import data_types
  from wandb.sdk.data_types._dtypes import AnyType, BooleanType, ConstType, InvalidType, ListType, NoneType, NumberType, OptionalType, StringType, TimestampType, TypedDictType, TypeRegistry, UnionType, UnknownType
label_desc: Use image node_id 29 for calling a global function with example usage: test_artifact_type() without return types