<commit_before>var express = require('express');
var router = express.Router();
var cache;

router.get('/', function(req, res) {

  cache.store.get( "dalekState", function( err, value ){
    if( !err ){
      res.json(value);
    } else {
      res.send(err);
    }
  });
});

router.get('/reset', function(req, res) {
  cache.reset();
  res.json({reset: "complete"})
});

router.setCache = function(c){
  cache = c;
}
<commit_msg>reset resets the flow too<commit_after>var express = require('express'),
    router = express.Router(),
    flow = require('../lib/flow_sensor');

var cache;

router.get('/', function(req, res) {

  cache.store.get( "dalekState", function( err, value ){
    if( !err ){
      res.json(value);
    } else {
      res.send(err);
    }
  });
});

router.get('/reset', function(req, res) {
  cache.reset();
  cache.store.get( "dalekState", function( err, s ){
    if( !err ){
      if( s !== undefined ){
        flow.init(dd)
      }
    }
  });
  res.json({reset: "complete"})
});

router.setCache = function(c){
  cache = c;
}

{'fraction_non_alphanumeric': 0.2043519394512772, 'fraction_numerical': 0.0, 'mean_word_length': 2.9924528301886792, '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': '58503', 'n_tokens_mistral': 375, 'n_tokens_neox': 370, 'n_words': 78}