from typing import List
from typing import Dict


def get_by_label_name(bboxes: List[Dict], label_name: str):
    """
    Finds the first 'bbox' dict that has the specified object category label, if such a bbox exists. Each bbox
    dict in the `bboxes` list looks smth like::

        {
            ...
            "original_width": 1280,
            "original_height": 720,
            "value": {
                "x": 42.99737453460697,
                "y": 83.2252102322048,
                "width": 15.921303939819348,
                "height": 4.51104668511282,
                "rotation": 0,
                "rectanglelabels": [
                    "try_another_map"
                ]
            },
            ...
        }
    """
    return next(
        (bbox["value"] for bbox in bboxes if bbox["value"]["rectanglelabels"][0] == label_name),
        None,
    )