<commit_before>{CrudConfig, makeSimpleStore, extendConfig} = require './helpers'
{TimeStore} = require './time'
_ = require 'underscore'
moment = require 'moment'

addEvents = (hash, events) ->
  for event in events
    week = hash[ moment(event.due_at).startOf('isoweek').format("YYYYww") ] ||= []
    week.push(event)

arrayToSentence = (arry) ->
  arry.slice(0, arry.length - 1).join(', ') + " & " + arry.slice(-1)<commit_msg>Fix arrayToSentence with a single element array<commit_after>{CrudConfig, makeSimpleStore, extendConfig} = require './helpers'
{TimeStore} = require './time'
_ = require 'underscore'
moment = require 'moment'

addEvents = (hash, events) ->
  for event in events
    week = hash[ moment(event.due_at).startOf('isoweek').format("YYYYww") ] ||= []
    week.push(event)

arrayToSentence = (arry) ->
  if arry.length > 1
    arry.slice(0, arry.length - 1).join(', ') + " & " + arry.slice(-1)
  else
    arry[0]
{'fraction_non_alphanumeric': 0.1777301927194861, 'fraction_numerical': 0.008565310492505354, 'mean_word_length': 4.137362637362638, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '1344775', 'n_tokens_mistral': 330, 'n_tokens_neox': 327, 'n_words': 70}