Check if keypoint coordinates are in range [0, 1)

def check_keypoint(kp, rows, cols):
    """Check if keypoint coordinates are in range [0, 1)"""
    for name, value, size in zip(['x', 'y'], kp[:2], [cols, rows]):
        if not 0 <= value < size:
            raise ValueError(
                'Expected {name} for keypoint {kp} '
                'to be in the range [0.0, {size}], got {value}.'.format(
                    kp=kp,
                    name=name,
                    value=value,
                    size=size
                )
            )