code: def equality_typechecker(eq_func: Callable) -> Callable:
      """A decorator to wrap all __eq__ methods to ensure that the inputs
      are of the right type.
      """
  
      # no type annotation for now; breaks sphinx-autodoc-typehints
      # pyre-fixme[3]: Return type must be annotated.
      # pyre-fixme[2]: Parameter must be annotated.
      def _type_safe_equals(self, other):
          if not isinstance(other, self.__class__):
              return False
          return eq_func(self, other)
  
      return _type_safe_equals
  
file_path: Ax/ax/utils/common/equality.py
imports: from __future__ import annotations
  from datetime import datetime
  from typing import Any, Callable, Dict, List, Optional, Tuple
  import numpy
  import pandas
  from ax.utils.common.typeutils import numpy_type_to_python_type
label_desc: Use image node_id 1 for calling a global function with example usage: equality_typechecker(eq_func) and returns: _type_safe_equals, eq_func, False