def generate_samples_for_cmc_score() -> List[
    Tuple[float, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor]
]:
    """
    Generate list of query and gallery data for cmc score testing.
    """
    data = []
    for error_rate in [
        0.05,
        0.1,
        0.15,
        0.2,
        0.25,
    ]:
        # generate params of the datasets
        class_number = np.random.randint(low=2, high=10)
        kq = np.random.randint(low=1000, high=1500)
        kg = np.random.randint(low=500, high=1000)

        def generate_samples(n_labels, samples_per_label):
            samples = []
            labels = []
            # for each label generate dots that will be close to each other and
            # distanced from samples of other classes
            for i in range(n_labels):
                tmp_samples = np.random.uniform(
                    low=2 * i, high=2 * i + 0.2, size=(samples_per_label,)
                )
                samples = np.concatenate((samples, tmp_samples))
                labels = np.concatenate((labels, [i] * samples_per_label))
            return samples.reshape((-1, 1)), labels

        query_embs, query_labels = generate_samples(
            n_labels=class_number, samples_per_label=kq
        )

        gallery_embs, gallery_labels = generate_samples(
            n_labels=class_number, samples_per_label=kg
        )

        # spoil generated gallery dataset: for each sample from data change
        # label to any other one with probability error_rate
        def confuse_labels(labels, error_rate):
            unique_labels = set(labels)
            size = len(labels)
            for i in range(size):
                if np.random.binomial(n=1, p=error_rate, size=1)[0]:
                    labels[i] = np.random.choice(list(unique_labels - {labels[i]}))
            return labels

        gallery_labels = confuse_labels(gallery_labels, error_rate=error_rate)

        query_embs = torch.tensor(query_embs)
        gallery_embs = torch.tensor(gallery_embs)
        query_labels = torch.tensor(query_labels, dtype=torch.long)
        gallery_labels = torch.tensor(gallery_labels, dtype=torch.long)

        data.append((error_rate, query_embs, query_labels, gallery_embs, gallery_labels))
    return data

    Generate list of query and gallery data for cmc score testing.
    
tests/catalyst/metrics/functional/test_cmc_metric.py