List neutron extensions.

    :param request: django request object
548716
def list_extensions(request):
    
    neutron_api = neutronclient(request)
    try:
        extensions_list = neutron_api.list_extensions()
    except exceptions.ServiceCatalogException:
        return {}
    if 'extensions' in extensions_list:
        return tuple(extensions_list['extensions'])
    else:
        return ()
1065756
def extension_supported(extension_name, request):
    
    for ext in list_extensions(request):
        if ext.name == extension_name:
            return True
    return False
863488
def server(request):
    
    return render_to_response(
        'server/index.html', {
            'user_url': getViewURL(request, idPage),
            'server_xrds_url': getViewURL(request, idpXrds),
        },
        context_instance=RequestContext(request))
589205
def get_request_params(self) -> List[ExtensionParameter]:
        
        return _build_parameters(
            self.server_no_context_takeover,
            self.client_no_context_takeover,
            self.server_max_window_bits,
            self.client_max_window_bits,
        )
595349
def request_type(self):
        """"""
        if self.static and not self.uses_request:
            return getattr(xenon_pb2, 'Empty')

        if not self.uses_request:
            return None

        return getattr(xenon_pb2, self.request_name)
844834
def retry_request(self, method, action, body=None,
                      headers=None, params=None):
        
        max_attempts = self.retries + 1
        for i in range(max_attempts):
            try:
                return self.do_request(method, action, body=body,
                                       headers=headers, params=params)
            except exceptions.ConnectionFailed:
                # Exception has already been logged by do_request()
                if i < self.retries:
                    _logger.debug('Retrying connection to Neutron service')
                    time.sleep(self.retry_interval)
                elif self.raise_errors:
                    raise

        if self.retries:
            msg = (_("Failed to connect to Neutron server after %d attempts")
                   % max_attempts)
        else:
            msg = _("Failed to connect Neutron server")

        raise exceptions.ConnectionFailed(reason=msg)
246918
def request_args(self):
        '''
        
        '''
        kwargs = {}
        kwargs.update(self.request.match_info.items())
        kwargs.update(self.request.query.items())
        return kwargs
961310
def _filterSearchPhenotypesRequest(self, request):
        
        filters = []
        if request.id:
            filters.append("?phenotype = <{}>".format(request.id))

        if request.description:
            filters.append(
                'regex(?phenotype_label, "{}")'.format(request.description))
        # OntologyTerms
        # TODO: refactor this repetitive code
        if hasattr(request.type, 'id') and request.type.id:
            ontolgytermsClause = self._formatOntologyTermObject(
                request.type, 'phenotype')
            if ontolgytermsClause:
                filters.append(ontolgytermsClause)
        if len(request.qualifiers) > 0:
            ontolgytermsClause = self._formatOntologyTermObject(
                request.qualifiers, 'phenotype_quality')
            if ontolgytermsClause:
                filters.append(ontolgytermsClause)
        if hasattr(request.age_of_onset, 'id') and request.age_of_onset.id:
            ontolgytermsClause = self._formatOntologyTermObject(
                request.age_of_onset, 'phenotype_quality')
            if ontolgytermsClause:
                filters.append(ontolgytermsClause)
        return filters
1192344
def get_include_methods(request):
    
    methods = request.get("include_methods", "")
    include_methods = [
        x.strip() for x in methods.split(",") if x.strip()]
    return include_methods
276781
def get_aggregates(self, request):
        
        pipeline = crud_pipeline_factory.get_aggregates_pipeline(
            configuration=self.configuration)

        return pipeline(request=request)
741781
def _protocolListGenerator(self, request, objectList):
        
        return self._protocolObjectGenerator(
            request, len(objectList), lambda index: objectList[index])
850781
def _serve_experiments(self, request):
    
    results = self.list_experiments_impl()
    return http_util.Respond(request, results, 'application/json')
383073
def search_related(self, request):
        logger.debug("Cache Search Request")
        if self.cache.is_empty() is True:
            logger.debug("Empty Cache")
            return None

        
        result = []
        items = list(self.cache.cache.items())

        for key, item in items:
            element = self.cache.get(item.key)
            logger.debug("Element : {elm}".format(elm=str(element)))

            if request.proxy_uri == element.uri:
                result.append(item)

        return result
652518
def _list(self, uri, obj_class=None, list_all=False):
        
        resp, resp_body = self._retry_get(uri)
        if obj_class is None:
            obj_class = self.resource_class

        data = resp_body[self.plural_response_key]
        ret = [obj_class(self, res, loaded=False)
                for res in data if res]
        self._reset_paging("domain", resp_body)
        if list_all:
            dom_paging = self._paging.get("domain", {})
            while dom_paging.get("next_uri"):
                next_uri = dom_paging.get("next_uri")
                ret.extend(self._list(uri=next_uri, obj_class=obj_class,
                        list_all=False))
        return ret
1285849
def list(self, url):
        
        url = self.get_full_url(url)
        self.log.debug("list url : " + url)
        # Building request
        request = urllib2.Request(url)
        request.add_header('Content-Type', 'application/json; charset=UTF-8')
        request.add_header('Accept', 'application/json')
        # Do request
        ret = self.do_request(request)
        self.log.debug("""list url : %(url)s : request time : %(time)s""",
                       {"url": url,
                        "time": self.last_req_time})
        return ret
393486
def root_endpoint(request, format=None):
    
    endpoints = []
    # loop over url modules
    for urlmodule in urlpatterns:
        # is it a urlconf module?
        if hasattr(urlmodule, 'urlconf_module'):
            is_urlconf_module = True
        else:
            is_urlconf_module = False
        # if url is really a urlmodule
        if is_urlconf_module:
            # loop over urls of that module
            for url in urlmodule.urlconf_module.urlpatterns:
                # TODO: configurable skip url in settings
                # skip api-docs url
                if url.name in ['django.swagger.resources.view']:
                    continue
                # try adding url to list of urls to show
                try:
                    endpoints.append({
                        'name': url.name.replace('api_', ''),
                        'url': reverse(url.name, request=request, format=format)
                    })
                # urls of object details will fail silently (eg: /nodes/<slug>/)
                except NoReverseMatch:
                    pass
    return Response(endpoints)
347987
def add_request(self, request):
        

        # Duplicate request name?
        if request.name in self.requests:
            raise ValueError('redefinition of request "{0}"'.format(request.name))
        self.requests[request.name] = request

        # Add the request URLs
        for method, url in request.urls:

            # URL with arguments?
            if RE_URL_ARG.search(url):
                request_regex = '^' + RE_URL_ARG_ESC.sub(r'/(?P<\1>[^/]+)', re.escape(url)) + '$'
                self.__request_regex.append((method, re.compile(request_regex), request))
            else:
                request_key = (method, url)
                if request_key in self.__request_urls:
                    raise ValueError('redefinition of request URL "{0}"'.format(url))
                self.__request_urls[request_key] = request