def _quokka_normalize_extract(extract):
<EOL>from imgaug.augmentables.bbs import BoundingBox, BoundingBoxesOnImage<EOL>if extract == "<STR_LIT>":<EOL><INDENT>bb = BoundingBox(x1=<NUM_LIT:0>, y1=<NUM_LIT:0>, x2=<NUM_LIT>, y2=<NUM_LIT>)<EOL><DEDENT>elif isinstance(extract, tuple) and len(extract) == <NUM_LIT:4>:<EOL><INDENT>bb = BoundingBox(x1=extract[<NUM_LIT:0>], y1=extract[<NUM_LIT:1>], x2=extract[<NUM_LIT:2>], y2=extract[<NUM_LIT:3>])<EOL><DEDENT>elif isinstance(extract, BoundingBox):<EOL><INDENT>bb = extract<EOL><DEDENT>elif isinstance(extract, BoundingBoxesOnImage):<EOL><INDENT>do_assert(len(extract.bounding_boxes) == <NUM_LIT:1>)<EOL>do_assert(extract.shape[<NUM_LIT:0>:<NUM_LIT:2>] == (<NUM_LIT>, <NUM_LIT>))<EOL>bb = extract.bounding_boxes[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>raise Exception(<EOL>"<STR_LIT>"<EOL>+ "<STR_LIT>" % (type(extract),)<EOL>)<EOL><DEDENT>return bb<EOL>
Generate a normalized rectangle to be extract from the standard quokka image.

Parameters
----------
extract : 'square' or tuple of number or imgaug.BoundingBox or imgaug.BoundingBoxesOnImage
    Unnormalized representation of the image subarea to be extracted.

        * If string ``square``, then a squared area ``(x: 0 to max 643, y: 0 to max 643)``
          will be extracted from the image.
        * If a tuple, then expected to contain four numbers denoting ``x1``, ``y1``, ``x2``
          and ``y2``.
        * If a BoundingBox, then that bounding box's area will be extracted from the image.
        * If a BoundingBoxesOnImage, then expected to contain exactly one bounding box
          and a shape matching the full image dimensions (i.e. (643, 960, *)). Then the
          one bounding box will be used similar to BoundingBox.

Returns
-------
bb : imgaug.BoundingBox
    Normalized representation of the area to extract from the standard quokka image.