'Inverse of the CDF
Used by sample'

@cacheit
def _inverse_cdf_expression(self):

    (x, z) = symbols('x,    z', real=True, positive=True, cls=Dummy)
    try:
        inverse_cdf = solveset((self.cdf(x) - z), x, S.Reals)
        if (isinstance(inverse_cdf, Intersection) and (S.Reals in inverse_cdf.args)):
            inverse_cdf = list(inverse_cdf.args[1])
    except NotImplementedError:
        inverse_cdf = None
    if ((not inverse_cdf) or (len(inverse_cdf) != 1)):
        raise NotImplementedError('Could    not    invert    CDF')
    return Lambda(z, inverse_cdf[0])
