code: def get_cost(vector_size, partitions, bandwidths):
      return max(
          (
              vector_size
              - partitions[i]
              + (len(partitions) - 1) * partitions[i]
          )
          / max(bandwidths[i], 1e-9)
          for i in range(len(partitions))
      )
  
imports: import random
  import time
  import numpy
  import pytest
  import torch
  import hivemind
  from hivemind.averaging import DecentralizedAverager
  from hivemind.averaging.allreduce import AveragingMode
  from hivemind.averaging.control import AveragingStage
  from hivemind.averaging.key_manager import GroupKeyManager
  from hivemind.averaging.load_balancing import load_balance_peers
  from hivemind.averaging.partition import AllreduceException
  from hivemind.p2p import PeerID
  from test_utils.dht_swarms import launch_dht_instances
label_desc: Use image node_id 8 for calling a global function with example usage: get_cost(vector_size, partitions, bandwidths) and returns: max