def format_power(power):
 if (not isinstance(power, Fraction)):
  if ((power % 1.0) != 0.0):
   frac = Fraction.from_float(power)
   power = frac.limit_denominator(10)
   if (power.denominator == 1):
    power = int(power.numerator)
  else:
   power = int(power)
 return six.text_type(power)

def format_power ( power ) : if ( not isinstance ( power , Fraction ) ) : if ( ( power % 1.0 ) != 0.0 ) : frac = Fraction . from_float ( power ) power = frac . limit_denominator ( 10 ) if ( power . denominator == 1 ) : power = int ( power . numerator ) else : power = int ( power ) return six . text_type ( power )
converts a value for a power .