code: def test_list_jumpstart_models_vulnerable_models(
      self,
      patched_read_s3_file: Mock,
      patched_get_manifest: Mock,
  ):
      patched_get_manifest.side_effect = (
          lambda region, *args, **kwargs: get_prototype_manifest(region)
      )
  
      def vulnerable_inference_model_spec(
          bucket, key, *args, **kwargs
      ) -> str:
          spec = get_prototype_model_spec(
              None, "pytorch-eqa-bert-base-cased"
          )
          spec.inference_vulnerable = True
          return json.dumps(spec.to_json())
  
      def vulnerable_training_model_spec(bucket, key, *args, **kwargs):
          spec = get_prototype_model_spec(
              None, "pytorch-eqa-bert-base-cased"
          )
          spec.training_vulnerable = True
          return json.dumps(spec.to_json())
  
      patched_read_s3_file.side_effect = vulnerable_inference_model_spec
  
      num_specs = len(PROTOTYPICAL_MODEL_SPECS_DICT)
      assert [] == list_jumpstart_models(
          And(
              "inference_vulnerable is false",
              "training_vulnerable is false",
          )
      )
  
      assert patched_read_s3_file.call_count == num_specs
      patched_get_manifest.assert_called_once()
  
      patched_get_manifest.reset_mock()
      patched_read_s3_file.reset_mock()
  
      patched_read_s3_file.side_effect = vulnerable_training_model_spec
  
      assert [] == list_jumpstart_models(
          And(
              "inference_vulnerable is false",
              "training_vulnerable is false",
          )
      )
  
      assert patched_read_s3_file.call_count == num_specs
      patched_get_manifest.assert_called_once()
  
      patched_get_manifest.reset_mock()
      patched_read_s3_file.reset_mock()
  
      assert [] != list_jumpstart_models()
  
      assert patched_read_s3_file.call_count == 0
  
imports: from __future__ import absolute_import
  import json
  from unittest import TestCase
  from unittest.mock import Mock, patch
  import pytest
  from sagemaker.jumpstart.constants import DEFAULT_JUMPSTART_SAGEMAKER_SESSION, JUMPSTART_DEFAULT_REGION_NAME
  from sagemaker.jumpstart.filters import And, Identity, Not, Or
  from tests.unit.sagemaker.jumpstart.constants import PROTOTYPICAL_MODEL_SPECS_DICT
  from tests.unit.sagemaker.jumpstart.utils import get_header_from_base_header, get_prototype_manifest, get_prototype_model_spec
  from sagemaker.jumpstart.notebook_utils import _generate_jumpstart_model_versions, get_model_url, list_jumpstart_frameworks, list_jumpstart_models, list_jumpstart_scripts, list_jumpstart_tasks
label_desc: Use image node_id 7 for calling the ListJumpStartModels obj's underlying member method code with example usage: obj.test_list_jumpstart_models_vulnerable_models(patched_read_s3_file, patched_get_manifest) and returns: json, json