def METHOD_NAME(self, idx: int):
    dataset_idx = bisect.bisect_right(self.cumulative_sizes, idx)
    if dataset_idx == 0:
        sample_idx = idx
    else:
        sample_idx = idx - self.cumulative_sizes[dataset_idx - 1]
    sample_idx = sample_idx % self.real_sizes[dataset_idx]
    return dataset_idx, sample_idx