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

Before Change


                newsweepable[key] = value
            else:
                newsweepable[key] = [value]
        expandsweepable = [
            dict(zip(newsweepable.keys(), v))
            for v in itertools.product(*newsweepable.values())
        ]
        return [
            _resolver_to_sweep(ParamResolver(cast(Dict, dictitem)))
            for dictitem in expandsweepable
        ]

After Change


        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: 3

Non-data size: 3

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: pytorch/text
Commit Name: 06dc59afe4657c009430a4673f1504feb69d2736
Time: 2021-02-17
Author: 6156351+zhangguanheng66@users.noreply.github.com
File Name: torchtext/data/example.py
Class Name: Example
Method Name: fromlist


Project Name: allenai/allennlp
Commit Name: 9fc6f9ebc27dd4172b91505192c0c6d51cbb769a
Time: 2019-05-02
Author: nelson-liu@users.noreply.github.com
File Name: allennlp/models/semantic_role_labeler.py
Class Name:
Method Name: write_to_conll_eval_file