<commit_before>'use strict';
import Koa from 'koa';
import Router from 'koa-router';

import convert from 'koa-convert';
import logger from 'koa-logger';
import bodyparser from 'koa-bodyparser';
import json from 'koa-json';

import mysql from 'promise-mysql';

import sse from './sse';

const app = new Koa();

const getDBH = (ctx) => {
  const host = process.env.MYSQL_HOST || 'localhost';
  const port = process.env.MYSQL_PORT || '3306';
  const user = process.env.MYSQL_USER || 'root';
  const pass = process.env.MYSQL_PASS || '';
  const dbname = 'isuketch';
  return ctx.dbh = mysql.createPool({
    host: host,
    port: port,
    user: user,
    password: <PASSWORD>,
    database: dbname,
    connectionLimit: 1,
    charset: 'utf8mb4',
  });
};

const selectOne = async (dbh, sql, params = []) => {
  const result = await dbh.query(sql, params);
  return result[0];
};

const selectAll = async (dbh, sql, params = []) => {
  return await dbh.query(sql, params);
};

const typeCastPointData = (data) => {
  return {
    id: data.id,
    stroke_id: data.stroke_id,
    x: data.x,
    y: data.y,
  };
};

const toRFC3339Micro = (data) => {
  return data;
};
<commit_msg>Use toISOString rather than just date<commit_after>'use strict';
import Koa from 'koa';
import Router from 'koa-router';

import convert from 'koa-convert';
import logger from 'koa-logger';
import bodyparser from 'koa-bodyparser';
import json from 'koa-json';

import mysql from 'promise-mysql';

import sse from './sse';

const app = new Koa();

const getDBH = (ctx) => {
  const host = process.env.MYSQL_HOST || 'localhost';
  const port = process.env.MYSQL_PORT || '3306';
  const user = process.env.MYSQL_USER || 'root';
  const pass = process.env.MYSQL_PASS || '';
  const dbname = 'isuketch';
  return ctx.dbh = mysql.createPool({
    host: host,
    port: port,
    user: user,
    password: <PASSWORD>,
    database: dbname,
    connectionLimit: 1,
    charset: 'utf8mb4',
  });
};

const selectOne = async (dbh, sql, params = []) => {
  const result = await dbh.query(sql, params);
  return result[0];
};

const selectAll = async (dbh, sql, params = []) => {
  return await dbh.query(sql, params);
};

const typeCastPointData = (data) => {
  return {
    id: data.id,
    stroke_id: data.stroke_id,
    x: data.x,
    y: data.y,
  };
};

const toRFC3339Micro = (date) => {
  return date.toISOString();
};

{'fraction_non_alphanumeric': 0.15523012552301255, 'fraction_numerical': 0.0100418410041841, 'mean_word_length': 3.5542857142857143, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6304127', 'n_tokens_mistral': 866, 'n_tokens_neox': 859, 'n_words': 237}