code: def __init__(
      self, ctx: Context, aggregator_name: str = None, is_mock=True
  ) -> None:
      super().__init__(ctx, aggregator_name)
  
      weight_list = self._collect(ctx, self.suffix["local_weight"]())
      weight_sum = sum(weight_list)
      ret_weight = []
      for w in weight_list:
          ret_weight.append(w / weight_sum)
  
      ret_suffix = self.suffix["computed_weight"]()
      for idx, w in enumerate(ret_weight):
          self._broadcast(ctx, w, ret_suffix, idx)
  
      self.aggregator_name = (
          "default" if aggregator_name is None else aggregator_name
      )
      self.model_aggregator = sa_server(
          prefix=self.aggregator_name + "_model",
          is_mock=is_mock,
          ranks=[ctx.guest.rank, *ctx.hosts.ranks],
      )
      self.loss_aggregator = sa_server(
          prefix=self.aggregator_name + "_loss",
          is_mock=is_mock,
          ranks=[ctx.guest.rank, *ctx.hosts.ranks],
      )
  
imports: import logging
  from typing import Optional
  import numpy
  import torch
  from fate.arch import Context
  from fate.arch.protocol.secure_aggregation._secure_aggregation import SecureAggregatorClient
  from fate.arch.protocol.secure_aggregation._secure_aggregation import SecureAggregatorServer
label_desc: Use image node_id 1 to create a new BaseAggregatorServer object from inherited base classes: Aggregator with example: obj = BaseAggregatorServer(ctx, aggregator_name, is_mock)