def _ss(data, c=None):
 if (c is None):
  c = mean(data)
 (T, total, count) = _sum((((x - c) ** 2) for x in data))
 (U, total2, count2) = _sum(((x - c) for x in data))
 assert ((T == U) and (count == count2))
 total -= ((total2 ** 2) / len(data))
 assert (not (total < 0)), ('negative sum of square deviations: %f' % total)
 return (T, total)

def _ss ( data , c = None ) : if ( c is None ) : c = mean ( data ) ( T , total , count ) = _sum ( ( ( ( x - c ) ** 2 ) for x in data ) ) ( U , total2 , count2 ) = _sum ( ( ( x - c ) for x in data ) ) assert ( ( T == U ) and ( count == count2 ) ) total -= ( ( total2 ** 2 ) / len ( data ) ) assert ( not ( total < 0 ) ) , ( 'negative sum of square deviations: %f' % total ) return ( T , total )
return sum of square deviations of sequence data .