def cos(mat1, mat2, assure_consistency=False):
    """
    Calculate cosine distance for all words in matrix against all words in second matrix.
    Params:
        mat1: A matrix to check all values against
        mat2: Another matrix.
        assure_consistency: If set, it makes sure the matrix and vector share  the same column indices. 
                            This makes it more secure, but a bit slower.
    """

    if assure_consistency:
        mat2 = _assure_consistency(mat1, mat2)

    if mat1.is_vector() and mat2.is_vector():
        return _vector_vector_cos(mat1, mat2)
        

    mat1 = mat1 / mat1.norm(axis=1)
    mat2 = mat2.norm(axis=1) / mat2
    dotted = mat1.dot(mat2.transpose())
    return dotted
dataset/ETHPy150Open jimmycallin/pydsm/pydsm/similarity.py/cos/swapped operands of `/`