code: def _raise_if_not_threshold_optimizer(obj):
      if not isinstance(obj, ThresholdOptimizer):
          raise ValueError(
              "Argument {} needs to be of type {}.".format(
                  obj.__name__, ThresholdOptimizer.__name__
              )
          )
  
file_path: fairlearn/fairlearn/postprocessing/_plotting.py
imports: from sklearn.utils.validation import check_is_fitted
  from ._constants import _MATPLOTLIB_IMPORT_ERROR_MESSAGE
  from ._threshold_optimizer import ThresholdOptimizer
label_desc: Use image node_id 5 for calling a global function with example usage: _raise_if_not_threshold_optimizer(obj) without return types