code: def test_heuristics_works_with_generator(heur, n_batch):
      BATCH_SIZE = 32
  
      def predictions(n_batch):
          for _ in range(n_batch):
              yield np.random.randn(BATCH_SIZE, 3, 32, 32, 10)
  
      preds = predictions(n_batch)
      out = heur(preds)
      assert out.shape[0] == n_batch * BATCH_SIZE
  
imports: import warnings
  import numpy
  import pytest
  from hypothesis import given
  from torch_hypothesis import class_logits
  from baal.active import get_heuristic
  from baal.active.heuristics import Random, BALD, Margin, Entropy, Certainty, Variance, BatchBALD, AbstractHeuristic, requireprobs, Precomputed, CombineHeuristics
  from tests.test_utils import make_fake_dist, make_3d_fake_dist, make_5d_fake_dist
label_desc: Use image node_id 17 for calling a global function with example usage: test_heuristics_works_with_generator(heur, n_batch) without return types