def __init__(self, app, identity, backend, environ_key='cleaver',
                 allow_override=False, count_humans_only=False,
                 human_callback_token='__cleaver_human_verification__'):
        """
        Makes a Cleaver instance available every request under
        ``environ['cleaver']``.

        :param identity any implementation of
                          ``identity.CleaverIdentityProvider`` or
                          a callable that emulates
                          ``identity.CleaverIdentityProvider.get_identity``.
        :param backend any implementation of
                            ``cleaver.backend.CleaverBackend``
        :param environ_key location where the Cleaver instance will be keyed in
                           the WSGI environ
        :param allow_override when True, specific variants can be overriden via
                              the request query string, e.g.,

                              http://mypythonapp.com?cleaver:button_size=small

                              Especially useful for tests and QA.
        :param count_humans_only when False, every request (including those
                                 originating from bots and web crawlers) is
                                 treated as a unique visit (defaults to False).
        :param human_callback_token when ``count_humans_only`` is True, this
                                    token in the URL will trigger a simple
                                    verification process for humans.
        """
        self.app = app

        if not isinstance(identity, CleaverIdentityProvider) and \
                not callable(identity):
            raise RuntimeError(
                '%s must be callable or implement '
                'cleaver.identity.CleaverIdentityProvider' % identity
            )
        if not isinstance(backend, CleaverBackend):
            raise RuntimeError(
                '%s must implement cleaver.backend.CleaverBackend' % backend
            )

        self._identity = identity
        self._backend = backend
        self.environ_key = environ_key
        self.allow_override = allow_override
        self.count_humans_only = count_humans_only
        self.human_callback_token = human_callback_token
dataset/ETHPy150Open ryanpetrello/cleaver/cleaver/middleware.py/SplitMiddleware.__init__/original