#NEWLINE# def mapper( self , _ , line ) : #NEWLINE# #INDENT# '\n        For each log line, with probability self.sampling_probability,\n        yield a None key, and (random seed, line) as the value, so that\n        the values get sorted randomly and fed into a single reducer.\n\n        Args:\n            line - raw log line\n\n        Yields:\n            key - None\n            value - (random seed, line)\n        ' #NEWLINE# if ( random . random ( ) < self . sampling_probability ) : #NEWLINE# #INDENT# seed = ( '%20i' % random . randint ( 0 , sys . maxsize ) ) #NEWLINE# ( yield ( None , ( seed , line ) ) )