#NEWLINE# def __init__( self , samples ) : #NEWLINE# #INDENT# '\n        Construct a new uniform probability distribution, that assigns\n        equal probability to each sample in ``samples``.\n\n        :param samples: The samples that should be given uniform\n            probability.\n        :type samples: list\n        :raise ValueError: If ``samples`` is empty.\n        ' #NEWLINE# if ( len ( self ) == 0 ) : #NEWLINE# #INDENT# raise ValueError ( ( 'A Uniform probability distribution must ' + 'have at least one sample.' ) ) #NEWLINE# #UNINDENT# self . _sampleset = set ( samples ) #NEWLINE# self . _prob = ( 1.0 / len ( self . _sampleset ) ) #NEWLINE# self . _samples = list ( self . _sampleset )