<commit_before>'use strict';

var querystring = require('querystring');
var Promise = require('promise');
var moment = require('moment-timezone');
var prequest = require('prequest');
var fbGroups = require('./facebookGroups');
var utils = require('./utils');
var config = require('./config');
var fbBaseUrl = 'https://graph.facebook.com/v2.1/';
var clc = require('cli-color');

function saveFacebookEvents(eventsWithVenues, row, grpIdx) {
  var thisGroupEvents = row.data || [];

  if (thisGroupEvents.length === 0) {
    return eventsWithVenues;
  }

  thisGroupEvents.forEach(function(row) {
    if (!row.location) {
      return;
    }
    eventsWithVenues.push({
      id: row.id,
      name: row.name,<commit_msg>fix(facebook) added null check for end_time<commit_after>'use strict';

var querystring = require('querystring');
var Promise = require('promise');
var moment = require('moment-timezone');
var prequest = require('prequest');
var fbGroups = require('./facebookGroups');
var utils = require('./utils');
var config = require('./config');
var fbBaseUrl = 'https://graph.facebook.com/v2.1/';
var clc = require('cli-color');

function saveFacebookEvents(eventsWithVenues, row, grpIdx) {
  var thisGroupEvents = row.data || [];

  if (thisGroupEvents.length === 0) {
    return eventsWithVenues;
  }

  thisGroupEvents.forEach(function(row) {
    if (!row.location) {
      return;
    }
    if (!row.end_time){
     //TODO : add more sanitization checks for end_time
     row.end_time = utils.localTime(row.start_time).add(2, 'hours').toISOString();
    }
    eventsWithVenues.push({
      id: row.id,
      name: row.name,
{'fraction_non_alphanumeric': 0.1584097859327217, 'fraction_numerical': 0.004281345565749235, 'mean_word_length': 4.128526645768025, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3360925', 'n_tokens_mistral': 531, 'n_tokens_neox': 509, 'n_words': 116}