code: def test_weights_deserializable(name):
      for weights in list(models.get_model_weights(name)):
          # It is somewhat surprising that deserialization is an identity operation here, but this is the default behavior
          # of enums: https://docs.python.org/3/howto/enum.html#enum-members-aka-instances
          # Checking for equality, i.e. `==`, is sufficient (and even preferable) for our use case, should we need to drop
          # support for the identity operation in the future.
          assert pickle.loads(pickle.dumps(weights)) is weights
  
imports: import copy
  import os
  import pickle
  import pytest
  import test_models
  import torch
  from common_extended_utils import get_file_size_mb, get_ops
  from torchvision import models
  from torchvision.models import get_model_weights, Weights, WeightsEnum
  from torchvision.models._utils import handle_legacy_interface
  from torchvision.models.detection.backbone_utils import mobilenet_backbone, resnet_fpn_backbone
label_desc: Use image node_id 5 for calling a global function with example usage: test_weights_deserializable(name) without return types