code: def event_factory(resource_version):
      """Create an event."""
      mock_event = MagicMock()
      mock_event.get.return_value.metadata.resource_version = (
          resource_version
      )
      return mock_event
  
file_path: wandb/tests/pytest_tests/unit_tests/test_launch/test_runner/test_safe_watch.py
imports: from unittest.mock import MagicMock
  import pytest
  from kubernetes.client import ApiException
  from urllib3.exceptions import ProtocolError
  from wandb.sdk.launch.runner.kubernetes_monitor import SafeWatch
label_desc: Use image node_id 1 for calling a global function with example usage: event_factory(resource_version) and returns: mock_event