@cacheit
    def _inverse_cdf_expression(self):
        """ Inverse of the CDF

        Used by sample
        """
        x, z = symbols('x, z', real=True, positive=True, cls=Dummy)
        # Invert CDF
        try:
            inverse_cdf = list(solveset(self.cdf(x) - z, x))
        except __HOLE__:
            inverse_cdf = None
        if not inverse_cdf or len(inverse_cdf) != 1:
            raise NotImplementedError("Could not invert CDF")

        return Lambda(z, inverse_cdf[0])
dataset/ETHPy150Open sympy/sympy/sympy/stats/drv.py/SingleDiscreteDistribution._inverse_cdf_expression