def METHOD_NAME(account, db_session):
    from inbox.models.backends.imap import ImapUid
    uids = (
        db_session.query(ImapUid)
        .filter(ImapUid.account_id == account.id)
        .options(subqueryload(ImapUid.labelitems).joinedload("label"))
    )
    for uid in uids:
        populate_labels(uid, account, db_session)
        log.info("Updated UID labels", account_id=account.id, uid=uid.id)