code: def checked_cast_dict(
      key_typ: Type[K], value_typ: Type[V], d: Dict[X, Y]
  ) -> Dict[K, V]:
      """Calls checked_cast on all keys and values in the dictionary."""
      new_dict = {}
      for key, val in d.items():
          val = checked_cast(value_typ, val)
          key = checked_cast(key_typ, key)
          new_dict[key] = val
      return new_dict
  
file_path: Ax/ax/utils/common/typeutils.py
imports: from inspect import signature
  from typing import Any, Dict, List, Optional, Tuple, Type, TypeVar
  import numpy
  from typeguard import check_type
label_desc: Use image node_id 5 for calling a global function with example usage: checked_cast_dict(key_typ, value_typ, d) and returns: new_dict