code: def test_fit_with_optimizer_and_scheduler(self):
      dataset = random_transformer_dataset(10)
  
      model_args = TransformerModelArguments(
          "sshleifer/tiny-distilroberta-base"
      )
      classifier = TransformerBasedClassification(model_args, 2)
  
      classifier.fit(dataset)
  
      params = [
          param
          for param in classifier.model.parameters()
          if param.requires_grad
      ]
  
      optimizer = AdamW(params, lr=5e-5)
      steps = (len(dataset) // classifier.mini_batch_size) + int(
          len(dataset) % classifier.mini_batch_size != 0
      )
  
      scheduler = get_linear_schedule_with_warmup(
          optimizer, 0.1 * steps, steps
      )
  
      with patch.object(
          classifier, "_train", wraps=classifier._train
      ) as train_mock:
          classifier.fit(
              dataset, 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 small_text.base import LABEL_UNLABELED
  from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
  from small_text.training.early_stopping import EarlyStopping, EarlyStoppingOrCondition
  from small_text.training.metrics import Metric
  from small_text.utils.logging import VERBOSITY_MORE_VERBOSE
label_desc: Use image node_id 12 for calling the TestTransformerBasedClassification obj's underlying member method code with example usage: obj.test_fit_with_optimizer_and_scheduler() without return types