code: def test_export_trackers_with_offset(
      tmp_path: Path, monkeypatch: MonkeyPatch
  ):
      (
          events,
          namespace,
      ) = prepare_namespace_and_mocked_tracker_store_with_events(
          tmp_path, monkeypatch
      )
  
      # mock event broker so we can check its `publish` method is called
      event_broker = Mock()
  
      async def _get_event_broker(
          _: rasa_core_utils.AvailableEndpoints,
      ) -> EventBroker:
          return event_broker
  
      async def close():
          pass
  
      event_broker.close = close
      monkeypatch.setattr(
          export, "_get_event_broker", _get_event_broker
      )
  
      # run the export function
      export.export_trackers(namespace)
  
      # check that only events 1, 2, 3, and 4 have been published
      # event 6 was sent by `id-3` which was not requested, and event 5
      # lies outside the requested time range
      calls = event_broker.publish.mock_calls
  
      # only four events were published (i.e. `publish()` method was called four times)
      assert len(calls) == 4
  
      # call objects are tuples of (name, pos. args, kwargs)
      # args itself is a tuple, and we want to access the first one, hence `call[1][0]`
      # check that events 1-4 were published
      assert all(
          any(call[1][0]["text"] == event.text for call in calls)
          for event in events[:4]
      )
  
      # check that the timestamps of the published events are offset by 100 seconds
      assert all(
          any(
              call[1][0]["timestamp"] == event.timestamp + 100
              for call in calls
          )
          for event in events[:4]
      )
  
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 9 for calling a global function with example usage: test_export_trackers_with_offset(tmp_path, monkeypatch) and returns: event_broker