code: def test_grid_pipe(estimator_cls):
      """Tests if SenSeI/SenSR works in a Pipeline and GridSearchCV."""
      X, y = make_classification(n_features=10)
      X = X.astype("float32")
  
      dx = distances.SquaredEuclideanDistance()
      dx.fit(10)
  
      mlp = nn.Sequential(
          nn.Linear(10, 100), nn.ReLU(), nn.Linear(100, 2)
      )
      estimator = estimator_cls(
          mlp,
          criterion=nn.CrossEntropyLoss,
          distance_x=dx,
          optimizer=optim.Adam,
          lr=1e-3,
          max_epochs=5,
          verbose=0,
      )
  
      pipe = Pipeline(
          [("scaler", StandardScaler()), ("estimator", estimator)]
      )
      params = {"estimator__auditor_nsteps": [0, 10, 25]}
      grid = GridSearchCV(pipe, params, scoring="accuracy")
      grid.fit(X, y)
      assert not pd.DataFrame(grid.cv_results_).isna().any(axis=None)
  
file_path: AIF360/tests/sklearn/test_infairness.py
imports: from contextlib import nullcontext
  from functools import partial
  from inFairness import fairalgo, distances
  import numpy
  import pandas
  import pytest
  from sklearn.datasets import make_classification, make_regression
  from sklearn.model_selection import GridSearchCV
  from sklearn.pipeline import Pipeline
  from sklearn.preprocessing import StandardScaler
  import torch
  import torch.nn
  import torch.nn.functional
  import torch.optim
  from aif360.sklearn.inprocessing import SenSeI, SenSR
  from aif360.sklearn.inprocessing.infairness import Dataset
label_desc: Use image node_id 4 for calling a global function with example usage: test_grid_pipe(estimator_cls) without return types