@classmethod
def allocate(cls, context, builder, set_type, nitems=None):
    """
        Allocate a SetInstance with its storage.  Same as allocate_ex(),
        but return an initialized *instance*.  If allocation failed,
        control is transferred to the caller using the target's current
        call convention.
        """
    ok, self = cls.allocate_ex(context, builder, set_type, nitems)
    with builder.if_then(builder.not_(ok), likely=False):
        context.call_conv.return_user_exc(builder, MemoryError, (
            'cannot allocate set',))
    return self
