class_docstr: Data Model
class_docstr_tok: ["Data","Model"]
code: def assert_isinstance(value, field_name, expected, is_array=False):
      if not is_array:
          if not isinstance(value, expected):
              raise TypeError(
                  "Expected %s of type %s, got %s"
                  % (field_name, expected, type(value).__name__)
              )
          return
  
      if not all(isinstance(x, expected) for x in value):
          raise TypeError(
              "Expected %s of type list[%s], got %s"
              % (
                  field_name,
                  expected,
                  ", ".join(set(type(x).__name__ for x in value)),
              )
          )
  
imports: import keyword
  import enum
  import json
  from datetime import datetime
  import jsonschema
  from enum import Enum
  import six
label_desc: Use image node_id 6 for calling the DataModel obj's underlying member method code with example usage: obj.assert_isinstance(value, field_name, expected, is_array) without return types