<commit_before>import React from 'react-native';
import { EventEmitter } from 'events';

import Dispatcher    from '../Dispatcher';
import AppConstants  from '../Constants/AppConstants';
import LocalKeyStore from '../Stores/LocalKeyStore';

const EnvironmentManager = React.NativeModules.EnvironmentManager;

const CHANGE_EVENT                 = 'change';
const DEBUG_CURRENT_ROUTE_PATH_KEY = AppConstants.DEBUG_CURRENT_ROUTE_PATH_KEY;

var _values = {};

function setCurrentRoutePath(routePath) {
  _values.currentRoutePath = routePath;
}

function resetData() {
  _values = {};
}

var SingletonStore = Object.assign({}, EventEmitter.prototype, {
  get() {
    return _values;
  },

  emitChange() {
    this.emit(CHANGE_EVENT);
  },

  addChangeListener(callback) {
    this.on(CHANGE_EVENT, callback);
  },

  removeChangeListener(callback) {
    this.removeListener(CHANGE_EVENT, callback);
  }
});

Dispatcher.register(function(action) {
  switch (action.actionType) {
    case AppConstants.APP_LAUNCHED:
      LocalKeyStore.getKey(DEBUG_CURRENT_ROUTE_PATH_KEY, (error, routePath) => {
        setCurrentRoutePath(routePath);
        SingletonStore.emitChange();
      });
      break;
    case AppConstants.LAUNCH_ROUTE_PATH:
      if (action.routePath) {
        LocalKeyStore.setKey(DEBUG_CURRENT_ROUTE_PATH_KEY, action.routePath);
        setCurrentRoutePath(action.routePath);
        SingletonStore.emitChange();
      }
      break;
    case AppConstants.LOGOUT_REQUESTED:
      resetData();
      LocalKeyStore.setKey(DEBUG_CURRENT_ROUTE_PATH_KEY, '');
      SingletonStore.emitChange();
      break;
    default:
      // no op
  }
});

export default SingletonStore;
<commit_msg>Fix the require for DebugStore<commit_after>import React from 'react-native';
import { EventEmitter } from 'events';

import Dispatcher    from '../Dispatcher';
import AppConstants  from '../Constants/AppConstants';
import LocalKeyStore from '../Stores/LocalKeyStore';

const EnvironmentManager = React.NativeModules.EnvironmentManager;

const CHANGE_EVENT                 = 'change';
const DEBUG_CURRENT_ROUTE_PATH_KEY = AppConstants.DEBUG_CURRENT_ROUTE_PATH_KEY;

var _values = {};

function setCurrentRoutePath(routePath) {
  _values.currentRoutePath = routePath;
}

function resetData() {
  _values = {};
}

var SingletonStore = Object.assign({}, EventEmitter.prototype, {
  get() {
    return _values;
  },

  emitChange() {
    this.emit(CHANGE_EVENT);
  },

  addChangeListener(callback) {
    this.on(CHANGE_EVENT, callback);
  },

  removeChangeListener(callback) {
    this.removeListener(CHANGE_EVENT, callback);
  }
});

Dispatcher.register(function(action) {
  switch (action.actionType) {
    case AppConstants.APP_LAUNCHED:
      LocalKeyStore.getKey(DEBUG_CURRENT_ROUTE_PATH_KEY, (error, routePath) => {
        setCurrentRoutePath(routePath);
        SingletonStore.emitChange();
      });
      break;
    case AppConstants.LAUNCH_ROUTE_PATH:
      if (action.routePath) {
        LocalKeyStore.setKey(DEBUG_CURRENT_ROUTE_PATH_KEY, action.routePath);
        setCurrentRoutePath(action.routePath);
        SingletonStore.emitChange();
      }
      break;
    case AppConstants.LOGOUT_REQUESTED:
      resetData();
      LocalKeyStore.setKey(DEBUG_CURRENT_ROUTE_PATH_KEY, '');
      SingletonStore.emitChange();
      break;
    default:
      // no op
  }
});

module.exports = SingletonStore;

{'fraction_non_alphanumeric': 0.10977399471675961, 'fraction_numerical': 0.0, 'mean_word_length': 3.8, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6403117', 'n_tokens_mistral': 1034, 'n_tokens_neox': 1043, 'n_words': 173}