def _assert_compatible(im1, im2):
 if (not (im1.dtype == im2.dtype)):
  raise ValueError('Input images must have the same dtype.')
 if (not (im1.shape == im2.shape)):
  raise ValueError('Input images must have the same dimensions.')
 return

def _assert_compatible ( im1 , im2 ) : if ( not ( im1 . dtype == im2 . dtype ) ) : raise ValueError ( 'Input images must have the same dtype.' ) if ( not ( im1 . shape == im2 . shape ) ) : raise ValueError ( 'Input images must have the same dimensions.' ) return
raise an error if the shape and dtype do not match .