<commit_before>var classNames = require("classnames");
var moment = require("moment");
var React = require("react/addons");

var AppStatus = require("../constants/AppStatus");
var QueueStore = require("../stores/QueueStore");

var statusClassNameMapping = {
  [AppStatus.RUNNING]: "running",
  [AppStatus.DEPLOYING]: "deploying",
  [AppStatus.SUSPENDED]: "suspended",
  [AppStatus.DELAYED]: "delayed",
  [AppStatus.WAITING]: "waiting"
};

var statusNameMapping = {
  [AppStatus.RUNNING]: "Running",
  [AppStatus.DEPLOYING]: "Deploying",
  [AppStatus.SUSPENDED]: "Suspended",
  [AppStatus.DELAYED]: "Delayed",
  [AppStatus.WAITING]: "Waiting"
};

var AppStatusComponent = React.createClass({
  displayName: "AppStatusComponent",

  propTypes: {
    model: React.PropTypes.object.isRequired,
    showSummary: React.PropTypes.bool
  },

  getTasksSummary: function () {
    var props = this.props;
    if (props.showSummary !== true) {
      return null;
    }

    return (
      <span className="tasks-summary">
        {`(${props.model.tasksRunning} of ${props.model.instances} tasks)`}
      </span>
    );
  },

  getStatusTitle: function () {
    var model = this.props.model;

    var executionDelay = QueueStore.getDelayByAppId(model.id);

    if (executionDelay) {
      return "Task execution failed, delayed for " +
        `${moment.duration(executionDelay, "seconds").humanize()}.`;
    } else if (model.status === AppStatus.WAITING) {
      return "Waiting for resource offer";
    }

    return null;
  },

  isWarningStatus: function () {
    var model = this.props.model;
    return model.status === AppStatus.DEPLOYING
      || model.status === AppStatus.WAITING;
  },

  render: function () {
    var model = this.props.model;

    var statusClassSet = classNames("app-status",
      statusClassNameMapping[model.status]);

    var iconClassSet = classNames("icon", "icon-mini",
      statusClassNameMapping[model.status]);

    return (
      <span className={statusClassSet} title={this.getStatusTitle()}>
        <i className={iconClassSet}></i>
        {statusNameMapping[model.status]}
        {this.getTasksSummary()}
      </span>
    );
  }
});

module.exports = AppStatusComponent;<commit_msg>Remove unused isWariningStatus method<commit_after>var classNames = require("classnames");
var moment = require("moment");
var React = require("react/addons");

var AppStatus = require("../constants/AppStatus");
var QueueStore = require("../stores/QueueStore");

var statusClassNameMapping = {
  [AppStatus.RUNNING]: "running",
  [AppStatus.DEPLOYING]: "deploying",
  [AppStatus.SUSPENDED]: "suspended",
  [AppStatus.DELAYED]: "delayed",
  [AppStatus.WAITING]: "waiting"
};

var statusNameMapping = {
  [AppStatus.RUNNING]: "Running",
  [AppStatus.DEPLOYING]: "Deploying",
  [AppStatus.SUSPENDED]: "Suspended",
  [AppStatus.DELAYED]: "Delayed",
  [AppStatus.WAITING]: "Waiting"
};

var AppStatusComponent = React.createClass({
  displayName: "AppStatusComponent",

  propTypes: {
    model: React.PropTypes.object.isRequired,
    showSummary: React.PropTypes.bool
  },

  getTasksSummary: function () {
    var props = this.props;
    if (props.showSummary !== true) {
      return null;
    }

    return (
      <span className="tasks-summary">
        {`(${props.model.tasksRunning} of ${props.model.instances} tasks)`}
      </span>
    );
  },

  getStatusTitle: function () {
    var model = this.props.model;

    var executionDelay = QueueStore.getDelayByAppId(model.id);

    if (executionDelay) {
      return "Task execution failed, delayed for " +
        `${moment.duration(executionDelay, "seconds").humanize()}.`;
    } else if (model.status === AppStatus.WAITING) {
      return "Waiting for resource offer";
    }

    return null;
  },

  render: function () {
    var model = this.props.model;

    var statusClassSet = classNames("app-status",
      statusClassNameMapping[model.status]);

    var iconClassSet = classNames("icon", "icon-mini",
      statusClassNameMapping[model.status]);

    return (
      <span className={statusClassSet} title={this.getStatusTitle()}>
        <i className={iconClassSet}></i>
        {statusNameMapping[model.status]}
        {this.getTasksSummary()}
      </span>
    );
  }
});

module.exports = AppStatusComponent;
{'fraction_non_alphanumeric': 0.15067536096879366, 'fraction_numerical': 0.0, 'mean_word_length': 3.648268398268398, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '3093134', 'n_tokens_mistral': 1367, 'n_tokens_neox': 1333, 'n_words': 254}