010580845043ef751687b0ab34f694939a2fa4f5,cirq/study/sweepable.py,,to_sweeps,#Any#,53

Before Change


            if isinstance(value, Iterable):
                newsweepable[key] = value
            else:
                newsweepable[key] = [value]
        expandsweepable = [
            dict(zip(newsweepable.keys(), v))
            for v in itertools.product(*newsweepable.values())
        ]

After Change


    if isinstance(sweepable, Sweep):
        return [sweepable]
    if isinstance(sweepable, dict):
        if any(isinstance(val, Sequence) for val in sweepable.values()):
            warnings.warn(
                "Implicit expansion of a dictionary into a Cartesian product "
                "of sweeps is deprecated and will be removed in cirq 0.10. "
                "Instead, expand the sweep explicitly using "
                "`cirq.dict_to_product_sweep`.",
                DeprecationWarning,
                stacklevel=2)
        product_sweep = dict_to_product_sweep(sweepable)
        return [_resolver_to_sweep(resolver) for resolver in product_sweep]
    if isinstance(sweepable, Iterable) and not isinstance(sweepable, str):
        return [
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 7

Instances


Project Name: quantumlib/Cirq
Commit Name: 010580845043ef751687b0ab34f694939a2fa4f5
Time: 2020-09-17
Author: kevinjefferysung@gmail.com
File Name: cirq/study/sweepable.py
Class Name:
Method Name: to_sweeps


Project Name: snipsco/snips-nlu
Commit Name: cf44198f4197057fb68c6a774f87be8bd63025ab
Time: 2017-06-01
Author: clement.doumouro@snips.ai
File Name: snips_nlu/tests/test_builtin_entities.py
Class Name: TestBuiltInEntities
Method Name: test_rustling_dim_kinds_should_exist


Project Name: pantsbuild/pants
Commit Name: cd9f387c7261139e9ac1ac86e0319d8ac73b929c
Time: 2016-03-15
Author: stuhood@gmail.com
File Name: tests/python/pants_test/engine/exp/scheduler_test_base.py
Class Name: SchedulerTestBase
Method Name: execute


Project Name: quiltdata/quilt
Commit Name: 7d9a7fead18653a43645c3d673499cf639337406
Time: 2020-06-03
Author: akarve@users.noreply.github.com
File Name: lambdas/es/indexer/index.py
Class Name:
Method Name: handler