def METHOD_NAME(search_dict: dict, only_fo_parent_firmware: bool, inverted: bool) -> Select:
    if search_dict == {}:
        return select(FirmwareEntry).order_by(*FIRMWARE_ORDER)
    if only_fo_parent_firmware:
        return query_parent_firmware(search_dict, inverted)
    return build_query_from_dict(search_dict).order_by(FileObjectEntry.file_name.asc())