code: def __init__(self, low=None, high=None, **kwargs):
      super().__init__(**kwargs)
      assert (low is not None) or (
          high is not None
      ), "At least one of low or high must be specified"
      self.low = low
      self.high = high
      self.add_to_recordable_attributes(
          list_of_names=["low", "high"], is_stat=False
      )
      self.add_to_recordable_attributes(
          list_of_names=[
              "num_past_filter",
              "num_above_low",
              "num_below_high",
          ],
          is_stat=True,
      )
  
file_path: pytorch-metric-learning/src/pytorch_metric_learning/reducers/threshold_reducer.py
imports: import torch
  from .base_reducer import BaseReducer
label_desc: Use image node_id 1 to create a new ThresholdReducer object from inherited base classes: BaseReducer with example: obj = ThresholdReducer(low, high)