Function to query for a list of coordinates
161864
def search(geo_coords, mode=2, verbose=True):
    
    if not isinstance(geo_coords, tuple) and not isinstance(geo_coords, list):
        raise TypeError('Expecting a tuple or a tuple/list of tuples')
    elif not isinstance(geo_coords[0], tuple):
        geo_coords = [geo_coords]

    _rg = RGeocoder(mode=mode, verbose=verbose)
    return _rg.query(geo_coords)
981031
def query_to_map(text):
    '''
    '''
    dict_obj = {}

    for key, value in split_query(text, True):
        if key not in dict_obj:
            dict_obj[key] = []

        if value:
            dict_obj[key].append(value.replace('+', ' '))
        else:
            dict_obj[key].append('')

    return query_to_map(text)
1023457
def row_coordinates(self, X):
        """"""
        utils.validation.check_is_fitted(self, 's_')

        # Check input
        if self.check_input:
            utils.check_array(X, dtype=[str, np.number])

        # Prepare input
        X = self._prepare_input(X)

        return self._row_coordinates_from_global(self._build_X_global(X))
522245
def coords_from_query(query):
    """"""
    try:
        coords = json.loads(query)
    except ValueError:
        query = query.replace(',', ' ')
        vals = query.split()
        coords = [float(v) for v in vals]
    return tuple(coords[:2])
34934
def coordinates(self, x, y, **kwargs):
        ''''''
        kwargs['returntype'] = 'geographies'
        fields = {
            'x': x,
            'y': y
        }

        return self._fetch('coordinates', fields, **kwargs)
768639
private static void getAllCoordinates(Geometry geometry, List<Coordinate> coordinates) {
		if (geometry.getGeometries() != null) {
			for (Geometry child : geometry.getGeometries()) {
				getAllCoordinates(child, coordinates);
			}
		}
		if (geometry.getCoordinates() != null) {
			for (Coordinate coordinate : geometry.getCoordinates()) {
				coordinates.add(coordinate);
			}
		}
	}
703621
def get_find_all_query(self, table_name, constraints=None, *, columns=None, order_by=None,
                         limiting=(None, None)):
    
    where, params = self.parse_constraints(constraints)

    if columns:
      if isinstance(columns, str):
        pass
      else:
        columns = ", ".join(columns)
    else:
      columns = "*"

    if order_by:
      order = " order by {0}".format(order_by)
    else:
      order = ""

    paging = ""
    if limiting is not None:
      limit, offset = limiting
      if limit is not None:
        paging += " limit {0}".format(limit)
      if offset is not None:
        paging += " offset {0}".format(offset)

    return ("select {0} from {1} where {2}{3}{4}".format(
      columns,
      table_name,
      where or "1 = 1",
      order,
      paging
    ), params)
917771
def _querystring(self):
        """"""

        kw = {"studyoid": self.studyoid}
        if self.location_oid is not None:
            kw["locationoid"] = self.location_oid
        return kw
149829
def find_for_x_in_y_keys(node):
    """"""
    return (
        isinstance(node, ast.For)
        and h.call_name_is(node.iter, 'keys')
    )
1331438
def getcoords(ddtt):
    """"""
    n_vertices_index = ddtt.objls.index('Number_of_Vertices')
    first_x = n_vertices_index + 1 # X of first coordinate
    pts = ddtt.obj[first_x:]
    return list(grouper(3, pts))
1061770
def geo_search(self, **kwargs):
        

        if 'types' in kwargs:
            kwargs['types'] = ','.join(kwargs['types'])

        bound = kwargs.pop('bound', False)
        if bound:
            kwargs['bound[point1]'] = bound[0]
            kwargs['bound[point2]'] = bound[1]

        return self._geo_search(**kwargs)
1294145
def _query(self, x, result):
        '''
        
        '''
        if self.single_interval is None: # Empty
            return
        elif self.single_interval != 0:  # Single interval, just check whether x is in it
            if self.single_interval[0] <= x < self.single_interval[1]:
                result.append(self.single_interval)
        elif x < self.center:            # Normal tree, query point to the left of center
            if self.left_subtree is not None:
                self.left_subtree._query(x, result)
            for int in self.mid_sorted_by_start:
                if int[0] <= x:
                    result.append(int)
                else:
                    break
        else:  # Normal tree, query point to the right of center
            for int in self.mid_sorted_by_end:
                if int[1] > x:
                    result.append(int)
                else:
                    break
            if self.right_subtree is not None:
                self.right_subtree._query(x, result)
1200208
async def query(self, stmt, *args):
        
        with (await self.application.db.cursor()) as cur:
            await cur.execute(stmt, args)
            return [self.row_to_obj(row, cur) for row in await cur.fetchall()]
591610
function queryFunction(query) {
        var selectivity = query.selectivity;
        var term = query.term;
        var offset = query.offset || 0;
        var results;
        if (selectivity.el.getAttribute('id') === 'single-input-with-submenus') {
            if (selectivity.dropdown) {
                var timezone = selectivity.dropdown.highlightedResult.id;
                results = citiesWithTimezone
                    .filter(function(city) {
                        return (
                            transformText(city.id).indexOf(transformText(term)) > -1 &&
                            city.timezone === timezone
                        );
                    })
                    .map(function(city) {
                        return city.id;
                    });
            } else {
                query.callback({ more: false, results: [] });
                return;
            }
        } else {
            results = cities.filter(function(city) {
                return transformText(city).indexOf(transformText(term)) > -1;
            });
        }
        results.sort(function(a, b) {
            a = transformText(a);
            b = transformText(b);
            var startA = a.slice(0, term.length) === term,
                startB = b.slice(0, term.length) === term;
            if (startA) {
                return startB ? (a > b ? 1 : -1) : -1;
            } else {
                return startB ? 1 : a > b ? 1 : -1;
            }
        });
        setTimeout(function() {
            query.callback({
                more: results.length > offset + 10,
                results: results.slice(offset, offset + 10)
            });
        }, 500);
    }
216644
function pointToQuery(url, requestFormatter, responseFormatter) {
	  return function (inputSource) {
	    return function outputSource(start, outputSink) {
	      if (start !== 0) return;
	      inputSource(0, function (t, d) {
	        if (t === 1) {
	          var queryUrl = requestFormatter(url, { x: d.latlng.lng, y: d.latlng.lat });
	          query(queryUrl).then(function (res) {
	            var output = {
	              queryResult: responseFormatter(res),
	              latlng: d.latlng
	            };
	            outputSink(1, output);
	          });
	        } else {
	          outputSink(t, d);
	        }
	      });
	    };
	  };
	}
876232
def list(self):
        """"""
        return [self._pos3d.x, self._pos3d.y, self._pos3d.z]
242529
def split_coords_2d(seq):
    
    lons, lats = [], []
    for i, el in enumerate(seq):
        if i % 2 == 0:
            lons.append(valid.longitude(el))
        elif i % 2 == 1:
            lats.append(valid.latitude(el))
    return list(zip(lons, lats))