<commit_before>'use strict';

let Pokedex = require('./pokedex.js').Pokedex;
let Usage = require('./spreads.js');
let express = require('express');
let app = express();

app.use(express.static(__dirname + '/client'));
app.get('/', function(req, res) {
	// Serve index page here
	res.sendFile('client/index.html', { root: __dirname});
});

app.get('/usage', function(req, res) {
	let query = req.query;
	// Read and validate query
	if (!query.pokemon) res.send("No Pok&eacute;mon Specified");
	let pokemon = toId(query.pokemon);
	// If existing pokemon
	if (Pokedex[pokemon] === undefined) {
		res.send("Pok&eacute;mon not found (or it's a typo?).");
	} else {
		pokemon = Pokedex[pokemon];
	}
	let tier = toId(query.tier ? query.tier : 'ou');
	let weight = (query.weight ? query.weight : (tier == 'ou' ? '1695' : '1630'));
	let allowedWeights = (tier === 'ou' ? {'0':1,'1500':1,'1695':1,'1825':1} : {'0':1,'1500':1,'1630':1,'1760':1});
	if (!(weight in allowedWeights)) {
		res.send('Invalid weight specified (' + weight + ') for tier: ' + tier);
	}<commit_msg>Stop errors from completing the request<commit_after>'use strict';

let Pokedex = require('./pokedex.js').Pokedex;
let Usage = require('./spreads.js');
let express = require('express');
let app = express();

app.use(express.static(__dirname + '/client'));
app.get('/', function(req, res) {
	// Serve index page here
	res.sendFile('client/index.html', { root: __dirname});
});

app.get('/usage', function(req, res) {
	let query = req.query;
	// Read and validate query
	if (!query.pokemon) return res.send("No Pok&eacute;mon Specified");

	let pokemon = toId(query.pokemon);
	// If existing pokemon
	if (Pokedex[pokemon] === undefined) {
		return res.send("Pok&eacute;mon not found (or it's a typo?).");
	} else {
		pokemon = Pokedex[pokemon];
	}
	let tier = toId(query.tier ? query.tier : 'ou');
	let weight = (query.weight ? query.weight : (tier == 'ou' ? '1695' : '1630'));
	let allowedWeights = (tier === 'ou' ? {'0':1,'1500':1,'1695':1,'1825':1} : {'0':1,'1500':1,'1630':1,'1760':1});
	if (!(weight in allowedWeights)) {
		return res.send('Invalid weight specified (' + weight + ') for tier: ' + tier);
	}
{'fraction_non_alphanumeric': 0.2129032258064516, 'fraction_numerical': 0.03870967741935484, 'mean_word_length': 4.624352331606218, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1226582', 'n_tokens_mistral': 848, 'n_tokens_neox': 781, 'n_words': 188}