<commit_before>var http      = require('http'),
    apns      = require('./notification/apple'),
    gcm       = require('./notification/google'),
    qs        = require('querystring'),
    responder = require('./responder'),
    log       = require('./log').logger;

var config = require('./config.json');

function handlePostData (request, response, handler) {
  var body = '';

  request.on('data', function (data) {
    body += data;
  });

  request.on('end', function (){
    try {
      request.body = JSON.parse(body);
    } catch (err) {
      response.end(responder.err({error: "Bad JSON Input"}));
      return;
    }

    handleRequest(request, response, handler);
  });
}

function handleRequest(request, response, handler) {
  if (request.body === undefined) {
    response.end(responder.err({error: "No Data"}));
  } else {
    if (request.body.appId === undefined) {
      response.end(responder.err({error: "Missing Required Field appId"}));

    } else if (request.body.deviceId === undefined) {
        response.end(responder.err({error: "Missing Required Field deviceId"}));

    } else if (request.body.mode === undefined) {
      response.end(responder.err({error: "Missing Required Field mode"}));

    } else if (request.body.notification === undefined) {
      response.end(responder.err({error: "Missing Required Field notification"}));

    } else {
      // if we do not have a timeout, set the default<commit_msg>Adding some spacing<commit_after>var http      = require('http'),
    apns      = require('./notification/apple'),
    gcm       = require('./notification/google'),
    qs        = require('querystring'),
    responder = require('./responder'),
    log       = require('./log').logger;

var config = require('./config.json');

function handlePostData (request, response, handler) {
  var body = '';

  request.on('data', function (data) {
    body += data;
  });

  request.on('end', function (){
    try {
      request.body = JSON.parse(body);
    } catch (err) {
      response.end(responder.err({ error: "Bad JSON Input" }));
      return;
    }

    handleRequest(request, response, handler);
  });
}

function handleRequest(request, response, handler) {
  if (request.body === undefined) {
    response.end(responder.err({ error: "No Data" }));
  } else {
    if (request.body.appId === undefined) {
      response.end(responder.err({ error: "Missing Required Field appId" }));

    } else if (request.body.deviceId === undefined) {
        response.end(responder.err({ error: "Missing Required Field deviceId" }));

    } else if (request.body.mode === undefined) {
      response.end(responder.err({ error: "Missing Required Field mode" }));

    } else if (request.body.notification === undefined) {
      response.end(responder.err({ error: "Missing Required Field notification" }));

    } else {
      // if we do not have a timeout, set the default
{'fraction_non_alphanumeric': 0.16391184573002754, 'fraction_numerical': 0.0, 'mean_word_length': 3.0973201692524683, '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': '1614249', 'n_tokens_mistral': 841, 'n_tokens_neox': 826, 'n_words': 207}