def eq(x,y):
if x.dtype != y.dtype:<EOL><INDENT>return False<EOL><DEDENT>else:<EOL><INDENT>names = x.dtype.names        <EOL>for a in names:<EOL><INDENT>try:<EOL><INDENT>b = ((np.isnan(x[a]) == np.isnan(y[a])) | (x[a] == y[a])).all()<EOL><DEDENT>except NotImplementedError:<EOL><INDENT>b = (x[a] == y[a]).all()<EOL><DEDENT>if b is False:<EOL><INDENT>return b        <EOL><DEDENT><DEDENT>return ColorEq(x, y)<EOL><DEDENT>
this special definition of equality is used for checking equality of 
arrays that might have NaNs.