<commit_before>#!/usr/bin/env python3
import os
from flask import Flask, jsonify, send_from_directory, abort, Response, request
import psycopg2

app = Flask(__name__)

conn = psycopg2.connect("dbname='rivers' user='nelson' host='localhost' password='<PASSWORD>'")

#@<EMAIL>.route('/')
#def index():
#  return send_from_directory('.', 'index.html')

@app.route('/gauges/list/<string:xmin>/<string:ymin>/<string:xmax>/<string:ymax>', methods=['GET'])
def show_gaugelist(xmin,ymin,xmax,ymax):
  print('hi')
  cur = conn.cursor()

  cur.execute("""
    SELECT *
    FROM   gageloc
    WHERE  geom
        @ -- contained by, gets fewer rows -- ONE YOU NEED!
        ST_MakeEnvelope (
            %(xmin)s, %(ymin)s, -- bounding
            %(xmax)s, %(ymax)s, -- box limits
            900913)
  """, {"xmin":xmin,"ymin":ymin,"xmax":xmax,"ymax":ymax})

  print(cur.fetchall())

  return Response("hi", mimetype='text')
  #return Response(outcss, mimetype='text/css')

if __name__ == '__main__':
    app.run(debug=True)<commit_msg>Return lat/lng<commit_after>#!/usr/bin/env python3
import os
from flask import Flask, jsonify, send_from_directory, abort, Response, request
import psycopg2

app = Flask(__name__)

conn = psycopg2.connect("dbname='rivers' user='nelson' host='localhost' password='<PASSWORD>'")

#<EMAIL>('/')
#def index():
#  return send_from_directory('.', 'index.html')

@app.route('/gauges/list/<string:xmin>/<string:ymin>/<string:xmax>/<string:ymax>', methods=['GET'])
def show_gaugelist(xmin,ymin,xmax,ymax):
  print('hi')
  cur = conn.cursor()

  cur.execute("""
    SELECT *, ST_X(the_geom) as lng, ST_Y(the_geom) as lat
    FROM   gageloc
    WHERE  geom
        @ -- contained by, gets fewer rows -- ONE YOU NEED!
        ST_MakeEnvelope (
            %(xmin)s, %(ymin)s, -- bounding
            %(xmax)s, %(ymax)s, -- box limits
            900913)
  """, {"xmin":xmin,"ymin":ymin,"xmax":xmax,"ymax":ymax})

  print(cur.fetchall())

  return Response("hi", mimetype='text')
  #return Response(outcss, mimetype='text/css')

if __name__ == '__main__':
    app.run(debug=True)
{'fraction_non_alphanumeric': 0.1849904397705545, 'fraction_numerical': 0.008604206500956023, 'mean_word_length': 4.03125, 'pattern_counts': {'":': 8, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4776796', 'n_tokens_mistral': 807, 'n_tokens_neox': 773, 'n_words': 146}