code: def test_is_model_card_object_descriptor():
      class ExampleClass:  # pylint: disable=C0115
          attr1 = _IsModelCardObject(ModelOverview)
  
          def __init__(self, attr1):  # pylint: disable=C0116
              self.attr1 = attr1
  
      assert ExampleClass(ModelOverview())
  
      with pytest.raises(
          ValueError,
          match=re.escape(
              "Expected <class 'sagemaker.model_card.model_card.IntendedUses'> instance to be of class ModelOverview"  # noqa E501  # pylint: disable=c0301
          ),
      ):
          ExampleClass(attr1=IntendedUses())
  
      # decode object from json data
      assert ExampleClass({"model_name": "test"})
  
      with pytest.raises(TypeError) as exception:
          ExampleClass({"test_attr": "test_val"})
      assert exception.value.args[0].endswith(
          "__init__() got an unexpected keyword argument 'test_attr'"
      )
  
imports: from __future__ import absolute_import
  import io
  import os
  import json
  import datetime
  import re
  import logging
  import pytest
  from mock import patch, Mock
  from botocore.exceptions import ClientError
  import botocore.response
  from sagemaker.model_card import schema_constraints
  from sagemaker.model_card import Environment, ModelOverview, IntendedUses, BusinessDetails, ObjectiveFunction, TrainingMetric, HyperParameter, Metric, TrainingDetails, MetricGroup, EvaluationJob, AdditionalInformation, ModelCard, Function, TrainingJobDetails, ModelPackage
  from sagemaker.model_card.model_card import ModelCardExportJob, ModelPackageCreator, SourceAlgorithm, Container, InferenceSpecification
  from sagemaker.model_card.helpers import _MaxSizeArray, _IsList, _OneOf, _IsModelCardObject, _JSONEncoder, _hash_content_str, _DefaultToRequestDict, _SkipEncodingDecoding
  from sagemaker.model_card.evaluation_metric_parsers import EvaluationMetricTypeEnum, EVALUATION_METRIC_PARSERS
label_desc: Use image node_id 21 for calling a global function with example usage: test_is_model_card_object_descriptor() without return types