code: def main(num_iterations=10):
      # Prepare some data: The data is a 2-class subset of 20news (baseball vs. hockey)
      text_train, text_test = get_train_test()
      train, test = preprocess_data(text_train, text_test)
      num_classes = 2
  
      # Active learning parameters
      clf_template = ConfidenceEnhancedLinearSVC()
      clf_factory = SklearnClassifierFactory(clf_template, num_classes)
      query_strategy = RandomSampling()
  
      # Active learner
      active_learner = PoolBasedActiveLearner(
          clf_factory, query_strategy, train
      )
      labeled_indices = initialize_active_learner(
          active_learner, train.y
      )
  
      try:
          perform_active_learning(
              active_learner,
              train,
              labeled_indices,
              test,
              num_iterations,
          )
      except PoolExhaustedException:
          print("Error! Not enough samples left to handle the query.")
      except EmptyPoolException:
          print(
              "Error! No more samples left. (Unlabeled pool is empty)"
          )
  
imports: import numpy
  from small_text import ConfidenceEnhancedLinearSVC, EmptyPoolException, PoolBasedActiveLearner, PoolExhaustedException, RandomSampling, SklearnClassifierFactory
  from examplecode.data.example_data_binary import get_train_test, preprocess_data
  from examplecode.shared import evaluate
label_desc: Use image node_id 1 for calling a global function with example usage: main(num_iterations) without return types