code: def _is_typed_dict_compatible(
      value: Any, tp: _TTypedDict
  ) -> TypeGuard[_TTypedDict]:
      """Checks if the value is compatible with the given TypedDict."""
      # pytype: disable=attribute-error
      return (
          isinstance(value, dict)
          and all(k in value for k in _get_typed_dict_required_keys(tp))
          and all(k in _get_annotations(tp) for k in value)
          and all(
              is_compatible(v, _get_annotations(tp)[k])
              for k, v in value.items()
          )
      )
  
file_path: tfx/tfx/utils/pure_typing_utils.py
imports: import collections.abc
  import inspect
  import sys
  import types
  import typing
  from typing import Any, Iterable, Literal, Mapping, Type, TypeVar, TypedDict
  from typing_extensions import Annotated, NotRequired, Required, TypeGuard
  from google.protobuf.internal import enum_type_wrapper
label_desc: Use image node_id 3 for calling a global function with example usage: _is_typed_dict_compatible(value, tp) and returns: unknown