Build a flow with the correct absolute callback URL for this request.
        :return:
420321
def _flow_for_request(self):
        
        flow = copy(self.flow)
        redirect_uri = current_app.config['OVERWRITE_REDIRECT_URI']
        if not redirect_uri:
            flow.redirect_uri = url_for('_oidc_callback', _external=True)
        else:
            flow.redirect_uri = redirect_uri
        return flow
56487
def get(self, request, *args, **kwargs):
        
        entry = self.get_object()
        return HttpResponsePermanentRedirect(entry.get_absolute_url())
193737
def redirect_from_callback(self):
        ''''''
        state = toolkit.request.params.get('state')
        came_from = get_came_from(state)
        toolkit.response.status = 302
        toolkit.response.location = came_from
818067
def build_request(self):
        """"""
        clientheaders = {}
        if (self.parent_url and
            self.parent_url.lower().startswith(HTTP_SCHEMAS)):
            clientheaders["Referer"] = self.parent_url
        kwargs = dict(
            method='GET',
            url=self.url,
            headers=clientheaders,
        )
        if self.auth:
            kwargs['auth'] = self.auth
        log.debug(LOG_CHECK, "Prepare request with %s", kwargs)
        request = requests.Request(**kwargs)
        return self.session.prepare_request(request)
1013913
def process_request(self, request):
        
        global _urlconf_pages

        page_list = list(
            Page.objects.exclude(glitter_app_name='').values_list('id', 'url').order_by('id')
        )

        with _urlconf_lock:
            if page_list != _urlconf_pages:
                glitter_urls = 'glitter.urls'
                if glitter_urls in sys.modules:
                    importlib.reload(sys.modules[glitter_urls])
                _urlconf_pages = page_list
557915
def _construct_callbacks(self):
        
        cb_classes = set()
        registry = list(Stream.registry.items())
        callbacks = Stream._callbacks['bokeh']
        for source in self.link_sources:
            streams = [
                s for src, streams in registry for s in streams
                if src is source or (src._plot_id is not None and
                                     src._plot_id == source._plot_id)]
            cb_classes |= {(callbacks[type(stream)], stream) for stream in streams
                           if type(stream) in callbacks and stream.linked
                           and stream.source is not None}
        cbs = []
        sorted_cbs = sorted(cb_classes, key=lambda x: id(x[0]))
        for cb, group in groupby(sorted_cbs, lambda x: x[0]):
            cb_streams = [s for _, s in group]
            cbs.append(cb(self, cb_streams, source))
        return cbs
992811
def _construct_url(self, base_api, params):
        
        params['key'] = self.api_key
        return super(OpenMapQuest, self)._construct_url(base_api, params)
1160943
def handleFlow(self):
        
        #TODO replace sorting loops with sorted function
        self.targets = {}
        self.api = []
        #flow = []
        
        addrs = []
        internals = []
        
        for instr in self.bb_insns:
            if isinstance(instr, CallInsn):
                if instr.is_api:
                    self.targets[instr.addr] = "API:" + instr.fcn_name
                    
                    self.api.append({"name": instr.fcn_name})
                else:
                    internals.append(instr.addr)
                    
            else:
                if instr.jumpout:
                    internals.append(instr.addr)
                else:
                    addrs.append(instr.addr)
                    addrs.append(instr.offset)
        
        addrs.sort()
        addrs_dict = {}
        for i in range(len(addrs)):
            addrs_dict[addrs[i]] = i
        
        internals_sorted = internals[:]
        internals_sorted.sort()
        calleds_dict = {}
        for i in range(len(internals_sorted)):
            calleds_dict[internals_sorted[i]] = str(i)
            
        flowhash = datasketch.MinHash(num_perm=32)
        
        for instr in self.bb_insns:
            if isinstance(instr, CallInsn):
                if instr.is_api:
                    #flow.append(hex(instr.offset)+"  API:" + instr.fcn_name)
                    flowhash.update("API:" + instr.fcn_name)
                else:
                    #flow.append(hex(instr.offset)+"  OUT:" + calleds_dict[instr.addr])
                    flowhash.update("OUT:" + calleds_dict[instr.addr])
                    self.targets[instr.addr] = "OUT:" + calleds_dict[instr.addr]
            else:
                if instr.jumpout:
                    #flow.append(hex(instr.offset)+"  OUT:" + calleds_dict[instr.addr])
                    flowhash.update("OUT:" + calleds_dict[instr.addr])
                    self.targets[instr.addr] = "OUT:" + calleds_dict[instr.addr]
                else:
                    off = addrs_dict[instr.offset]
                    tgt = addrs_dict[instr.addr]
                    #flow.append("%x (%d)   JMP:%s   - %x (%d)" % (instr.offset, off, str(tgt - off), instr.addr, tgt))
                    flowhash.update("JMP:" + str(tgt - off))
                    self.targets[instr.addr] = "JMP:" + str(tgt - off)
        
        lean_flowhash = datasketch.LeanMinHash(flowhash)
        flowhash_buf = bytearray(lean_flowhash.bytesize())
        lean_flowhash.serialize(flowhash_buf)
        
        self.flowhash = str(flowhash_buf)
        '''
        
        '''
1116121
def buildURL(self, action, **query):
        """"""
        base = urlparse.urljoin(self.server.base_url, action)
        return appendArgs(base, query)
151983
function (callback) {
                var self = this;
                flow()
                    .seq(function (cb) {
                        self.$handlers.stop(function () {
                            // ignore errors during stop
                            cb();
                        });
                    })
                    .seq(function (cb) {
                        self.$authenticationService.stop(function () {
                            cb();
                        });
                    })
                    .seq(function (cb) {
                        self.$filters.stop(function () {
                            // ignore errors during stop
                            cb();
                        });
                    })
                    .seq(function (cb) {
                        self.$endPoints.shutdown(function () {
                            // ignore errors during shutdown
                            cb();
                        });
                    })
                    .exec(function (err) {
                        callback && callback(err);

                        process.stdin.end();
                    });
            }
391651
def _send_flow(self, active):
        '''
        
        '''
        args = Writer()
        args.write_bit(active)
        self.send_frame(MethodFrame(self.channel_id, 20, 20, args))
        self.channel.add_synchronous_cb(self._recv_flow_ok)
51304
def follow_redirects(url):
        
        opener = urllib2.build_opener(urllib2.HTTPRedirectHandler)
        return opener.open(url).url
437508
def request(self, *args, **kwargs):
        
        func = partial(super().request, *args, **kwargs)
        return self.loop.run_in_executor(self.thread_pool, func)
1175058
def build_follow_url(host=None, **params):
        

        # template = '?{params}'
        config = ExampleConfig()
        template = '/follow?{params}'

        if not host:
            host = config.get('example_web_hostname')

        return ExampleUrlBuilder.build(
            template=template,
            host=host,
            params=ExampleUrlBuilder.encode_params(**params)
        )
48619
def build_absolute_uri(request, url):
    
    if app_settings.get('CAPTURE_ROOT_URL'):
        return urljoin(app_settings.get('CAPTURE_ROOT_URL'), url)
    return request.build_absolute_uri(url)
1337391
def ReleaseProcessedFlow(self, flow_obj):
    """"""
    key = (flow_obj.client_id, flow_obj.flow_id)
    next_id_to_process = flow_obj.next_request_to_process
    request_dict = self.flow_requests.get(key, {})
    if (next_id_to_process in request_dict and
        request_dict[next_id_to_process].needs_processing):
      return False

    self.UpdateFlow(
        flow_obj.client_id,
        flow_obj.flow_id,
        flow_obj=flow_obj,
        processing_on=None,
        processing_since=None,
        processing_deadline=None)
    return True
724717
def build_absolute_uri(self, uri):
        
        request = self.context.get('request', None)

        return (
            request.build_absolute_uri(uri) if request is not None else uri
        )