code: def test_estimate_competence_batch(example_estimate_competence):
      (
          _,
          y,
          nn,
          _,
          dsel_processed,
          dsel_scores,
      ) = example_estimate_competence
      expected = np.array(
          [
              [0.333333, 0.50000, 0.40000],
              [0.666666, 0.50000, 0.60000],
              [0.000000, 0.50000, 0.20000],
          ]
      )
  
      # Using 3 neighbors to facilitate the calculations
      a_priori_test = APriori(k=3)
  
      a_priori_test.DSEL_processed_ = dsel_processed
      a_priori_test.dsel_scores_ = dsel_scores
      a_priori_test.DSEL_target_ = y
      a_priori_test.n_classes_ = 2
  
      nn = nn[:, 0:3]
      distances = np.ones((3, 3))
  
      competences = a_priori_test.estimate_competence(nn, distances)
      assert np.allclose(competences, expected, atol=0.01)
  
file_path: DESlib/deslib/tests/dcs/test_a_priori.py
imports: import numpy
  import pytest
  from sklearn.linear_model import Perceptron
  from sklearn.utils.estimator_checks import check_estimator
  from deslib.dcs.a_priori import APriori
label_desc: Use image node_id 4 for calling a global function with example usage: test_estimate_competence_batch(example_estimate_competence) without return types