code: def test_load_state_from_peers():
      dht1 = hivemind.DHT(start=True)
      dht2 = hivemind.DHT(
          initial_peers=dht1.get_visible_maddrs(), start=True
      )
  
      model1 = nn.Linear(2, 3)
      model2 = nn.Linear(2, 3)
  
      common_kwargs = dict(
          optimizer=partial(torch.optim.SGD, lr=0.1),
          scheduler=partial(
              torch.optim.lr_scheduler.LambdaLR,
              lr_lambda=lambda t: 1.0 / max(1, t),
          ),
          target_group_size=2,
          prefix="my_exp",
      )
  
      avgr1 = TrainingStateAverager(
          dht=dht1,
          params=model1.parameters(),
          allow_state_sharing=False,
          start=True,
          **common_kwargs,
      )
  
      avgr2 = TrainingStateAverager(
          dht=dht2,
          params=model2.parameters(),
          start=True,
          **common_kwargs,
      )
  
      avgr2.local_epoch = 1337
      model2.weight.data[...] = 42
      time.sleep(0.1)
  
      avgr1.load_state_from_peers()
      assert avgr1.local_epoch == 1337
      assert torch.all(model1.weight == 42).item()
      assert np.allclose(
          avgr1.optimizer.param_groups[0]["lr"], 0.1 / 1337
      )
  
imports: import ctypes
  import multiprocessing
  import time
  from functools import partial
  import numpy
  import pytest
  import torch
  import torch.nn
  import torch.nn.functional
  import hivemind
  from hivemind.averaging.control import AveragingStage
  from hivemind.optim.grad_averager import GradientAverager, GradientAveragerFactory
  from hivemind.optim.optimizer import Optimizer
  from hivemind.optim.power_sgd_averager import PowerSGDGradientAverager
  from hivemind.optim.progress_tracker import ProgressTracker
  from hivemind.optim.state_averager import ZERO_GRAD_SET_TO_NONE_DEFAULT, TrainingStateAverager
  from hivemind.utils.crypto import RSAPrivateKey
label_desc: Use image node_id 4 for calling a global function with example usage: test_load_state_from_peers() without return types