def _calc_cp(base_attack, base_defense, base_stamina, iv_attack=15, iv_defense=15, iv_stamina=15, cp_multiplier=0.0):
 assert (base_attack > 0)
 assert (base_defense > 0)
 assert (base_stamina > 0)
 if (cp_multiplier <= 0.0):
  cp_multiplier = LevelToCPm.MAX_CPM
  assert (cp_multiplier > 0.0)
 return (((((base_attack + iv_attack) * ((base_defense + iv_defense) ** 0.5)) * ((base_stamina + iv_stamina) ** 0.5)) * (cp_multiplier ** 2)) / 10)

def _calc_cp ( base_attack , base_defense , base_stamina , iv_attack = 15 , iv_defense = 15 , iv_stamina = 15 , cp_multiplier = 0.0 ) : assert ( base_attack > 0 ) assert ( base_defense > 0 ) assert ( base_stamina > 0 ) if ( cp_multiplier <= 0.0 ) : cp_multiplier = LevelToCPm . MAX_CPM assert ( cp_multiplier > 0.0 ) return ( ( ( ( ( base_attack + iv_attack ) * ( ( base_defense + iv_defense ) ** 0.5 ) ) * ( ( base_stamina + iv_stamina ) ** 0.5 ) ) * ( cp_multiplier ** 2 ) ) / 10 )
cp calculation cp = / 10 cp = * ^0 .