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
]
if isinstance(sweepable, Iterable) and not isinstance(sweepable, str):
return [
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 [
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
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: gooofy/zamia-speech
Commit Name: 85861ea5c5320518267405bef050a0dab933e069
Time: 2018-02-17
Author: guenter@zamia.org
File Name: phone_gen.py
Class Name:
Method Name:
Project Name: pymc-devs/pymc3
Commit Name: de47253ce901ac9afac3a0fe33d3cb96f7f354db
Time: 2020-12-06
Author: m.e.gorelli@gmail.com
File Name: pymc3/util.py
Class Name:
Method Name: dataset_to_point_dict