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


                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 "
Italian Trulli
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: mailgyc/doudizhu
Commit Name: 001177e85fe09a3a2fd4c30600a42b92902b3d43
Time: 2019-09-30
Author: gaoyc@outlook.com
File Name: doudizhu/apps/account/views.py
Class Name: SignupHandler
Method Name: post


Project Name: deepmipt/DeepPavlov
Commit Name: 48373446ecf9ef563b02c360be347da02df09ce9
Time: 2019-08-05
Author: ignatov.fedor@gmail.com
File Name: deeppavlov/utils/socket/socket.py
Class Name:
Method Name: handle_connection