parameters: (self, request, instances)
return_statement: return params
docstring: These are the parameters used specifically for the autocomplete endpoint.
docstring_summary: These are the parameters used specifically for the autocomplete endpoint.
docstring_tokens: These are the parameters used specifically for the autocomplete endpoint .
function: def make_params(self, request, instances):
          '''
          These are the parameters used specifically for the autocomplete endpoint.
          '''
          params = self.basic_params(instances)
  
          params.extend([("q", request["q"]), ("limit", request["count"])])
          if request.get("type[]"):
              map_type = {
                  "administrative_region": [self.TYPE_CITY],
                  "address": [self.TYPE_STREET, self.TYPE_HOUSE],
                  "stop_area": [self.TYPE_STOP_AREA],
                  "poi": [self.TYPE_POI],
              }
              for type in request.get("type[]"):
                  if type == 'stop_point':
                      logging.getLogger(__name__).debug('stop_point is not handled by bragi')
                      continue
  
                  for t in map_type[type]:
                      params.append(("type[]", t))
          shape_scope = request.get("shape_scope[]")
          shape_scope = shape_scope if shape_scope else DEFAULT_SHAPE_SCOPE
          for ss in shape_scope:
              params.append(("shape_scope[]", ss))
  
          # if places_proximity_radius is not provided bragi will used default values
          if 'places_proximity_radius' in request and request['places_proximity_radius'] is not None:
              params.extend(
                  [
                      ('proximity_scale', 6.5 * request['places_proximity_radius'] / 1000),
                      ('proximity_offset', request['places_proximity_radius'] / 1000),
                      ('proximity_decay', 0.4),
                  ]
              )
  
          if request.get("from"):
              lon, lat = self.get_coords(request["from"])
              params.extend([('lon', lon), ('lat', lat)])
          if self.timeout_bragi_es:
              # bragi timeout is in ms
              params.append(("timeout", int(self.timeout_bragi_es * 1000)))
          params.append(("request_id", request["request_id"]))
          return params
function_tokens: def make_params ( self , request , instances ) : params = self . basic_params ( instances ) params . extend ( [ ( "q" , request [ "q" ] ) , ( "limit" , request [ "count" ] ) ] ) if request . get ( "type[]" ) : map_type = { "administrative_region" : [ self . TYPE_CITY ] , "address" : [ self . TYPE_STREET , self . TYPE_HOUSE ] , "stop_area" : [ self . TYPE_STOP_AREA ] , "poi" : [ self . TYPE_POI ] , } for type in request . get ( "type[]" ) : if type == 'stop_point' : logging . getLogger ( __name__ ) . debug ( 'stop_point is not handled by bragi' ) continue for t in map_type [ type ] : params . append ( ( "type[]" , t ) ) shape_scope = request . get ( "shape_scope[]" ) shape_scope = shape_scope if shape_scope else DEFAULT_SHAPE_SCOPE for ss in shape_scope : params . append ( ( "shape_scope[]" , ss ) ) # if places_proximity_radius is not provided bragi will used default values if 'places_proximity_radius' in request and request [ 'places_proximity_radius' ] is not None : params . extend ( [ ( 'proximity_scale' , 6.5 * request [ 'places_proximity_radius' ] / 1000 ) , ( 'proximity_offset' , request [ 'places_proximity_radius' ] / 1000 ) , ( 'proximity_decay' , 0.4 ) , ] ) if request . get ( "from" ) : lon , lat = self . get_coords ( request [ "from" ] ) params . extend ( [ ( 'lon' , lon ) , ( 'lat' , lat ) ] ) if self . timeout_bragi_es : # bragi timeout is in ms params . append ( ( "timeout" , int ( self . timeout_bragi_es * 1000 ) ) ) params . append ( ( "request_id" , request [ "request_id" ] ) ) return params