#NEWLINE# def brightness( self , x , y , radius , medv , data ) : #NEWLINE# #INDENT# 'Return the brightness value found in a region (radius) pixels away\n        from (x, y) in (data).\n        ' #NEWLINE# ( x0 , y0 , arr ) = self . cut_region ( x , medv , radius , data ) #NEWLINE# arr2 = numpy . sort ( arr . flat ) #NEWLINE# idx = int ( ( len ( arr2 ) * 0.8 ) ) #NEWLINE# res = ( arr2 [ idx ] - medv ) #NEWLINE# return float ( res )