<commit_before>import React, { Component } from 'react';
import { Route, Link } from 'react-router-dom';
import classnames from 'classnames';
import Helmet from 'react-helmet';

import { Popout } from './components/lib/icons/popout';
import { History } from './components/history';
import { Input } from './components/input';

import Api from './api';
import Store from './store';
import Subscription from './subscription';

import './css/custom.css';

export default class DojoApp extends Component {
  constructor(props) {
    super(props);
    this.store = new Store();
    this.store.setStateHandler(this.setState.bind(this));

    this.state = this.store.state;
    this.resetControllers();
  }

  resetControllers() {
    this.api = null;
    this.subscription = null;
  }

  componentDidMount() {
    const channel = new window.channel();
    this.api = new Api(this.props.ship, channel);
    this.store.api = this.api;

    this.subscription = new Subscription(this.store, this.api, channel);
    this.subscription.start();
  }

  componentWillUnmount() {
    this.subscription.delete();<commit_msg>soto: call resetControllers on mount<commit_after>import React, { Component } from 'react';
import { Route, Link } from 'react-router-dom';
import classnames from 'classnames';
import Helmet from 'react-helmet';

import { Popout } from './components/lib/icons/popout';
import { History } from './components/history';
import { Input } from './components/input';

import Api from './api';
import Store from './store';
import Subscription from './subscription';

import './css/custom.css';

export default class DojoApp extends Component {
  constructor(props) {
    super(props);
    this.store = new Store();
    this.store.setStateHandler(this.setState.bind(this));

    this.state = this.store.state;
    this.resetControllers = this.resetControllers.bind(this);
  }

  resetControllers() {
    this.api = null;
    this.subscription = null;
  }

  componentDidMount() {
    this.resetControllers();
    const channel = new window.channel();
    this.api = new Api(this.props.ship, channel);
    this.store.api = this.api;

    this.subscription = new Subscription(this.store, this.api, channel);
    this.subscription.start();
  }

  componentWillUnmount() {
    this.subscription.delete();
{'fraction_non_alphanumeric': 0.14006089604175728, 'fraction_numerical': 0.0, 'mean_word_length': 3.801670146137787, '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': '5701707', 'n_tokens_mistral': 673, 'n_tokens_neox': 687, 'n_words': 171}