2bc5d43310eeca5c0d00b115b6f73d464f9c5576,src/biopython/sequence/align/matrix.py,SubstitutionMatrix,__init__,#SubstitutionMatrix#Any#Any#Any#,13
Before Change
if isinstance(matrix, dict):
self._matrix = np.full(( len(alphabet1), len(alphabet2) ), np.nan)
for key, value in matrix.items():
i = alphabet1.encode(key[0])
j = alphabet2.encode(key[1])
self._matrix[i,j] = value
elif isinstance(matrix, np.ndarray):
self._matrix = np.copy(matrix)
After Change
if isinstance(matrix, dict):
matrix_dict = matrix
self._matrix = np.full(( len(alphabet1), len(alphabet2) ), np.nan)
for i in range(len(alphabet1)):
for j in range(len(alphabet2)):
sym1 = alphabet1.decode(i)
sym2 = alphabet2.decode(j)
try:
self._matrix[i,j] = matrix_dict[sym1, sym2]
except KeyError:
pass
elif isinstance(matrix, np.ndarray):
self._matrix = np.copy(matrix)
else:
raise TypeError("Matrix must be either a dictionary "
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances Project Name: biotite-dev/biotite
Commit Name: 2bc5d43310eeca5c0d00b115b6f73d464f9c5576
Time: 2017-08-10
Author: patrick.kunzm@gmail.com
File Name: src/biopython/sequence/align/matrix.py
Class Name: SubstitutionMatrix
Method Name: __init__
Project Name: dpressel/mead-baseline
Commit Name: 78eba7b3f82b8420deac3cd28318dbfead0f9b9e
Time: 2018-10-30
Author: dpressel@gmail.com
File Name: python/baseline/dy/seq2seq/model.py
Class Name: Seq2SeqModel
Method Name: decode
Project Name: hanxiao/bert-as-service
Commit Name: 11da992272f0b41f6672f5ff078894282e5bb393
Time: 2018-11-08
Author: hanhxiao@tencent.com
File Name: client_example.py
Class Name:
Method Name: