c7042ae38552e58476c048237cd80d3fe087cdd7,qiskit/aqua/utils/entangler_map.py,,validate_entangler_map,#Any#Any#Any#,41
Before Change
raise TypeError("Entangle index list expected but got {}".format(type(v)))
ret_map = {}
for k, v in entangler_map.items():
ret_map[int(k)] = [int(x) for x in v]
for k, v in ret_map.items():
if k < 0 or k >= num_qubits:
raise ValueError("Qubit value {} invalid for {} qubits".format(k, num_qubits))
for i in v:
if i < 0 or i >= num_qubits:
raise ValueError("Qubit entangle target value {} invalid for {} qubits".format(i, num_qubits))
if allow_double_entanglement is False and i in ret_map and k in ret_map[i]:
raise ValueError("Qubit {} and {} cross-listed".format(i, k))
return ret_map
After Change
raise ValueError("Qubit entangle source value {} invalid for {} qubits".format(src, num_qubits))
if targ < 0 or targ >= num_qubits:
raise ValueError("Qubit entangle target value {} invalid for {} qubits".format(targ, num_qubits))
if not allow_double_entanglement and [targ, src] in ret_map:
raise ValueError("Qubit {} and {} cross-entangled.".format(src, targ))
return ret_map
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 8
Instances
Project Name: Qiskit/qiskit-aqua
Commit Name: c7042ae38552e58476c048237cd80d3fe087cdd7
Time: 2019-02-13
Author: chenrich@us.ibm.com
File Name: qiskit/aqua/utils/entangler_map.py
Class Name:
Method Name: validate_entangler_map
Project Name: tensorflow/transform
Commit Name: 998b0e8f1c3ec165fc1ca7b6421c96b1c72ec297
Time: 2018-05-30
Author: tf-transform-dev@google.com
File Name: tensorflow_transform/analyzers.py
Class Name: Analyzer
Method Name: __init__
Project Name: theislab/scanpy
Commit Name: cd93c5446a236ed76456b188579e671d0619f333
Time: 2017-07-21
Author: f.alex.wolf@gmx.de
File Name: scanpy/preprocessing/simple.py
Class Name:
Method Name: subsample