def compare_arrays(left, right):
 return ((left is right) or ((left.shape == right.shape) and (left == right).all()))

def compare_arrays ( left , right ) : return ( ( left is right ) or ( ( left . shape == right . shape ) and ( left == right ) . all ( ) ) )
eq check with a short-circuit for identical objects .