in sampling.py [0:0]
def __init__(self,
file: Path,
annotations: Dict[str, Any],
y: Any,
level: int = 0,
width: int = 256,
height: int = 256,
sample_func: Optional[Callable] = None):
self.file = file
self.slide = openslide.open_slide(str(file))
self.width = width
self.height = height
self.down_factor = self.slide.level_downsamples[level]
self.y = y
self.annotations = annotations
self.sample_func = sample_func
self.classes = list(set(self.y[1]))
self.level = self.slide.level_count - 1 if level is None else level