@classmethod
def get_by_name(cls, context, name):
    """Find an allocation based by its name.

        :param cls: the :class:`Allocation`
        :param context: Security context
        :param name: The name of an allocation.
        :returns: An :class:`Allocation` object.
        :raises: AllocationNotFound

        """
    db_allocation = cls.dbapi.get_allocation_by_name(name)
    allocation = cls._from_db_object(context, cls(), db_allocation)
    return allocation
