def before_request(self):
        if self.app.config['DEBUG']:
            # in debug mode, store the test credentials if possible
            token = (self.app.config['SHOPIFY_TEST_SITE'], self.app.config['SHOPIFY_TEST_PASSWORD'])
            self.app.config['SHOPIFY_API_KEY'] = self.app.config['SHOPIFY_TEST_API_KEY']
        else:
            assert self.tokengetter_func is not None, 'missing tokengetter function'
            token = self.tokengetter_func() # (url, password)
        
        ctx = _request_ctx_stack.top
        
        if token is not None:
            # should be a valid token
            ctx.request.shopify_session = shopify_api.Session(self.app.config['SHOPIFY_API_KEY'], *token)
        else:
            # not logged in, no session created
            ctx.request.shopify_session = None
:Parameters:
dataset/ETHPy150Open lateshowlabs/flask-shopify/flaskext/shopify.py/Shopify.before_request--crossover with--dataset/ETHPy150Open blynch/CloudMemeBackend/pymongo/pool.py/Pool.__init__