<commit_before>import React, { Component, PropTypes } from "react";
import moment from "moment";
import { CubeLoadingStyle } from "../constants/loading_styles";
import { BaseEventLogTable } from "../resources_table/resource_table";

const SleepHistoryRow = props => {
  // Used to render the data from the API
  const data = props.object;

  const uuid = data.uuid;
  const startTime = moment(data.start_time);
  const endTime = moment(data.end_time);
  const source = data.source;

  const startTimeFormatted = startTime.format("dddd, MMMM Do YYYY, h:mm:ss a");
  const endTimeFormatted = endTime.format("dddd, MMMM Do YYYY, h:mm:ss a");
  const duration = moment.duration(endTime.diff(startTime));
  const durationFormatted = duration.asMinutes();

  return (
    <tr>
      <td>{startTimeFormatted}</td>
      <td>{endTimeFormatted}</td>
      <td>{durationFormatted} minutes</td>
      <td className="center-source">
        <span className="badge badge-success">{source}</span>
      </td>
      <td>
        <div className="center-icon">
          <div
            className="remove-icon"
            onClick={e =>
              props.confirmDelete(uuid, startTimeFormatted, endTimeFormatted)}
          >
            <i className="fa fa-remove fa-1x" />
          </div>
        </div>
      </td>
    </tr>
  );
};

const SleepHistoryTableHeader = () => (
  <thead>
    <tr>
      <th>Sleep - Start Time</th>
      <th>Sleep - End Time </th>
      <th className="center-source">Time Slept</th>
      <th className="center-source">Source</th>
      <th className="center-source">Actions</th>
    </tr>
  </thead>
);<commit_msg>Round sleep time so its a little more accurate<commit_after>import React, { Component, PropTypes } from "react";
import moment from "moment";
import { CubeLoadingStyle } from "../constants/loading_styles";
import { BaseEventLogTable } from "../resources_table/resource_table";

const SleepHistoryRow = props => {
  // Used to render the data from the API
  const data = props.object;

  const uuid = data.uuid;
  const startTime = moment(data.start_time);
  const endTime = moment(data.end_time);
  const source = data.source;

  const startTimeFormatted = startTime.format("dddd, MMMM Do YYYY, h:mm:ss a");
  const endTimeFormatted = endTime.format("dddd, MMMM Do YYYY, h:mm:ss a");
  const duration = moment.duration(endTime.diff(startTime));
  const durationFormatted = duration.asMinutes();
  const durationFormattedRounded = Math.floor(durationFormatted);

  return (
    <tr>
      <td>{startTimeFormatted}</td>
      <td>{endTimeFormatted}</td>
      <td>{durationFormattedRounded} minutes</td>
      <td className="center-source">
        <span className="badge badge-success">{source}</span>
      </td>
      <td>
        <div className="center-icon">
          <div
            className="remove-icon"
            onClick={e =>
              props.confirmDelete(uuid, startTimeFormatted, endTimeFormatted)}
          >
            <i className="fa fa-remove fa-1x" />
          </div>
        </div>
      </td>
    </tr>
  );
};

const SleepHistoryTableHeader = () => (
  <thead>
    <tr>
      <th>Sleep - Start Time</th>
      <th>Sleep - End Time </th>
      <th className="center-source">Time Slept</th>
      <th className="center-source">Source</th>
      <th className="center-source">Actions</th>
    </tr>
  </thead>
);
{'fraction_non_alphanumeric': 0.14374629519857735, 'fraction_numerical': 0.0005927682276229994, 'mean_word_length': 2.942757009345794, 'pattern_counts': {'":': 0, '<': 69, '<?xml version=': 0, '>': 75, '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': '7046549', 'n_tokens_mistral': 1054, 'n_tokens_neox': 1045, 'n_words': 241}