<commit_before>import React from 'react';
import Relay from 'react-relay';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import Dialog from 'material-ui/Dialog';
import IconMenu from 'material-ui/IconMenu';
import MenuItem from 'material-ui/MenuItem';
import IconButton from 'material-ui/IconButton';
import ArrowDown from 'material-ui/svg-icons/navigation/arrow-drop-down';

import theme from '../theme';
import EditEventMutation from '../mutations/editEvent';
import Daterange from './Daterange';
import Text from './Text';
import EditEvent from './EditEvent';


class Event extends React.Component {
    static contextTypes = {
        relay: Relay.PropTypes.Environment,
    }

    static childContextTypes = {
        muiTheme: React.PropTypes.object.isRequired,
    }

    static propTypes = {
        organization: React.PropTypes.object,
    }

    constructor(props) {
        super(props);
        this.muiTheme = getMuiTheme(theme);
    }

    state = {
        edit: false,
        extra: true,
    }

    getChildContext() {
        return { muiTheme: this.muiTheme };
    }

    toggleEdit = () => {
        this.setState({
            edit: !this.state.edit,
        });
    }

    closeEdit = () => {
        this.setState({
            edit: false,
        });
    }

    saveEvent = (event, closeEdit) => {
        this.context.relay.commitUpdate(new EditEventMutation({
            eventid: event.id,
            title: event.title,
            location: event.location,
            start: event.start,
            end: event.end,
            mdtext: event.mdtext,
        }), {
            onSuccess: () => {
                closeEdit();
            },
            onFailure: (error, ost, kake) => {
                console.error("AD", error, ost, kake);
            },
        });
    }

    render() {
        const event = this.props.organization.event;
        return (
            <section>
                <div style={{ display: 'flex', justifyContent: 'space-between' }}>
                    <h1>{event.title}</h1><commit_msg>Need to include viewer, since it is the query origin.<commit_after>import React from 'react';
import Relay from 'react-relay';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import Dialog from 'material-ui/Dialog';
import IconMenu from 'material-ui/IconMenu';
import MenuItem from 'material-ui/MenuItem';
import IconButton from 'material-ui/IconButton';
import ArrowDown from 'material-ui/svg-icons/navigation/arrow-drop-down';

import theme from '../theme';
import EditEventMutation from '../mutations/editEvent';
import Daterange from './Daterange';
import Text from './Text';
import EditEvent from './EditEvent';


class Event extends React.Component {
    static contextTypes = {
        relay: Relay.PropTypes.Environment,
    }

    static childContextTypes = {
        muiTheme: React.PropTypes.object.isRequired,
    }

    static propTypes = {
        organization: React.PropTypes.object,
    }

    constructor(props) {
        super(props);
        this.muiTheme = getMuiTheme(theme);
    }

    state = {
        edit: false,
        extra: true,
    }

    getChildContext() {
        return { muiTheme: this.muiTheme };
    }

    toggleEdit = () => {
        this.setState({
            edit: !this.state.edit,
        });
    }

    closeEdit = () => {
        this.setState({
            edit: false,
        });
    }

    saveEvent = (event, closeEdit) => {
        this.context.relay.commitUpdate(new EditEventMutation({
            viewer: null,
            eventid: event.id,
            title: event.title,
            location: event.location,
            start: event.start,
            end: event.end,
            mdtext: event.mdtext,
        }), {
            onSuccess: () => {
                closeEdit();
            },
            onFailure: (error, ost, kake) => {
                console.error("AD", error, ost, kake);
            },
        });
    }

    render() {
        const event = this.props.organization.event;
        return (
            <section>
                <div style={{ display: 'flex', justifyContent: 'space-between' }}>
                    <h1>{event.title}</h1>
{'fraction_non_alphanumeric': 0.12583412774070543, 'fraction_numerical': 0.0009532888465204957, 'mean_word_length': 1.9957173447537473, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 21, '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': '496555', 'n_tokens_mistral': 1204, 'n_tokens_neox': 1178, 'n_words': 268}