code: def test__normalize(self, mocker: MockerFixture) -> None:
      train_features = torch.randn(4, 3)
      train_targets = torch.randint(0, 10, (4,))
      train_dataset = _FeaturesDataset(
          features=train_features, targets=train_targets
      )
      val_features = torch.randn(4, 3)
      val_targets = torch.randint(0, 10, (4,))
      val_dataset = _FeaturesDataset(
          features=val_features, targets=val_targets
      )
      train_dataloader = DataLoader(train_dataset)
      val_dataloader = DataLoader(val_dataset)
      trainer = Trainer(max_epochs=1, accelerator="cpu", devices=1)
      spy_normalize = mocker.spy(F, "normalize")
  
      # Test that normalize is called when normalize=True.
      classifier = KNNClassifier(
          nn.Identity(), num_classes=10, knn_k=3, normalize=True
      )
      trainer.fit(
          model=classifier,
          train_dataloaders=train_dataloader,
      )
      spy_normalize.assert_called()
      spy_normalize.reset_mock()
  
      trainer.validate(model=classifier, dataloaders=val_dataloader)
      spy_normalize.assert_called()
      spy_normalize.reset_mock()
  
      # Test that normalize is not called when normalize=False.
      classifier = KNNClassifier(
          nn.Identity(), num_classes=10, knn_k=3, normalize=False
      )
      trainer.fit(
          model=classifier,
          train_dataloaders=train_dataloader,
      )
      spy_normalize.assert_not_called()
      spy_normalize.reset_mock()
  
      trainer.validate(model=classifier, dataloaders=val_dataloader)
      spy_normalize.assert_not_called()
      spy_normalize.reset_mock()
  
imports: from typing import Tuple
  import pytest
  import torch
  from pytest_mock import MockerFixture
  from pytorch_lightning import Trainer
  from torch import Tensor, nn
  from torch.utils.data import DataLoader, Dataset
  from lightly.utils.benchmarking import KNNClassifier
  from lightly.utils.benchmarking.knn_classifier import F
label_desc: Use image node_id 6 for calling the TestKNNClassifier obj's underlying member method code with example usage: obj.test__normalize(mocker) without return types