code: def perform_active_learning(
      active_learner, train, indices_labeled, test, num_iterations
  ):
      """
      This is the main loop in which we perform 10 iterations of active learning.
      During each iteration 20 samples are queried and then updated.
  
      The update step reveals the true label to the active learner, i.e. this is a simulation,
      but in a real scenario the user input would be passed to the update function.
      """
      # Perform 10 iterations of active learning...
      for i in range(num_iterations):
          # ...where each iteration consists of labelling 20 samples
          indices_queried = active_learner.query(num_samples=100)
  
          # Simulate user interaction here. Replace this for real-world usage.
          y = train.y[indices_queried]
  
          # Return the labels for the current query to the active learner.
          active_learner.update(y)
  
          indices_labeled = np.concatenate(
              [indices_queried, indices_labeled]
          )
  
          print(
              "Iteration #{:d} ({} samples)".format(
                  i, len(indices_labeled)
              )
          )
          evaluate_multi_label(
              active_learner, train[indices_labeled], test
          )
  
imports: import numpy
  from small_text import ConfidenceEnhancedLinearSVC, EmptyPoolException, PoolBasedActiveLearner, PoolExhaustedException, RandomSampling, SklearnClassifierFactory, multilabel_stratified_subsets_sampling
  from examplecode.data.example_data_multilabel import get_train_test, preprocess_data_sklearn
  from examplecode.shared import evaluate_multi_label
label_desc: Use image node_id 2 for calling a global function with example usage: perform_active_learning(active_learner, train, indices_labeled, test, num_iterations) without return types