code: def test_equivalent_behavior_weights(self, pretrained, positional):
      @handle_legacy_interface(
          weights=("pretrained", self.ModelWeights.Sentinel)
      )
      def builder(*, weights=None):
          pass
  
      args, kwargs = (
          ((pretrained,), dict())
          if positional
          else ((), dict(pretrained=pretrained))
      )
      with pytest.warns(
          UserWarning,
          match=f"weights={self.ModelWeights.Sentinel if pretrained else None}",
      ):
          builder(*args, **kwargs)
  
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 4 for calling the TestHandleLegacyInterface obj's underlying member method code with example usage: obj.test_equivalent_behavior_weights(pretrained, positional) without return types