code: def extend_distribution_substation_overvoltage(network, critical_stations):
      
  
      # get parameters for standard transformer
      try:
          standard_transformer = network.equipment_data['lv_trafos'].loc[
              network.config['grid_expansion_standard_equipment'][
                  'mv_lv_transformer']]
      except KeyError:
          print('Standard MV/LV transformer is not in equipment list.')
  
      transformers_changes = {'added': {}}
      for grid in critical_stations.keys():
  
          # get any transformer to get attributes for new transformer from
          station_transformer = grid.station.transformers[0]
  
          new_transformer = Transformer(
              id='LVStation_{}_transformer_{}'.format(
                  str(grid.station.id), str(len(grid.station.transformers) + 1)),
              geom=station_transformer.geom,
              mv_grid=station_transformer.mv_grid,
              grid=station_transformer.grid,
              voltage_op=station_transformer.voltage_op,
              type=copy.deepcopy(standard_transformer))
  
          # add standard transformer to station and return value
          grid.station.add_transformer(new_transformer)
          transformers_changes['added'][grid.station] = [new_transformer]
  
      if transformers_changes['added']:
          logger.debug("==> {} LV station(s) has/have been reinforced ".format(
              str(len(transformers_changes['added']))) +
                      "due to overloading issues.")
  
      return transformers_changes
docs: Reinforce MV/LV substations due to voltage issues.
  
      A parallel standard transformer is installed.
  
      Parameters
      ----------
      network : :class:`~.grid.network.Network`
      critical_stations : :obj:`dict`
          Dictionary with :class:`~.grid.grids.LVGrid` as key and a
          :pandas:`pandas.DataFrame<dataframe>` with its critical station and
          maximum voltage deviation as value.
          Index of the dataframe is the :class:`~.grid.components.LVStation`
          with over-voltage issues. Columns are 'v_mag_pu' containing the
          maximum voltage deviation as float and 'time_index' containing the
          corresponding time step the over-voltage occured in as
          :pandas:`pandas.Timestamp<timestamp>`.
  
      Returns
      -------
      Dictionary with lists of added transformers.