class_docstr: Hard sampler.
code: def __init__(self, model, loss, size, p, seed: int | None = None):
      self.model = model
      self.loss = loss
      self.p = p
      self.size = size
      self.buffer = utils.SortedWindow(self.size)
      self.seed = seed
      self._rng = random.Random(seed)
  
imports: from __future__ import annotations
  import collections
  import random
  import typing
  from river import base, linear_model, optim, utils
label_desc: Use image node_id 1 to create a new HardSampling object from inherited base classes: base with example: obj = HardSampling(model, loss, size, p, seed)