<commit_before>import React, { Component } from 'react';
import PropTypes from 'prop-types'
import Button from 'material-ui/Button';
import Dialog, {
  DialogActions,
  DialogContent,
  DialogContentText,
  DialogTitle,
} from 'material-ui/Dialog';
import { LinearProgress } from 'material-ui/Progress';

import Objects from 'utils/Objects'

export default class JobMonitorDialog extends Component {

    static propTypes = {
        jobId: PropTypes.string,
        title: PropTypes.string.isRequired,
        okButtonLabel: PropTypes.string,
        handleOkButtonClick: PropTypes.func,
        handleCancelButtonClick: PropTypes.func,
        handleCloseButtonClick: PropTypes.func
	}

    render() {
        const { open, title, job, handleCancelButtonClick, handleCloseButtonClick, handleOkButtonClick } = this.props
        const loading = Objects.isNullOrUndefined(job)
        const okButtonLabel = this.props.okButtonLabel ? this.props.okButtonLabel : 'Ok'
        return (
            <Dialog open={open} 
                    ignoreBackdropClick
                    ignoreEscapeKeyUp>
                <DialogTitle>{title}</DialogTitle>
                <DialogContent style={{width: '400px'}}>
                    {loading ? 
                        <LinearProgress />
                        : job.running ? 
                            <LinearProgress mode="determinate" value={job.progressPercent} />
                            : job.status
                    } 
                    {! loading && job.failed &&
                        <DialogContentText>>{job.errorMessage}</DialogContentText>
                    }
                </DialogContent>
                <DialogActions>
                    {job && job.running &&
                        <Button onClick={handleCancelButtonClick}>Cancel</Button>}
                    {' '}
                    {job && job.completed && 
                        <Button raised color="primary" onClick={handleOkButtonClick}>{okButtonLabel}</Button>}
                    {' '}
                    {job && job.failed &&
                        <Button onClick={handleCloseButtonClick}>Close</Button>}
                </DialogActions><commit_msg>Code clean<commit_after>import React, { Component } from 'react';
import PropTypes from 'prop-types'
import Button from 'material-ui/Button';
import Dialog, {
  DialogActions,
  DialogContent,
  DialogContentText,
  DialogTitle,
} from 'material-ui/Dialog';
import { LinearProgress } from 'material-ui/Progress';

import Objects from 'utils/Objects'

export default class JobMonitorDialog extends Component {

    static propTypes = {
        jobId: PropTypes.string,
        title: PropTypes.string.isRequired,
        okButtonLabel: PropTypes.string,
        handleOkButtonClick: PropTypes.func,
        handleCancelButtonClick: PropTypes.func,
        handleCloseButtonClick: PropTypes.func
	}

    render() {
        const { open, title, job, handleCancelButtonClick, handleCloseButtonClick, handleOkButtonClick } = this.props
        const loading = Objects.isNullOrUndefined(job)
        const okButtonLabel = this.props.okButtonLabel ? this.props.okButtonLabel : 'Ok'
        return (
            <Dialog open={open} 
                    ignoreBackdropClick
                    ignoreEscapeKeyUp>
                <DialogTitle>{title}</DialogTitle>
                <DialogContent style={{width: '400px'}}>
                    {loading ? 
                        <LinearProgress />
                        : job.running ? 
                            <LinearProgress mode="determinate" value={job.progressPercent} />
                            : job.status
                    } 
                    {! loading && job.failed &&
                        <DialogContentText>{job.errorMessage}</DialogContentText>
                    }
                </DialogContent>
                <DialogActions>
                    {job && job.running &&
                        <Button onClick={handleCancelButtonClick}>Cancel</Button>}
                    {' '}
                    {job && job.completed && 
                        <Button raised color="primary" onClick={handleOkButtonClick}>{okButtonLabel}</Button>}
                    {' '}
                    {job && job.failed &&
                        <Button onClick={handleCloseButtonClick}>Close</Button>}
                </DialogActions>
{'fraction_non_alphanumeric': 0.09681093394077449, 'fraction_numerical': 0.001366742596810934, 'mean_word_length': 1.7512531328320802, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 38, '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': '4442588', 'n_tokens_mistral': 1064, 'n_tokens_neox': 1007, 'n_words': 204}