def keypoint_flip(bbox, d, rows, cols):
if d == <NUM_LIT:0>:<EOL><INDENT>bbox = keypoint_vflip(bbox, rows, cols)<EOL><DEDENT>elif d == <NUM_LIT:1>:<EOL><INDENT>bbox = keypoint_hflip(bbox, rows, cols)<EOL><DEDENT>elif d == -<NUM_LIT:1>:<EOL><INDENT>bbox = keypoint_hflip(bbox, rows, cols)<EOL>bbox = keypoint_vflip(bbox, rows, cols)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>'.format(d))<EOL><DEDENT>return bbox<EOL>
Flip a keypoint either vertically, horizontally or both depending on the value of `d`.

    Raises:
        ValueError: if value of `d` is not -1, 0 or 1.