<commit_before>import React, {PropTypes as t} from 'react';
import {merge} from 'lodash';
import CSSTransitionGroup from 'react-addons-css-transition-group';
import autobind from 'autobind-decorator';
import pure from 'pure-render-decorator';


import PatternHeader from './pattern-header';
import PatternCode from './pattern-code';
import PatternDependencies from './pattern-dependencies';
import PatternDocumentation from './pattern-documentation';
import PatternControl from './pattern-control';
import PatternDemo from './pattern-demo';

import Icon from '../common/icon';
import urlQuery from '../../utils/url-query';

const formatMap = {
	source: 'in',
	buffer: 'out',
	demoSource: 'in',
	demoBuffer: 'out'
};

@pure
class Pattern extends React.Component {
	displayName = 'Pattern';

	static propTypes = {
		base: t.string.isRequired,
		id: t.string.isRequired,
		config: t.object.isRequired,
		manifest: t.object.isRequired,
		results: t.object.isRequired,
		environment: t.string.isRequired,
		onEnvironmentChange: t.func.isRequired,
		onDataRequest: t.func.isRequired,
		location: t.object.isRequired,
		loading: t.bool.isRequired,
		reloading: t.bool.isRequired
	};

	static defaultProps = {
		environment: 'index',
		onEnvironmentChange: () => {},
		onDataRequest: () => {}
	};

	static contextTypes = {
		router: t.any
	};

	comprehend(results, id) {
		const items = [];

		if (!results) {
			return [];
		}<commit_msg>fix: guard PatternHeader[reloading] with default prop<commit_after>import React, {PropTypes as t} from 'react';
import {merge} from 'lodash';
import CSSTransitionGroup from 'react-addons-css-transition-group';
import autobind from 'autobind-decorator';
import pure from 'pure-render-decorator';


import PatternHeader from './pattern-header';
import PatternCode from './pattern-code';
import PatternDependencies from './pattern-dependencies';
import PatternDocumentation from './pattern-documentation';
import PatternControl from './pattern-control';
import PatternDemo from './pattern-demo';

import Icon from '../common/icon';
import urlQuery from '../../utils/url-query';

const formatMap = {
	source: 'in',
	buffer: 'out',
	demoSource: 'in',
	demoBuffer: 'out'
};

@pure
class Pattern extends React.Component {
	displayName = 'Pattern';

	static propTypes = {
		base: t.string.isRequired,
		id: t.string.isRequired,
		config: t.object.isRequired,
		manifest: t.object.isRequired,
		results: t.object.isRequired,
		environment: t.string.isRequired,
		onEnvironmentChange: t.func.isRequired,
		onDataRequest: t.func.isRequired,
		location: t.object.isRequired,
		loading: t.bool.isRequired,
		reloading: t.bool.isRequired
	};

	static defaultProps = {
		environment: 'index',
		reloading: false,
		onEnvironmentChange: () => {},
		onDataRequest: () => {}
	};

	static contextTypes = {
		router: t.any
	};

	comprehend(results, id) {
		const items = [];

		if (!results) {
			return [];
		}
{'fraction_non_alphanumeric': 0.1399726214921287, 'fraction_numerical': 0.0, 'mean_word_length': 4.5150943396226415, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2360037', 'n_tokens_mistral': 966, 'n_tokens_neox': 895, 'n_words': 233}