code: def is_valid_input_event(
      event: metadata_store_pb2.Event,
      expected_input_key: Optional[str] = None,
  ) -> bool:
      """Evaluates whether an event is an input event with the right input key.
  
      Args:
        event: The event to evaluate.
        expected_input_key: The expected input key.
  
      Returns:
        A bool value indicating result
      """
      if event.type not in _VALID_INPUT_EVENT_TYPES:
          return False
      if expected_input_key:
          return contains_key(event, expected_input_key)
      return True
  
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 7 for calling a global function with example usage: is_valid_input_event(event, expected_input_key) and returns: True, False, contains_key