def one(self):
    'Return exactly one result or raise an exception.\n\n        Raises ``sqlalchemy.orm.exc.NoResultFound`` if the query selects\n        no rows.  Raises ``sqlalchemy.orm.exc.MultipleResultsFound``\n        if multiple object identities are returned, or if multiple\n        rows are returned for a query that does not return object\n        identities.\n\n        Note that an entity query, that is, one which selects one or\n        more mapped classes as opposed to individual column attributes,\n        may ultimately represent many rows but only one row of\n        unique entity or entities - this is a successful result for one().\n\n        Calling ``one()`` results in an execution of the underlying query.\n\n        .. versionchanged:: 0.6\n            ``one()`` fully fetches all results instead of applying\n            any kind of limit, so that the "unique"-ing of entities does not\n            conceal multiple object identities.\n\n        '
    ret = list(self)
    l = len(ret)
    if (l == 1):
        return ret[0]
    elif (l == 0):
        raise orm_exc.NoResultFound('No row was found for one()')
    else:
        raise orm_exc.MultipleResultsFound('Multiple rows were found for one()')
Return exactly one result or raise an exception.

Raises ``sqlalchemy.orm.exc.NoResultFound`` if the query selects
no rows.  Raises ``sqlalchemy.orm.exc.MultipleResultsFound``
if multiple object identities are returned, or if multiple
rows are returned for a query that does not return object
identities.

Note that an entity query, that is, one which selects one or
more mapped classes as opposed to individual column attributes,
may ultimately represent many rows but only one row of
unique entity or entities - this is a successful result for one().

Calling ``one()`` results in an execution of the underlying query.

.. versionchanged:: 0.6
    ``one()`` fully fetches all results instead of applying
    any kind of limit, so that the "unique"-ing of entities does not
    conceal multiple object identities.
def one(self):
    'Return exactly one result or raise an exception.\n\n        Raises ``sqlalchemy.orm.exc.NoResultFound`` if the query selects\n        no rows.  Raises ``sqlalchemy.orm.exc.MultipleResultsFound``\n        if multiple object identities are returned, or if multiple\n        rows are returned for a query that does not return object\n        identities.\n\n        Note that an entity query, that is, one which selects one or\n        more mapped classes as opposed to individual column attributes,\n        may ultimately represent many rows but only one row of\n        unique entity or entities - this is a successful result for one().\n\n        Calling ``one()`` results in an execution of the underlying query.\n\n        .. versionchanged:: 0.6\n            ``one()`` fully fetches all results instead of applying\n            any kind of limit, so that the "unique"-ing of entities does not\n            conceal multiple object identities.\n\n        '
    ret = list(self)
    l = len(ret)
    if (l == 1):
        return ret[0]
    elif (l == 0):
        raise orm_exc.NoResultFound('No row was found for one()')
    else:
        raise orm_exc.MultipleResultsFound('Multiple rows were found for one()')