Return a dictionary with params from request.

    TODO: I think we don't use it anymore and it should be removed
    before someone gets hurt.
430093
def get_params(names):
    
    params = {}
    for name in names:
        value = request.form.get(name) or request.files.get(name)
        if value is not None:
            params[name] = value
    return params
629831
def get_params(self, params, name_request):
        '''
        
        '''
        self.write('')
        for elem in params:
            request_type = elem['type'] if elem.get('type', None) else 'schema'
            name = elem['name']
            if elem.get('required', None):
                name += '(required)'
            schema = elem.get('schema', None)
            name = ':{} {} {}:'.format(name_request, request_type, name)
            if schema:
                definition = schema['$ref'].split('/')[-1]
                self.write(name + ' :ref:`{}`'.format(definition), 1)
                self.write('')
            else:
                desc = elem.get('description', '')
                self.write(name)
                self.write('{}'.format(desc), self.indent_depth + 1)
        self.write('')
145509
def _get_parameters_from_request(self, request, exception=False):
        """"""
        user = request.user
        referer_url = None
        try:
            referer_dic = urlparse.urlsplit(
                urlparse.unquote(request.META.get('HTTP_REFERER')))
            referer_url = referer_dic[2]
            if referer_dic[3]:
                referer_url += "?" + referer_dic[3]
            if isinstance(referer_url, str):
                referer_url = referer_url.decode('utf-8')
        except Exception:
            pass
        request_url = urlparse.unquote(request.path)
        if request.META['QUERY_STRING']:
            request_url += '?' + request.META['QUERY_STRING']
        return {
            'client_ip': request.META.get('REMOTE_ADDR', None),
            'domain_name': getattr(user, 'domain_name', None),
            'domain_id': getattr(user, 'domain_id', None),
            'project_name': getattr(user, 'project_name', None),
            'project_id': getattr(user, 'project_id', None),
            'user_name': getattr(user, 'username', None),
            'user_id': request.session.get('user_id', None),
            'request_scheme': request.scheme,
            'referer_url': referer_url,
            'request_url': request_url,
            'method': request.method if not exception else None,
            'param': self._get_request_param(request),
        }
189627
def get_params(self, deep=False):
        
        attrs = self.__dict__
        for attr in self._include:
            attrs[attr] = getattr(self, attr)

        if deep is True:
            return attrs
        return dict([(k,v) for k,v in list(attrs.items()) \
                     if (k[0] != '_') \
                        and (k[-1] != '_') \
                        and (k not in self._exclude)])
726321
def as_params(self):
        
        params = {}
        if self.has_filters:
            params['$filter'] = self.get_filters()
        if self.has_order:
            params['$orderby'] = self.get_order()
        if self.has_selects:
            params['$select'] = self.get_selects()
        if self.has_expands:
            params['$expand'] = self.get_expands()
        if self._search:
            params['$search'] = self._search
            params.pop('$filter', None)
            params.pop('$orderby', None)
        return params
135404
def _get_params(self, rdata):
        
        if 'params' in rdata:
            if isinstance(rdata['params'], dict) \
                    or isinstance(rdata['params'], list) \
                    or rdata['params'] is None:
                return rdata['params']
            else:
                # wrong type
                raise InvalidRequestError
        else:
            return None
372698
def to_requests(self, method='get'):
        
        out = {}
        data_key = 'params' if method.lower() == 'get' else 'data'
        out[data_key] = self.data
        out.update(self.options)
        return dict([
            (key, list(value.items(multi=True)))
            for key, value in iteritems(out)
        ])
899000
def _extract_params(self):
        
        # Because in this endpoint we handle both GET
        # and POST request.
        query_dict = (self.request.POST if self.request.method == 'POST'
                      else self.request.GET)

        self.params['client_id'] = query_dict.get('client_id', '')
        self.params['redirect_uri'] = query_dict.get('redirect_uri', '')
        self.params['response_type'] = query_dict.get('response_type', '')
        self.params['scope'] = query_dict.get('scope', '').split()
        self.params['state'] = query_dict.get('state', '')
        self.params['nonce'] = query_dict.get('nonce', '')

        self.params['prompt'] = self._allowed_prompt_params.intersection(
            set(query_dict.get('prompt', '').split()))

        self.params['code_challenge'] = query_dict.get('code_challenge', '')
        self.params['code_challenge_method'] = query_dict.get('code_challenge_method', '')
405026
def get_param(self):
        
        return dict(userName=self.username, sessionId=self.session_id, database=self.database)
502765
def params(self):
        
        params, complex = self.get_params()
        url_params = self.default_params.copy()
        url_params.update(self.serialize_params(params, complex))
        return url_params
409378
def params(self):
        
        if isinstance(self.request, list):
            return unmunchify(self.request)
        (params, _) = xmlrpc.loads(self.request)
        return params
234463
def get_fields(self, request, obj=None):
        
        fields = self.fields[:]
        if not obj:
            fields.remove('value')
        return fields
521819
def format_parameters(self, params):
        # type: (Dict[str, str]) -> None
        
        query = urlparse(self.url).query
        if query:
            self.url = self.url.partition('?')[0]
            existing_params = {
                p[0]: p[-1]
                for p in [p.partition('=') for p in query.split('&')]
            }
            params.update(existing_params)
        query_params = ["{}={}".format(k, v) for k, v in params.items()]
        query = '?' + '&'.join(query_params)
        self.url = self.url + query
155124
def to_dict(self):
        
        request_context_dict = {}
        if self.request_context:
            request_context_dict = self.request_context.to_dict()

        json_dict = {"httpMethod": self.http_method,
                     "body": self.body if self.body else None,
                     "resource": self.resource,
                     "requestContext": request_context_dict,
                     "queryStringParameters": dict(self.query_string_params) if self.query_string_params else None,
                     "headers": dict(self.headers) if self.headers else None,
                     "pathParameters": dict(self.path_parameters) if self.path_parameters else None,
                     "stageVariables": dict(self.stage_variables) if self.stage_variables else None,
                     "path": self.path,
                     "isBase64Encoded": self.is_base_64_encoded
                     }

        return json_dict
355546
def get_post_data(self):
        '''
        
        '''
        post_data = {}
        for key in self.request.arguments:
            post_data[key] = self.get_arguments(key)[0]
        return post_data
194566
def to_dict(self):
        
        return {
            'mean': self.mean,
            'var': self.var,
            'min': self.min,
            'max': self.max,
            'num': self.num
        }
345960
def get_sentry_data_from_request(self):
        
        return {
            'request': {
                'url': self.request.full_url(),
                'method': self.request.method,
                'data': self.request.body,
                'query_string': self.request.query,
                'cookies': self.request.headers.get('Cookie', None),
                'headers': dict(self.request.headers),
            }
        }