code: def test_remove_expired_tickets():
      lock = TicketLock("random id 1")
  
      # issue one long- and one short-lived ticket
      _ = list(map(lock.issue_ticket, [k for k in [0.01, 10]]))
  
      # both tickets are there
      assert len(lock.tickets) == 2
  
      # sleep and only one ticket should be left
      time.sleep(0.02)
      lock.remove_expired_tickets()
      assert len(lock.tickets) == 1
  
imports: import asyncio
  import logging
  import sys
  import time
  from pathlib import Path
  from typing import Text
  from unittest.mock import Mock, patch
  import numpy
  import pytest
  import rasa.core.lock_store
  from _pytest.logging import LogCaptureFixture
  from _pytest.monkeypatch import MonkeyPatch
  from rasa.core.agent import Agent
  from rasa.core.channels import UserMessage
  from rasa.core.constants import DEFAULT_LOCK_LIFETIME
  from rasa.core.lock import TicketLock
  from rasa.core.lock_store import DEFAULT_REDIS_LOCK_STORE_KEY_PREFIX, InMemoryLockStore, LockError, LockStore, RedisLockStore
  from rasa.shared.constants import INTENT_MESSAGE_PREFIX
  from rasa.shared.exceptions import ConnectionException
  from rasa.utils.endpoints import EndpointConfig, read_endpoint_config
label_desc: Use image node_id 2 for calling a global function with example usage: test_remove_expired_tickets() without return types