def __init__(self, environ, identity, backend,
                 count_humans_only=False,
                 human_callback_token='__cleaver_human_verification__'):
        """
        Create a new Cleaver instance.

        Not generally instantiated directly, but established automatically by
        ``cleaver.SplitMiddleware`` and used within a WSGI application via
        ``request.environ['cleaver']``.

        :param environ the WSGI environ dictionary for the current request
        :param identity any implementation of
                          ``identity.CleaverIdentityProvider`` or
                          a callable that emulates
                          ``identity.CleaverIdentityProvider.get_identity``.
        :param backend any implementation of
                          ``backend.CleaverBackend``
        :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.
        """

        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 = environ
        self.count_humans_only = count_humans_only
        self.human_callback_token = human_callback_token
dataset/ETHPy150Open ryanpetrello/cleaver/cleaver/base.py/Cleaver.__init__/original