code: def test_pl_step(monkeypatch, a_data_module, a_pl_module, hparams):
      active_set = a_data_module.active_dataset
      trainer = BaalTrainer(
          dataset=active_set,
          max_epochs=3,
          default_root_dir="/tmp",
          query_size=hparams["query_size"],
      )
      # Give everything.
  
      before = len(active_set)
      trainer.step(a_pl_module, a_data_module)
      after = len(active_set)
  
      assert after - before == hparams["query_size"]
      # Add the lightning_module manually.
      trainer.strategy.connect(a_pl_module)
  
      # Only give the model
      before = len(active_set)
      trainer.step(a_pl_module)
      after = len(active_set)
  
      assert after - before == hparams["query_size"]
  
      # No model, no dataloader
      before = len(active_set)
      trainer.step()
      after = len(active_set)
  
      assert after - before == hparams["query_size"]
  
imports: import copy
  from dataclasses import dataclass, asdict
  import numpy
  import pytest
  import torch
  from baal.active import ActiveLearningDataset
  from baal.utils.pytorch_lightning import ActiveLightningModule, BaalTrainer, ResetCallback, BaaLDataModule
  from pytorch_lightning import LightningModule
  from torch.utils.data import Dataset, DataLoader
  from torchvision.models import vgg16
label_desc: Use image node_id 9 for calling a global function with example usage: test_pl_step(monkeypatch, a_data_module, a_pl_module, hparams) without return types