code: def _is_pydantic(cls: Any) -> bool:
      """Return True if the class is a pydantic model.
  
      Checking is done by attributes as it is significantly faster than
      using isinstance.
      """
      return (
          hasattr(cls, "model_config")
          and hasattr(cls, "model_fields")
          and hasattr(cls, "model_fields_set")
      )
  
imports: from __future__ import annotations
  import dataclasses
  import enum
  import functools
  import logging
  import sys
  from importlib import import_module
  from typing import TYPE_CHECKING, Any, Pattern, TypeVar, Union, cast
  import attr
  import re2
  import airflow.serialization.serializers
  from airflow.configuration import conf
  from airflow.stats import Stats
  from airflow.utils.module_loading import import_string, iter_namespace, qualname
label_desc: Use image node_id 8 for calling a global function with example usage: _is_pydantic(cls) and returns: unknown