code: def _compute_weight(powers, wg):
      
      # split
      pow1 = (powers[0], 0)
      pow2 = (0, powers[1])
  
      cal1 = _compute_value(pow1, wg)
      cal2 = _compute_value(pow2, wg)
  
      return cal1 * cal2
docs: Return the weight corresponding to given powers.