def convert_bbox_to_albumentations(bbox, source_format, rows, cols, check_validity=False):
if source_format not in {'<STR_LIT>', '<STR_LIT>'}:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>".format(source_format)<EOL>)<EOL><DEDENT>if source_format == '<STR_LIT>':<EOL><INDENT>x_min, y_min, width, height = bbox[:<NUM_LIT:4>]<EOL>x_max = x_min + width<EOL>y_max = y_min + height<EOL><DEDENT>else:<EOL><INDENT>x_min, y_min, x_max, y_max = bbox[:<NUM_LIT:4>]<EOL><DEDENT>bbox = [x_min, y_min, x_max, y_max] + list(bbox[<NUM_LIT:4>:])<EOL>bbox = normalize_bbox(bbox, rows, cols)<EOL>if check_validity:<EOL><INDENT>check_bbox(bbox)<EOL><DEDENT>return bbox<EOL>
Convert a bounding box from a format specified in `source_format` to the format used by albumentations:
    normalized coordinates of bottom-left and top-right corners of the bounding box in a form of
    `[x_min, y_min, x_max, y_max]` e.g. `[0.15, 0.27, 0.67, 0.5]`.

    Args:
        bbox (list): bounding box
        source_format (str): format of the bounding box. Should be 'coco' or 'pascal_voc'.
        check_validity (bool): check if all boxes are valid boxes
        rows (int): image height
        cols (int): image width

    Note:
        The `coco` format of a bounding box looks like `[x_min, y_min, width, height]`, e.g. [97, 12, 150, 200].
        The `pascal_voc` format of a bounding box looks like `[x_min, y_min, x_max, y_max]`, e.g. [97, 12, 247, 212].

    Raises:
        ValueError: if `target_format` is not equal to `coco` or `pascal_voc`.