def mult_aff(A, B):
    """Returns the matrix product A.dot(B) considering None as the identity

    Parameters
    ----------
    A : array, shape (n,k)
    B : array, shape (k,m)

    Returns
    -------
    The matrix product A.dot(B). If any of the input matrices is None, it is
    treated as the identity matrix. If both matrices are None, None is returned
    """
    if A is None:
        return B
    elif B is None:
        return A
    return A.dot(B)
