code: def has_custom_method(
      spec: type[BaseEngineSpec], method: str
  ) -> bool:
      """
      Check if a class has a custom implementation of a method.
  
      Since some classes don't inherit directly from ``BaseEngineSpec`` we need
      to check the attributes of the spec and the base class.
      """
      return bool(
          getattr(spec, method, False)
          and getattr(BaseEngineSpec, method, False)
          and getattr(spec, method).__qualname__
          != getattr(BaseEngineSpec, method).__qualname__
      )
  
file_path: superset/superset/db_engine_specs/lib.py
imports: from __future__ import annotations
  from typing import Any
  from superset.constants import TimeGrain
  from superset.db_engine_specs import load_engine_specs
  from superset.db_engine_specs.base import BaseEngineSpec
label_desc: Use image node_id 1 for calling a global function with example usage: has_custom_method(spec, method) and returns: bool