code: def reinforce_lv_branches_overloading(grid, crit_branches):
      
      unsolved_branches = []
  
      cable_lf = cfg_ding0.get('assumptions',
                               'load_factor_lv_cable_lc_normal')
  
      cables = grid.network.static_data['LV_cables']
  
      # resolve overloading issues for each branch segment
      for branch in crit_branches:
          I_max_branch_load = branch['s_max'][0]
          I_max_branch_gen = branch['s_max'][1]
          I_max_branch = max([I_max_branch_load, I_max_branch_gen])
  
          suitable_cables = cables[(cables['I_max_th'] * cable_lf)
                            > I_max_branch]
  
          if not suitable_cables.empty:
              cable_type = suitable_cables.loc[suitable_cables['I_max_th'].idxmin(), :]
              branch['branch'].type = cable_type
              crit_branches.remove(branch)
          else:
              cable_type_max = cables.loc[cables['I_max_th'].idxmax(), :]
              unsolved_branches.append(branch)
              branch['branch'].type = cable_type_max
              logger.error("No suitable cable type could be found for {branch} "
                            "with I_th_max = {current}. "
                            "Cable of type {cable} is chosen during "
                            "reinforcement.".format(
                  branch=branch['branch'],
                  cable=cable_type_max.name,
                  current=I_max_branch
              ))
  
      return unsolved_branches
docs: Choose appropriate cable type for branches with line overloading
  
      Parameters
      ----------
      grid : LVGridDing0
          Ding0 LV grid object
      crit_branches : :any:`list`
          List of critical branches incl. its line loading
  
      Notes
      -----
      If maximum size cable is not capable to resolve issue due to line
      overloading largest available cable type is assigned to branch.
  
      Returns
      -------
      :any:`list`
          unsolved_branches : List of braches no suitable cable could be found