code: def test_none_input_data(X, y, sensitive_features, constraints):
      adjusted_predictor = ThresholdOptimizer(
          estimator=ExamplePredictor(scores_ex),
          constraints=constraints,
          predict_method="predict",
      )
  
      if y is None:
          with pytest.raises(ValueError) as exception:
              adjusted_predictor.fit(
                  X, y, sensitive_features=sensitive_features
              )
          assert str(exception.value) == _MESSAGE_Y_NONE
      elif X is None:
          with pytest.raises(ValueError) as exception:
              adjusted_predictor.fit(
                  X, y, sensitive_features=sensitive_features
              )
          assert "Expected 2D array, got scalar array instead" in str(
              exception.value
          )
      elif sensitive_features is None:
          with pytest.raises(ValueError) as exception:
              adjusted_predictor.fit(
                  X, y, sensitive_features=sensitive_features
              )
          assert (
              str(exception.value) == _MESSAGE_SENSITIVE_FEATURES_NONE
          )
      else:
          # skip since no arguments are None
          pass
  
imports: from copy import deepcopy
  from test.unit.input_convertors import _map_into_single_column
  import numpy
  import pandas
  import pytest
  from sklearn.base import BaseEstimator, ClassifierMixin
  from sklearn.datasets import make_classification
  from fairlearn.postprocessing import ThresholdOptimizer
  from fairlearn.postprocessing._threshold_optimizer import BASE_ESTIMATOR_NONE_ERROR_MESSAGE, NOT_SUPPORTED_CONSTRAINTS_ERROR_MESSAGE
  from fairlearn.postprocessing._tradeoff_curve_utilities import DEGENERATE_LABELS_ERROR_MESSAGE
  from fairlearn.utils._input_validation import _LABELS_NOT_0_1_ERROR_MESSAGE, _MESSAGE_SENSITIVE_FEATURES_NONE, _MESSAGE_Y_NONE
  from .conftest import ExamplePredictor, X_ex, _get_predictions_by_sensitive_feature, candidate_A_transforms, candidate_X_transforms, candidate_Y_transforms, degenerate_labels_ex, is_invalid_transformation, labels_ex, scores_ex, sensitive_feature_names_ex1, sensitive_features_ex1
label_desc: Use image node_id 4 for calling a global function with example usage: test_none_input_data(X, y, sensitive_features, constraints) without return types