code: def test_estimate_competence_batch(
      example_estimate_competence, create_pool_classifiers
  ):
      X, y, neighbors, distances, _, _ = example_estimate_competence
      query = np.ones((3, 2))
      expected = np.array(
          [[4.0, 3.0, 4.0], [5.0, 2.0, 5.0], [2.0, 5.0, 2.0]]
      )
  
      knop_test = KNOP(create_pool_classifiers)
      knop_test.fit(X, y)
      knop_test.neighbors = neighbors
      knop_test.distances = distances
  
      knop_test._get_similar_out_profiles = Mock(
          return_value=(None, neighbors)
      )
      probabilities = np.zeros((3, 6))
  
      competences = knop_test.estimate_competence_from_proba(
          query, probabilities
      )
      assert np.allclose(competences, expected, atol=0.01)
  
file_path: DESlib/deslib/tests/des/test_knop.py
imports: from unittest.mock import Mock
  import numpy
  import pytest
  from sklearn.linear_model import Perceptron
  from sklearn.utils.estimator_checks import check_estimator
  from deslib.des.knop import KNOP
label_desc: Use image node_id 2 for calling a global function with example usage: test_estimate_competence_batch(example_estimate_competence, create_pool_classifiers) without return types