code: def test_adaptive_threshold(labels, preds, target_threshold):
      """Test if the adaptive threshold computation returns the desired value."""
  
      adaptive_threshold = AnomalyScoreThreshold(default_value=0.5)
      adaptive_threshold.update(preds, labels)
      threshold_value = adaptive_threshold.compute()
  
      assert threshold_value == target_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 1 for calling a global function with example usage: test_adaptive_threshold(labels, preds, target_threshold) without return types