def METHOD_NAME(self, pyramid_request, factories, Blocklist):
    def caller(uri, annotated=True, blocked=False):
        if annotated:
            factories.DocumentURI(uri=uri)
            pyramid_request.db.flush()
        Blocklist.is_blocked.return_value = blocked
        pyramid_request.params["uri"] = uri
        return badge(pyramid_request)
    return caller