docs: def select_cable(network, level, apparent_power):
      """Selects an appropriate cable type and quantity using given apparent
      power.
  
      Considers load factor.
  
      Parameters
      ----------
      network : :class:`~.grid.network.Network`
          The eDisGo container object
      level : :obj:`str`
          Grid level ('mv' or 'lv')
      apparent_power : :obj:`float`
          Apparent power the cable must carry in kVA
  
      Returns
      -------
      :pandas:`pandas.Series<series>`
          Cable type
      :obj:`ìnt`
          Cable count
  
      Notes
      ------
      Cable is selected to be able to carry the given `apparent_power`, no load
      factor is considered.
  
      """
  
      cable_count = 1
  
      if level == 'mv':
  
          available_cables = network.equipment_data['mv_cables'][
              network.equipment_data['mv_cables']['U_n'] ==
              network.mv_grid.voltage_nom]
  
          suitable_cables = available_cables[
              available_cables['I_max_th'] *
              network.mv_grid.voltage_nom > apparent_power]
  
          # increase cable count until appropriate cable type is found
          while suitable_cables.empty and cable_count < 20:
              cable_count += 1
              suitable_cables = available_cables[
                  available_cables['I_max_th'] *
                  network.mv_grid.voltage_nom *
                  cable_count > apparent_power]
          if suitable_cables.empty and cable_count == 20:
              raise exceptions.MaximumIterationError(
                  "Could not find a suitable cable for apparent power of "
                  "{} kVA.".format(apparent_power))
  
          cable_type = suitable_cables.ix[suitable_cables['I_max_th'].idxmin()]
  
      elif level == 'lv':
  
          suitable_cables = network.equipment_data['lv_cables'][
              network.equipment_data['lv_cables']['I_max_th'] *
              network.equipment_data['lv_cables']['U_n'] > apparent_power]
  
          # increase cable count until appropriate cable type is found
          while suitable_cables.empty and cable_count < 20:
              cable_count += 1
              suitable_cables = network.equipment_data['lv_cables'][
                  network.equipment_data['lv_cables']['I_max_th'] *
                  network.equipment_data['lv_cables']['U_n'] *
                  cable_count > apparent_power]
          if suitable_cables.empty and cable_count == 20:
              raise exceptions.MaximumIterationError(
                  "Could not find a suitable cable for apparent power of "
                  "{} kVA.".format(apparent_power))
  
          cable_type = suitable_cables.ix[suitable_cables['I_max_th'].idxmin()]
  
      else:
          raise ValueError('Please supply a level (either \'mv\' or \'lv\').')
  
      return cable_type, cable_count