<commit_before>import { functions } from './helpers';
import moment from 'moment';

const validate = (values, props) => {
  const errors = {};
  const ArrayErrors = [];
  const requiredFields = ['date', 'start', 'end', 'room'];
  requiredFields.forEach(field => {
    if (!values[field]) {
      errors[field] = 'This field is required';
    }
  });
  if (values.end <= values.start) {
    errors.end = 'End time of schedule must be greater than start time!!!';
  }
  if (!values.schedules || !values.schedules.length) {
    errors.schedules = { _error: '.' };
  } else {
    const schedules = values.schedules;
    let allSchedules = props.allSchedules;
    if (schedules.length > 0 && schedules[0].id) {<commit_msg>validate for edit schedule<commit_after>import { functions } from './helpers';
import moment from 'moment';

const validate = (values, props) => {
  const errors = {};
  const ArrayErrors = [];
  const requiredFields = ['paper', 'date', 'start', 'end', 'room'];
  requiredFields.forEach(field => {
    if (!values[field]) {
      errors[field] = 'This field is required';
    }
  });
  if (values.end <= values.start) {
    errors.end = 'End time of schedule must be greater than start time!!!';
  }
  if (!values.schedules || !values.schedules.length) {
    errors.schedules = { _error: '.' };
  } else {
    const schedules = values.schedules;
    let allSchedules = props.allSchedules;
    if (schedules.length > 0 && schedules[0].id) {
{'fraction_non_alphanumeric': 0.16277472527472528, 'fraction_numerical': 0.0027472527472527475, 'mean_word_length': 3.483076923076923, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '6863432', 'n_tokens_mistral': 451, 'n_tokens_neox': 442, 'n_words': 124}