code: def test_estimate_competence(
      example_estimate_competence, create_pool_classifiers
  ):
      (
          _,
          y,
          nn,
          _,
          dsel_processed,
          dsel_scores,
      ) = example_estimate_competence
  
      query = np.ones((1, 2))
      meta_test = METADES(create_pool_classifiers)
      meta_test.n_classifiers_ = 3
      meta_test.k_ = 7
      meta_test.Kp_ = 5
      # Set the state of the system which is set by the fit method.
      meta_test.DSEL_processed_ = dsel_processed
      meta_test.dsel_scores_ = dsel_scores
      meta_test.DSEL_target_ = y
      meta_test.n_classes_ = 2
  
      meta_test.meta_classifier_ = GaussianNB()
  
      meta_test._get_similar_out_profiles = MagicMock(
          return_value=(None, nn[0, 0 : meta_test.Kp])
      )
      meta_test.meta_classifier_.predict_proba = MagicMock(
          return_value=np.array([[0.2, 0.8], [1.0, 0.0], [0.2, 0.8]])
      )
  
      probabilities = []
      for clf in meta_test.pool_classifiers:
          probabilities.append(clf.predict_proba(query))
  
      probabilities = np.array(probabilities).transpose((1, 0, 2))
  
      expected = np.array([[0.8, 0.0, 0.8]])
      competences = meta_test.estimate_competence_from_proba(
          nn[0, :], probabilities
      )
      assert np.array_equal(competences, expected)
  
imports: from unittest.mock import MagicMock
  import numpy
  import pytest
  from sklearn.linear_model import Perceptron
  from sklearn.naive_bayes import GaussianNB
  from sklearn.svm import SVC
  from sklearn.utils.estimator_checks import check_estimator
  from sklearn.utils.validation import check_is_fitted
  from deslib.des.meta_des import METADES
label_desc: Use image node_id 9 for calling a global function with example usage: test_estimate_competence(example_estimate_competence, create_pool_classifiers) without return types