<commit_before>var createHistory = require('history').createHashHistory;
var router = require('../router');

var React = require('react');

var $ = React.createElement;

var utils = require('../utils');
var find = utils.find;

var history = typeof window !== 'undefined' && createHistory({queryKey: false});

var DevCardNamespace = require('./DevCardNamespace');
var DevCardNamespaceList = require('./DevCardNamespaceList');

var style = {
  app: {
    backgroundColor: '#fff',
    margin: '0 auto',
    maxWidth: '970px',
    padding: '0 30px 100px'
  },
  heading: {
    fontSize: '35px',
    margin: '30px 0',
    padding: '0 30px'
  }
};

var DevCards = React.createClass({
  displayName: 'DevCards',
  propTypes: {
    catalog: React.PropTypes.object.isRequired
  },
  getInitialState: function() {
    return {
      namespace: null,
      card: null
    };
  },
  componentDidMount: function() {
    var setState = this.setState.bind(this);

    // Listening to URL changes
    this.release = history.listen(function(location) {
      var match = router.match(location.pathname);

      // If we don't match, we redirect to /
      if (!match) {
        return history.push('/');
      }

      var params = match.params;

      var namespace = params.namespace ?
        decodeURIComponent(params.namespace) :
        null;

      var card = params.card ?
        decodeURIComponent(params.card) :
        null;

      setState({
        namespace: namespace,
        card: card
      });
    });
  },
  componentWillUnmount: function() {
    this.release();
  },
  render: function() {
    var catalog = this.props.catalog;
    var currentNamespace = this.state.namespace;
    var currentCard = this.state.card;

    var body = null;

    if (!currentNamespace) {
      body = $(DevCardNamespaceList, { catalog: catalog });
    }<commit_msg>Dropping useless decodeURIComponent<commit_after>var createHistory = require('history').createHashHistory;
var router = require('../router');

var React = require('react');

var $ = React.createElement;

var utils = require('../utils');
var find = utils.find;

var history = typeof window !== 'undefined' && createHistory({queryKey: false});

var DevCardNamespace = require('./DevCardNamespace');
var DevCardNamespaceList = require('./DevCardNamespaceList');

var style = {
  app: {
    backgroundColor: '#fff',
    margin: '0 auto',
    maxWidth: '970px',
    padding: '0 30px 100px'
  },
  heading: {
    fontSize: '35px',
    margin: '30px 0',
    padding: '0 30px'
  }
};

var DevCards = React.createClass({
  displayName: 'DevCards',
  propTypes: {
    catalog: React.PropTypes.object.isRequired
  },
  getInitialState: function() {
    return {
      namespace: null,
      card: null
    };
  },
  componentDidMount: function() {
    var setState = this.setState.bind(this);

    // Listening to URL changes
    this.release = history.listen(function(location) {
      var match = router.match(location.pathname);

      // If we don't match, we redirect to /
      if (!match) {
        return history.push('/');
      }

      var params = match.params;

      setState({
        namespace: params.namespace || null,
        card: params.card || null
      });
    });
  },
  componentWillUnmount: function() {
    this.release();
  },
  render: function() {
    var catalog = this.props.catalog;
    var currentNamespace = this.state.namespace;
    var currentCard = this.state.card;

    var body = null;

    if (!currentNamespace) {
      body = $(DevCardNamespaceList, { catalog: catalog });
    }
{'fraction_non_alphanumeric': 0.13928671721426567, 'fraction_numerical': 0.010109519797809604, 'mean_word_length': 2.8759521218715998, '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': '1431419', 'n_tokens_mistral': 1087, 'n_tokens_neox': 1057, 'n_words': 262}