Repository: scikit-learn/scikit-learn
File: sklearn/svm/_base.py (Python)

Code before:
                accept_sparse="csr",
                accept_large_sparse=False,
            )

        y = self._validate_targets(y)

        sample_weight = np.asarray(
            [] if sample_weight is None else sample_weight, dtype=np.float64
        )
        solver_type = LIBSVM_IMPL.index(self._impl)

        probability = self.probability
        if self._impl in ["c_svc", "nu_svc"]:
            if self._impl == "nu_scv":
                est_dep = "NuSVC"
            else:
                est_dep = "SVC"
            if self.probability != "deprecated":
                warnings.warn(
                    f"parameter `probability` will be deprecated in version 1.8, "
                    f"use `CalibratedClassifierCV({est_dep}(), ensemble=False)` "
                    f"instead of `{est_dep}(probability=True)`",
                    FutureWarning,
                )
            else:
                probability = False

        # input validation
        n_samples = _num_samples(X)
        if solver_type != 2 and n_samples != y.shape[0]:
            raise ValueError(
                "X and y have incompatible shapes.\n"
                + "X has %s samples, but y has %s." % (n_samples, y.shape[0])
            )

        if self.kernel == "precomputed" and n_samples != X.shape[1]:
            raise ValueError(
                "Precomputed matrix must be a square matrix."
                " Input is a {}x{} matrix.".format(X.shape[0], X.shape[1])
            )

        if sample_weight.shape[0] > 0 and sample_weight.shape[0] != n_samples:
            raise ValueError(
                "sample_weight and X have incompatible shapes: "
                "%r vs %r\n"
                "Note: Sparse matrices cannot be indexed w/"
                "boolean masks (use `indices=True` in CV)."
                % (sample_weight.shape, X.shape)
            )

        kernel = "precomputed" if callable(self.kernel) else self.kernel

Review comment (refactor):
I think it would make sense to have something like `self._effective_probability` or a better name so that you can reuse it and simplify the code in other places, rather than having some logic like 

```py
probability = self.probability
if self._impl in ["c_svc", "nu_svc"] and self.probability == "deprecated":
    probability = False
...
some_function(..., probability)
```
you would be able to do:
```py
some_function(..., self._effective_probability)
```

Code after:
                accept_sparse="csr",
                accept_large_sparse=False,
            )

        y = self._validate_targets(y)

        sample_weight = np.asarray(
            [] if sample_weight is None else sample_weight, dtype=np.float64
        )
        solver_type = LIBSVM_IMPL.index(self._impl)

        # TODO(1.11): remove probability
        self._effective_probability = self.probability
        if self._impl in ["c_svc", "nu_svc"]:
            if self._impl == "nu_scv":
                est_dep = "NuSVC"
            else:
                est_dep = "SVC"
            if self.probability != "deprecated":
                warnings.warn(
                    f"The `probability` parameter was deprecated in 1.9 and "
                    f"will be removed in version 1.11. "
                    f"Use `CalibratedClassifierCV({est_dep}(), ensemble=False)` "
                    f"instead of `{est_dep}(probability=True)`",
                    FutureWarning,
                )
            else:
                self._effective_probability = False

        # input validation
        n_samples = _num_samples(X)
        if solver_type != 2 and n_samples != y.shape[0]:
            raise ValueError(
                "X and y have incompatible shapes.\n"
                + "X has %s samples, but y has %s." % (n_samples, y.shape[0])
            )

        if self.kernel == "precomputed" and n_samples != X.shape[1]:
            raise ValueError(
                "Precomputed matrix must be a square matrix."
                " Input is a {}x{} matrix.".format(X.shape[0], X.shape[1])
            )

        if sample_weight.shape[0] > 0 and sample_weight.shape[0] != n_samples:
            raise ValueError(
                "sample_weight and X have incompatible shapes: "
                "%r vs %r\n"
                "Note: Sparse matrices cannot be indexed w/"
                "boolean masks (use `indices=True` in CV)."
                % (sample_weight.shape, X.shape)
            )