code: def test_requests_timed_out(conn):
      with mock.patch("time.time", return_value=0):
          # No in-flight requests, not timed out
          assert not conn.requests_timed_out()
  
          # Single request, timestamp = now (0)
          conn.in_flight_requests[0] = ("foo", 0)
          assert not conn.requests_timed_out()
  
          # Add another request w/ timestamp > request_timeout ago
          request_timeout = conn.config["request_timeout_ms"]
          expired_timestamp = 0 - request_timeout - 1
          conn.in_flight_requests[1] = ("bar", expired_timestamp)
          assert conn.requests_timed_out()
  
          # Drop the expired request and we should be good to go again
          conn.in_flight_requests.pop(1)
          assert not conn.requests_timed_out()
  
imports: from __future__ import absolute_import
  from errno import EALREADY, EINPROGRESS, EISCONN, ECONNRESET
  import socket
  import mock
  import pytest
  from kafka.conn import BrokerConnection, ConnectionStates, collect_hosts
  from kafka.protocol.api import RequestHeader
  from kafka.protocol.metadata import MetadataRequest
  from kafka.protocol.produce import ProduceRequest
  import kafka.errors
label_desc: Use image node_id 26 for calling a global function with example usage: test_requests_timed_out(conn) without return types