code: def test_balanced_batch_generator_function_sparse(data, keep_sparse):
      X, y = data
  
      training_generator, steps_per_epoch = balanced_batch_generator(
          sparse.csr_matrix(X),
          y,
          keep_sparse=keep_sparse,
          batch_size=10,
          random_state=42,
      )
      for idx in range(steps_per_epoch):
          X_batch, y_batch = next(training_generator)
          if keep_sparse:
              assert sparse.issparse(X_batch)
          else:
              assert not sparse.issparse(X_batch)
  
file_path: imbalanced-learn/imblearn/tensorflow/tests/test_generator.py
imports: from distutils.version import LooseVersion
  import numpy
  import pytest
  from scipy import sparse
  from sklearn.datasets import load_iris
  from imblearn.datasets import make_imbalance
  from imblearn.over_sampling import RandomOverSampler
  from imblearn.tensorflow import balanced_batch_generator
  from imblearn.under_sampling import NearMiss
label_desc: Use image node_id 5 for calling a global function with example usage: test_balanced_batch_generator_function_sparse(data, keep_sparse) without return types