Repository: scipy/scipy
File: scipy/stats/_new_distributions.py (Python)

Code before:
    def _moment_raw_formula(self, order, **kwargs):
        raw_moments = {0: 1, 1: 0, 2: 1, 3: 0, 4: 3, 5: 0}
        return raw_moments.get(order, None)

    def _moment_central_formula(self, order, **kwargs):
        return self._moment_raw_formula(order, **kwargs)

    def _moment_standardized_formula(self, order, **kwargs):
        return self._moment_raw_formula(order, **kwargs)

    def _sample_formula(self, full_shape, rng, **kwargs):
        return rng.normal(size=full_shape)[()]


class Logistic(ContinuousDistribution):
    r"""Standard logistic distribution.

    The probability density function of the standard logistic distribution is:

    .. math::

        f(x) = \frac{1}{\left( e^{x / 2} + e^{-x / 2} \right)^2}

    """
    _x_support = _RealInterval(endpoints=(-inf, inf))
    _variable =_x_param = _RealParameter('x', domain=_x_support, typical=(-9, 9))
    _parameterizations = ()

    _scale = np.pi / np.sqrt(3)

    def _logpdf_formula(self, x, **kwargs):
        y = -np.abs(x)
        return y - 2 * special.log1p(np.exp(y))

    def _pdf_formula(self, x, **kwargs):
        # f(x) = sech(x / 2)**2 / 4
        return (.5 / np.cosh(x / 2))**2

    def _logcdf_formula(self, x, **kwargs):
        return special.log_expit(x)

    def _cdf_formula(self, x, **kwargs):
        return special.expit(x)

    def _logccdf_formula(self, x, **kwargs):
        return special.log_expit(-x)

    def _ccdf_formula(self, x, **kwargs):
        return special.expit(-x)

    def _icdf_formula(self, x, **kwargs):

Review comment (suggestion):
```suggestion
    _variable = _x_param = _RealParameter('x', domain=_x_support, typical=(-9, 9))
```


Code after:
    def _moment_raw_formula(self, order, **kwargs):
        raw_moments = {0: 1, 1: 0, 2: 1, 3: 0, 4: 3, 5: 0}
        return raw_moments.get(order, None)

    def _moment_central_formula(self, order, **kwargs):
        return self._moment_raw_formula(order, **kwargs)

    def _moment_standardized_formula(self, order, **kwargs):
        return self._moment_raw_formula(order, **kwargs)

    def _sample_formula(self, full_shape, rng, **kwargs):
        return rng.normal(size=full_shape)[()]


class Logistic(ContinuousDistribution):
    r"""Standard logistic distribution.

    The probability density function of the standard logistic distribution is:

    .. math::

        f(x) = \frac{1}{\left( e^{x / 2} + e^{-x / 2} \right)^2}

    """
    _x_support = _RealInterval(endpoints=(-inf, inf))
    _variable = _x_param = _RealParameter('x', domain=_x_support, typical=(-9, 9))
    _parameterizations = ()

    _scale = np.pi / np.sqrt(3)

    def _logpdf_formula(self, x, **kwargs):
        y = -np.abs(x)
        return y - 2 * special.log1p(np.exp(y))

    def _pdf_formula(self, x, **kwargs):
        # f(x) = sech(x / 2)**2 / 4
        return (.5 / np.cosh(x / 2))**2

    def _logcdf_formula(self, x, **kwargs):
        return special.log_expit(x)

    def _cdf_formula(self, x, **kwargs):
        return special.expit(x)

    def _logccdf_formula(self, x, **kwargs):
        return special.log_expit(-x)

    def _ccdf_formula(self, x, **kwargs):
        return special.expit(-x)

    def _icdf_formula(self, x, **kwargs):