def fetchone_as_namedtuple(cursor):
    Result = _namedtuple_from_cursor(cursor)
    row = cursor.fetchone()
    return Result(*row)
Return one row from a cursor as a namedtuple
dataset/ETHPy150Open dimagi/commcare-hq/corehq/form_processor/utils/sql.py/fetchone_as_namedtuple