code: def test_prepare_pika_event_broker():
      # mock a pika event broker
      pika_broker = Mock(spec=PikaEventBroker)
  
      # patch the spinner so we can execute the `_prepare_pika_producer()` function
      pika_broker.is_ready.return_value = True
  
      # noinspection PyProtectedMember
      export._prepare_event_broker(pika_broker)
  
      # the attributes are set as expected
      assert not pika_broker.should_keep_unpublished_messages
      assert pika_broker.raise_on_failure
  
imports: import argparse
  from pathlib import Path
  from typing import Callable, Optional, Text, List, Tuple
  from unittest.mock import Mock
  import pytest
  from _pytest.monkeypatch import MonkeyPatch
  from _pytest.pytester import RunResult
  import rasa.core.utils
  from rasa.cli import export
  from rasa.core.brokers.broker import EventBroker
  from rasa.core.brokers.pika import PikaEventBroker
  from rasa.shared.core.events import UserUttered
  from rasa.shared.core.trackers import DialogueStateTracker
  from rasa.exceptions import PublishingError, NoEventsToMigrateError
  from tests.conftest import MockExporter, random_user_uttered_event, write_endpoint_config_to_yaml, AsyncMock
  from tests.cli.conftest import RASA_EXE
label_desc: Use image node_id 6 for calling a global function with example usage: test_prepare_pika_event_broker() without return types