code: def test_fit_with_optimizer_and_scheduler(self):
      ds = self._get_dataset()
  
      num_classes = 4
      embedding_matrix = torch.FloatTensor(np.random.rand(10, 100))
      classifier = KimCNNClassifier(
          num_classes,
          multi_label=self.multi_label,
          embedding_matrix=embedding_matrix,
      )
  
      classifier.fit(ds)
  
      params = [
          param
          for param in classifier.model.parameters()
          if param.requires_grad
      ]
  
      optimizer = AdamW(params, lr=5e-5)
      scheduler = LambdaLR(optimizer, lambda _: 1)
  
      with patch.object(
          classifier, "_train", wraps=classifier._train
      ) as train_mock:
          classifier.fit(ds, optimizer=optimizer, scheduler=scheduler)
          train_mock.assert_called()
  
          call_args = train_mock.call_args[0]
          self.assertEqual(1, train_mock.call_count)
  
          self.assertEqual(optimizer, call_args[5])
          self.assertEqual(scheduler, call_args[6])
  
imports: import unittest
  import pytest
  import numpy
  from unittest.mock import patch
  from unittest import mock
  from unittest.mock import Mock
  from scipy.sparse import issparse
  from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
  from small_text.training.early_stopping import EarlyStopping, NoopEarlyStopping
  from small_text.training.metrics import Metric
  from small_text.training.model_selection import ModelSelection, NoopModelSelection
label_desc: Use image node_id 12 for calling the _KimCNNClassifierTest obj's underlying member method code with example usage: obj.test_fit_with_optimizer_and_scheduler() without return types