<commit_before>// Copyright 2010 and onwards Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
 * @fileoverview Defines a CalendarEvent class.
 *
 * @author <EMAIL> (<NAME>)
 */

/**
 * A single calendar event, with related methods to manipulate
 * its fields. Note that all fields are stored as a single object within the
 * CalendarEvent; there are no individual getters/setters. That would be too
 * heavyweight for what we need.
 * @param {Object} fields Fields in the calendar entry.
 * TODO(manas) Document fields more clearly.
 * @constructor
 */
function CalendarEvent(fields) {
  this.fields = fields;
  this.populateMissingFields_();
  this.trimAllFieldsToMaxChars_();
  this.fields.gcal_url = this.getGCalUrl_();
}


/**
 * Since all the information is to be sent via a GET request, we need to
 * limit each field to a certain number of characters.
 * @type {number}
 */
var MAX_CHARS_PER_FIELD = 500;


/**
 * Populate missing fields by inferring or calculating their values.
 * @private
 */
CalendarEvent.prototype.populateMissingFields_ = function() {
  if (common.isBlankOrUndef(this.fields.end)) {
    // If there's no end time, infer one as best as we can.
    this.fields.end = this.inferEndTime_(this.fields.start);
  }<commit_msg>Reduce the maximum number of allowable characters per field.<commit_after>// Copyright 2010 and onwards Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
 * @fileoverview Defines a CalendarEvent class.
 *
 * @author <EMAIL> (<NAME>)
 */

/**
 * A single calendar event, with related methods to manipulate
 * its fields. Note that all fields are stored as a single object within the
 * CalendarEvent; there are no individual getters/setters. That would be too
 * heavyweight for what we need.
 * @param {Object} fields Fields in the calendar entry.
 * TODO(manas) Document fields more clearly.
 * @constructor
 */
function CalendarEvent(fields) {
  this.fields = fields;
  this.populateMissingFields_();
  this.trimAllFieldsToMaxChars_();
  this.fields.gcal_url = this.getGCalUrl_();
}


/**
 * Since all the information is to be sent via a GET request, we need to
 * limit each field to a certain number of characters.
 * @type {number}
 */
var MAX_CHARS_PER_FIELD = 300;


/**
 * Populate missing fields by inferring or calculating their values.
 * @private
 */
CalendarEvent.prototype.populateMissingFields_ = function() {
  if (common.isBlankOrUndef(this.fields.end)) {
    // If there's no end time, infer one as best as we can.
    this.fields.end = this.inferEndTime_(this.fields.start);
  }
{'fraction_non_alphanumeric': 0.09585996110030565, 'fraction_numerical': 0.006112809113642679, 'mean_word_length': 3.675324675324675, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '869333', 'n_tokens_mistral': 1019, 'n_tokens_neox': 973, 'n_words': 428}