code: def test_routing_table_parameters():
      for bucket_size, modulo, min_nbuckets, max_nbuckets in [
          (20, 5, 45, 65),
          (50, 5, 35, 45),
          (20, 10, 650, 800),
          (20, 1, 7, 15),
      ]:
          node_id = DHTID.generate()
          routing_table = RoutingTable(
              node_id, bucket_size=bucket_size, depth_modulo=modulo
          )
          for phony_neighbor_port in random.sample(
              range(1_000_000), 10_000
          ):
              routing_table.add_or_update_node(
                  DHTID.generate(), f"{LOCALHOST}:{phony_neighbor_port}"
              )
          for bucket in routing_table.buckets:
              assert (
                  len(bucket.replacement_nodes) == 0
                  or len(bucket.nodes_to_peer_id) <= bucket.size
              )
          assert (
              min_nbuckets <= len(routing_table.buckets) <= max_nbuckets
          ), f"Unexpected number of buckets: {min_nbuckets} <= {len(routing_table.buckets)} <= {max_nbuckets}"
  
file_path: hivemind/tests/test_routing.py
imports: import heapq
  import operator
  import random
  from itertools import chain, zip_longest
  from hivemind.dht.routing import DHTID, RoutingTable
  from hivemind.utils.networking import LOCALHOST
label_desc: Use image node_id 4 for calling a global function with example usage: test_routing_table_parameters() without return types