<commit_before>class TreeItem2 extends ReactComponent {
    onDivMouseDown = e => {
        console.log('TreeItem2.onDivMouseDown', e.currentTarget);
        this.props.tree.select(this.props.item);
    }
    onNodeMouseDown = e => {
        console.log('TreeItem2.onNodeMouseDown', e.currentTarget);
        e.stopPropagation();
    }
    isSelected() {
        return this.props.tree.state.selectedItem === this.props.item;
    }
    render() {
        const item = this.props.item;
        const tree = this.props.tree;
        return <li key={item.title} className={'opened'}>
            <div onMouseDown={this.onDivMouseDown} className={this.isSelected() ? 'active' : null} style={{paddingLeft: this.props.paddingLeft}}>
                <span className={'node'} onMouseDown={this.onNodeMouseDown}/>
                &nbsp;
                <span>{item.title}</span>
            </div>
            {item.items &&
            <ul>
                {item.items.map(item => <TreeItem2 key={item.title} tree={tree} item={item} paddingLeft={this.props.paddingLeft+15}/>)}
            </ul>
            }
        </li>;
    }
}<commit_msg>open/close<commit_after>class TreeItem2 extends ReactComponent {
    constructor(props) {
        super(props);
        this.state = {
            opened: false
        };
    }
    onDivMouseDown = e => {
        console.log('TreeItem2.onDivMouseDown', e.currentTarget);
        this.props.tree.select(this.props.item);
    }
    onNodeMouseDown = e => {
        console.log('TreeItem2.onNodeMouseDown', e.currentTarget);
        e.stopPropagation();
        this.setState(prevState => {
            return {opened: !prevState.opened};
        });
    }
    isSelected() {
        return this.props.tree.state.selectedItem === this.props.item;
    }
    isNode() {
        return !!this.props.item.items;
    }
    isOpened() {
        return this.state.opened;
    }
    render() {
        const item = this.props.item;
        const tree = this.props.tree;
        return <li key={item.title} className={this.isOpened() ? 'opened' : null}>
            <div onMouseDown={this.onDivMouseDown} className={this.isSelected() ? 'active' : null} style={{paddingLeft: this.props.paddingLeft}}>
                <span className={this.isNode() ? 'node' : 'leaf'} onMouseDown={this.onNodeMouseDown}/>
                &nbsp;
                <span>{item.title}</span>
            </div>
            {item.items &&
            <ul>
                {item.items.map(item => <TreeItem2 key={item.title} tree={tree} item={item} paddingLeft={this.props.paddingLeft+15}/>)}
            </ul>
            }
        </li>;
    }
}
{'fraction_non_alphanumeric': 0.15160680529300566, 'fraction_numerical': 0.004536862003780718, 'mean_word_length': 2.080325960419092, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 30, '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': '2363004', 'n_tokens_mistral': 803, 'n_tokens_neox': 793, 'n_words': 123}