(x)
return x
Return a matrix as a Matrix, otherwise return x.
Return a matrix as a Matrix, otherwise return x.
Return a matrix as a Matrix otherwise return x .
def _force_mutable(x):
    """Return a matrix as a Matrix, otherwise return x."""
    if getattr(x, 'is_Matrix', False):
        return x.as_mutable()
    elif isinstance(x, Basic):
        return x
    elif hasattr(x, '__array__'):
        a = x.__array__()
        if len(a.shape) == 0:
            return sympify(a)
        return Matrix(x)
    return x
def _force_mutable ( x ) : if getattr ( x , 'is_Matrix' , False ) : return x . as_mutable ( ) elif isinstance ( x , Basic ) : return x elif hasattr ( x , '__array__' ) : a = x . __array__ ( ) if len ( a . shape ) == 0 : return sympify ( a ) return Matrix ( x ) return x