#NEWLINE# @ cacheit #NEWLINE# def _inverse_cdf_expression( self ) : #NEWLINE# #INDENT# ' Inverse of the CDF\n\n        Used by sample\n        ' #NEWLINE# ( x , z ) = symbols ( 'x, z' , real = True , positive = True , cls = Dummy ) #NEWLINE# try : #NEWLINE# #INDENT# inverse_cdf = list ( solveset ( ( self . cdf ( x ) - z ) , x ) ) #NEWLINE# #UNINDENT# except NotImplementedError : #NEWLINE# #INDENT# inverse_cdf = None #NEWLINE# #UNINDENT# if ( ( not inverse_cdf ) or ( len ( z ) != 1 ) ) : #NEWLINE# #INDENT# raise NotImplementedError ( 'Could not invert CDF' ) #NEWLINE# #UNINDENT# return Lambda ( z , inverse_cdf [ 0 ] )