class_docstr: A pool-based active learner in which a pool holds all available unlabeled data.
  
  It uses a classifier, a query strategy and manages the mutually exclusive partition over the
  whole training data into labeled and unlabeled.
  
  Parameters
  ----------
  clf_factory : small_text.classifiers.factories.AbstractClassifierFactory
      A factory responsible for creating new classifier instances.
  query_strategy : small_text.query_strategies.QueryStrategy
      Query strategy which is responsible for selecting instances during a `query()` call.
  dataset : ~small_text.data.datasets.Dataset
      A training dataset that is supported by the underlying classifier.
  reuse_model : bool, default=False
      Reuses the previous model during retraining (if a previous model exists),
      otherwise creates a new model for each retraining.
  
  Attributes
  ----------
  indices_labeled : numpy.ndarray
      Indices of instances (relative to `self.x_train`) constituting the labeled pool.
  indices_ignored : numpy.ndarray or scipy.sparse.csr_matrix
      Indices of instances (relative to `self.x_train`) which have been ignored,
      i.e. which will never be returned by a query.
  y : numpy.ndarray or scipy.sparse.csr_matrix
      Labels for the the current labeled pool. Each tuple `(x_indices_labeled[i], y[i])`
      represents one labeled sample.
  indices_queried : numpy.ndarray or None
      Queried indices returned by the last `query()` call, or `None` if no query has been
      executed yet.
  fit_kwargs : dict
      Keyword arguments that will be passed to the `fit()` call during `update()`.
docstr: Performs a query step, which selects a number of samples from the unlabeled pool.
  A query step must be followed by an update step.
  
  Parameters
  ----------
  num_samples : int, default=10
      Number of samples to query.
  representation : numpy.ndarray, default=None
      Alternative representation for the samples in the unlabeled pool. his can be used
      if you want to rely pre-computed fixed representations instead of embeddings that
      change during each active learning iteration.
  query_strategy_kwargs : dict, default=dict()
  
  Returns
  -------
  queried_indices : numpy.ndarray[int]
      List of queried indices (relative to the current unlabeled pool).
  
  Raises
  ------
  LearnerNotInitializedException
      Thrown when the active learner was not initialized via `initialize_data(...)`.
  ValueError
      Raised when args or kwargs are not used and consumed.
docstr_tok: ["Performs","a","query","step",",","which","selects","a","number","of","samples","from","the","unlabeled","pool",".","A","query","step","must","be","followed","by","an","update","step",".","Parameters","--","--","--","--","--","num_samples",":","int",",","default=10","Number","of","samples","to","query",".","representation",":","numpy.ndarray",",","default=None","Alternative","representation","for","the","samples","in","the","unlabeled","pool",".","his","can","be","used","if","you","want","to","rely","pre-computed","fixed","representations","instead","of","embeddings","that","change","during","each","active","learning","iteration",".","query_strategy_kwargs",":","dict",",","default=dict","(",")","Returns","--","--","--","-","queried_indices",":","numpy.ndarray","[","int","]","List","of","queried","indices","(","relative","to","the","current","unlabeled","pool",")",".","Raises","--","--","--","LearnerNotInitializedException","Thrown","when","the","active","learner","was","not","initialized","via","`","initialize_data","(","...",")","`",".","ValueError","Raised","when","args","or","kwargs","are","not","used","and","consumed","."]
code: def query(
      self,
      num_samples=10,
      representation=None,
      query_strategy_kwargs=dict(),
  ):
      """Performs a query step, which selects a number of samples from the unlabeled pool.
      A query step must be followed by an update step.
  
      Parameters
      ----------
      num_samples : int, default=10
          Number of samples to query.
      representation : numpy.ndarray, default=None
          Alternative representation for the samples in the unlabeled pool. his can be used
          if you want to rely pre-computed fixed representations instead of embeddings that
          change during each active learning iteration.
      query_strategy_kwargs : dict, default=dict()
  
      Returns
      -------
      queried_indices : numpy.ndarray[int]
          List of queried indices (relative to the current unlabeled pool).
  
      Raises
      ------
      LearnerNotInitializedException
          Thrown when the active learner was not initialized via `initialize_data(...)`.
      ValueError
          Raised when args or kwargs are not used and consumed.
      """
      if self._index_to_position is None:
          raise LearnerNotInitializedException()
  
      size = list_length(self.dataset)
      if representation is not None and size != list_length(
          representation
      ):
          raise ValueError(
              "Number of rows of alternative representation x must match the train "
              "set (dim 0)."
          )
  
      self.mask = np.ones(size, bool)
      self.mask[
          np.concatenate([self.indices_labeled, self.indices_ignored])
      ] = False
      indices = np.arange(size)
  
      representation = (
          self.dataset if representation is None else representation
      )
      self.indices_queried = self.query_strategy.query(
          self._clf,
          representation,
          indices[self.mask],
          self.indices_labeled,
          self.y,
          n=num_samples,
          **query_strategy_kwargs,
      )
      return self.indices_queried
  
imports: import numpy
  from abc import ABC, abstractmethod
  from pathlib import Path
  from scipy.sparse import csr_matrix
  from small_text.base import LABEL_IGNORED
  from small_text.exceptions import LearnerNotInitializedException
  from small_text.utils.data import list_length
  from small_text.utils.labels import concatenate, get_ignored_labels_mask, remove_by_index
  from small_text.version import __version__
label_desc: Use image node_id 3 for calling the PoolBasedActiveLearner obj's underlying member method code with example usage: obj.query(num_samples, representation, query_strategy_kwargs) and returns: self