code: def test_manual_threshold():
      """
      Test if the manual threshold gets used in the F1 score computation when
      adaptive thresholding is disabled and no normalization is used.
      """
      config = get_test_configurable_parameters(
          config_path="src/anomalib/models/padim/config.yaml"
      )
  
      config.dataset.num_workers = 0
      config.model.normalization_method = "none"
      config.metrics.threshold.method = "manual"
      config.trainer.fast_dev_run = True
      config.metrics.image = ["F1Score"]
      config.metrics.pixel = ["F1Score"]
  
      image_threshold = random.random()  # nosec: B311
      pixel_threshold = random.random()  # nosec: B311
      config.metrics.threshold.manual_image = image_threshold
      config.metrics.threshold.manual_pixel = pixel_threshold
  
      model = get_model(config)
      datamodule = get_datamodule(config)
      callbacks = get_callbacks(config)
  
      trainer = Trainer(**config.trainer, callbacks=callbacks)
      trainer.fit(model=model, datamodule=datamodule)
      assert (
          trainer.model.image_metrics.F1Score.threshold
          == image_threshold
      )
      assert (
          trainer.model.pixel_metrics.F1Score.threshold
          == pixel_threshold
      )
  
file_path: anomalib/tests/pre_merge/utils/metrics/test_adaptive_threshold.py
imports: import random
  import pytest
  import torch
  from pytorch_lightning import Trainer
  from anomalib.data import get_datamodule
  from anomalib.models import get_model
  from anomalib.utils.callbacks import get_callbacks
  from anomalib.utils.metrics import AnomalyScoreThreshold
  from tests.helpers.config import get_test_configurable_parameters
label_desc: Use image node_id 2 for calling a global function with example usage: test_manual_threshold() without return types