code: def __init__(
      self,
      pos_strategy=EASY,
      neg_strategy=SEMIHARD,
      allowed_pos_range=None,
      allowed_neg_range=None,
      **kwargs,
  ):
      super().__init__(**kwargs)
  
      if not (
          pos_strategy in self.all_batch_mining_strategies
          and neg_strategy in self.all_batch_mining_strategies
      ):
          raise ValueError(
              '\npos_strategy must be one of "{0}"\nneg_strategy must be one of "{0}"'.format(
                  '" or "'.join(self.all_batch_mining_strategies)
              )
          )
      if pos_strategy == neg_strategy == self.SEMIHARD:
          raise ValueError(
              'pos_strategy and neg_strategy cannot both be "semihard"'
          )
  
      if (
          pos_strategy == self.ALL and neg_strategy == self.SEMIHARD
      ) or (neg_strategy == self.ALL and pos_strategy == self.SEMIHARD):
          raise ValueError(
              '"semihard" cannot be used in combination with "all"'
          )
  
      self.pos_strategy = pos_strategy
      self.neg_strategy = neg_strategy
      self.allowed_pos_range = allowed_pos_range
      self.allowed_neg_range = allowed_neg_range
  
      self.add_to_recordable_attributes(
          list_of_names=[
              "easiest_triplet",
              "hardest_triplet",
              "easiest_pos_pair",
              "hardest_pos_pair",
              "easiest_neg_pair",
              "hardest_neg_pair",
          ],
          is_stat=True,
      )
  
file_path: pytorch-metric-learning/src/pytorch_metric_learning/miners/batch_easy_hard_miner.py
imports: import torch
  from ..utils import common_functions
  from ..utils import loss_and_miner_utils
  from .base_miner import BaseMiner
label_desc: Use image node_id 1 to create a new BatchEasyHardMiner object from inherited base classes: BaseMiner with example: obj = BatchEasyHardMiner(pos_strategy, neg_strategy, allowed_pos_range, allowed_neg_range)