code: def contains_key(event: metadata_store_pb2.Event, key: str) -> bool:
      """Checks if the event has a matching a key in its path."""
      # Ignores errors during event.path parsing which indicates the event is
      # invalid, and returns False.
      with contextlib.suppress(ValueError):
          for path_key, _ in _parse_path(event):
              if key == path_key:
                  return True
      return False
  
file_path: tfx/tfx/orchestration/portable/mlmd/event_lib.py
imports: import collections
  import contextlib
  from typing import Dict, List, Optional, Sequence, Tuple, TypeVar
  from tfx import types
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 8 for calling a global function with example usage: contains_key(event, key) and returns: False, True