#NEWLINE# def trim_relative( self , amount = 0.15 ) : #NEWLINE# #INDENT# 'A utility function used to cut a proportion of values off each end\n        of a list of values. This has the effect of limiting the\n        effect of outliers.\n\n        .. note:\n\n            This operation modifies the data in-place. It does not\n            make or return a copy.\n        ' #NEWLINE# trim = float ( amount ) #NEWLINE# if ( not ( 0.0 <= trim <= 1.0 ) ) : #NEWLINE# #INDENT# raise ValueError ( ( 'expected amount between 0.0 and 1.0, not %r' % trim ) ) #NEWLINE# #UNINDENT# size = len ( self . data ) #NEWLINE# size_diff = int ( ( size * trim ) ) #NEWLINE# if ( size_diff == 0.0 ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# self . data = self . _get_sorted_data ( ) [ size_diff : ( - size_diff ) ] #NEWLINE# self . clear_cache ( )