code: def test_get_store(n_peers=10):
      peers = launch_dht_instances(n_peers)
  
      node1, node2 = random.sample(peers, 2)
      assert node1.store(
          "key1", "value1", expiration_time=hivemind.get_dht_time() + 30
      )
      assert node1.get("key1").value == "value1"
      assert node2.get("key1").value == "value1"
      assert node2.get("key2") is None
  
      future = node1.get("foo", return_future=True)
      assert future.result() is None
  
      future = node1.get("foo", return_future=True)
      future.cancel()
  
      assert node2.store(
          "key1", 123, expiration_time=hivemind.get_dht_time() + 31
      )
      assert node2.store(
          "key2", 456, expiration_time=hivemind.get_dht_time() + 32
      )
      assert node1.get("key1", latest=True).value == 123
      assert node1.get("key2").value == 456
  
      assert node1.store(
          "key2",
          subkey="subkey1",
          value=789,
          expiration_time=hivemind.get_dht_time() + 32,
      )
      assert node2.store(
          "key2",
          subkey="subkey2",
          value="pew",
          expiration_time=hivemind.get_dht_time() + 32,
      )
      found_dict = node1.get("key2", latest=True).value
      assert isinstance(found_dict, dict) and len(found_dict) == 2
      assert (
          found_dict["subkey1"].value == 789
          and found_dict["subkey2"].value == "pew"
      )
  
      for peer in peers:
          peer.shutdown()
  
file_path: hivemind/tests/test_dht.py
imports: import asyncio
  import concurrent.futures
  import random
  import time
  import pytest
  from multiaddr import Multiaddr
  import hivemind
  from test_utils.dht_swarms import launch_dht_instances
  from test_utils.networking import get_free_port
label_desc: Use image node_id 1 for calling a global function with example usage: test_get_store(n_peers) without return types