def METHOD_NAME(self, num_samples=10000):
    if self.args.dataset.startswith("stackoverflow"):
        test_data_num = len(self.test_global.dataset)
        sample_indices = random.sample(
            range(test_data_num), min(num_samples, test_data_num)
        )
        subset = torch.utils.data.Subset(self.test_global.dataset, sample_indices)
        sample_testset = torch.utils.data.DataLoader(
            subset, batch_size=self.args.batch_size
        )
        return sample_testset
    else:
        return self.test_global