code: def _sample_neg_chips(self):
      pos_num = len(self._cur_im_pos_chips)
      neg_num = len(self._cur_im_neg_chips)
      sample_num = min(pos_num + 2, self.max_neg_num_per_im)
      assert sample_num >= 1
      if neg_num <= sample_num:
          return self._cur_im_neg_chips
  
      candidate_num = int(sample_num * 1.5)
      candidate_neg_chips = sorted(
          self._cur_im_neg_chips, key=lambda x: -x[1]
      )[:candidate_num]
      random.shuffle(candidate_neg_chips)
      sampled_neg_chips = candidate_neg_chips[:sample_num]
      return sampled_neg_chips
  
imports: import copy
  import math
  import random
  import numpy
  from copy import deepcopy
  from typing import List, Tuple
  from collections import defaultdict
  from .chip_box_utils import nms, transform_chip_boxes2image_boxes
  from .chip_box_utils import find_chips_to_cover_overlaped_boxes
  from .chip_box_utils import transform_chip_box
  from .chip_box_utils import intersection_over_box
label_desc: Use image node_id 6 for calling the AnnoCropper obj's underlying member method code with example usage: obj._sample_neg_chips() and returns: sampled_neg_chips, self