<commit_before>import React from 'react';
import $ from 'jquery';
import { Link } from 'react-router-component';
import { Tab, Tabs, TabList, TabPanel } from 'react-tabs';

import Constants from './../constants';

module.exports = React.createClass({

  propTypes: {
    label: React.PropTypes.string.isRequired,
    type: React.PropTypes.string.isRequired,
    useTabs: React.PropTypes.bool,
  },

  getInitialState: function getInitialState() {
    return {
      tags: {},
    };
  },

  componentDidMount: function componentDidMount() {
    $.getJSON(Constants.API_URL + this.props.type)
      .done((data) => {
        const tags = this.props.useTabs ? this.alphabetiseTags(data.items) : data.items;
        this.setState({ tags });
      });
  },

  isLetter: function isLetter(char) {
    return char.match(/[a-z]/i);
  },

  alphabetiseTags: function alphabetiseTags(tags) {
    const alphabetisedTags = Object.assign({}, Constants.TABS_TEMPLATE);
    for (const tag of tags) {
      const initial = tag.slug[0];
      if (this.isLetter(initial)) {
        alphabetisedTags[initial.toLowerCase()].push(tag);
      } else {
        alphabetisedTags['#'].push(tag);
      }
    }
    return alphabetisedTags;
  },

  renderTabs: function renderTabs() {<commit_msg>Add debug comment.<commit_after>import React from 'react';
import $ from 'jquery';
import { Link } from 'react-router-component';
import { Tab, Tabs, TabList, TabPanel } from 'react-tabs';

import Constants from './../constants';

module.exports = React.createClass({

  propTypes: {
    label: React.PropTypes.string.isRequired,
    type: React.PropTypes.string.isRequired,
    useTabs: React.PropTypes.bool,
  },

  getInitialState: function getInitialState() {
    console.log(this.props.route)
    return {
      tags: {},
    };
  },

  componentDidMount: function componentDidMount() {
    $.getJSON(Constants.API_URL + this.props.type)
      .done((data) => {
        const tags = this.props.useTabs ? this.alphabetiseTags(data.items) : data.items;
        this.setState({ tags });
      });
  },

  isLetter: function isLetter(char) {
    return char.match(/[a-z]/i);
  },

  alphabetiseTags: function alphabetiseTags(tags) {
    const alphabetisedTags = Object.assign({}, Constants.TABS_TEMPLATE);
    for (const tag of tags) {
      const initial = tag.slug[0];
      if (this.isLetter(initial)) {
        alphabetisedTags[initial.toLowerCase()].push(tag);
      } else {
        alphabetisedTags['#'].push(tag);
      }
    }
    return alphabetisedTags;
  },

  renderTabs: function renderTabs() {
{'fraction_non_alphanumeric': 0.14346645986816595, 'fraction_numerical': 0.0007754943776657619, 'mean_word_length': 3.188311688311688, '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': '4977122', 'n_tokens_mistral': 831, 'n_tokens_neox': 814, 'n_words': 161}