code: def test_ids_basic():
      # basic functionality tests
      for i in range(100):
          id1, id2 = DHTID.generate(), DHTID.generate()
          assert (
              DHTID.MIN <= id1 < DHTID.MAX
              and DHTID.MIN <= id2 <= DHTID.MAX
          )
          assert (
              DHTID.xor_distance(id1, id1)
              == DHTID.xor_distance(id2, id2)
              == 0
          )
          assert DHTID.xor_distance(id1, id2) > 0 or (id1 == id2)
          assert (
              DHTID.from_bytes(bytes(id1)) == id1
              and DHTID.from_bytes(id2.to_bytes()) == id2
          )
  
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 1 for calling a global function with example usage: test_ids_basic() without return types