<commit_before>Template.activityTable.helpers({
  'activities': function () {
    // Get Resident ID from router
    var residentId = Router.current().params.residentId;

    // Get resident activities
    var activities = Activities.find({residentIds: residentId}).fetch();

    var activitiesArray = [];

    activities.forEach(function (activity) {
      // Create temporary object to get Activity values
      var activityObject = {
        activityType: activity.activityType(),
        activityDate: activity.activityDate,
        duration: activity.duration
      };

      // Add Activity to activities list
      activitiesArray.push(activityObject);
    });

    return activitiesArray;
  },
  'tableSettings': function () {
    var tableSettings = {
      showFilter: false,
      fields: [
        {
          key: 'activityType',
          label: 'Activity Type',
          sortOrder:1,
          sortDirection: 'ascending'
        },
        {
          key: 'duration',
          label: 'Duration',
        },
        {
          key: 'activityDate',
          label: 'Activity Date',
          tmpl: Template.dateCell,
          sortOrder: 0,
          sortDirection: 'descending'<commit_msg>Use template data context; es2015 const<commit_after>Template.activityTable.helpers({
  'activities': function () {
    // Get reference to template instance
    const instance = Template.instance();

    // Get resident activities
    const activities = instance.data.activities;

    const activitiesArray = [];

    activities.forEach(function (activity) {
      // Create temporary object to get Activity values
      const activityObject = {
        activityType: activity.activityType(),
        activityDate: activity.activityDate,
        duration: activity.duration
      };

      // Add Activity to activities list
      activitiesArray.push(activityObject);
    });

    return activitiesArray;
  },
  'tableSettings': function () {
    const tableSettings = {
      showFilter: false,
      fields: [
        {
          key: 'activityType',
          label: 'Activity Type',
          sortOrder:1,
          sortDirection: 'ascending'
        },
        {
          key: 'duration',
          label: 'Duration',
        },
        {
          key: 'activityDate',
          label: 'Activity Date',
          tmpl: Template.dateCell,
          sortOrder: 0,
          sortDirection: 'descending'
{'fraction_non_alphanumeric': 0.10264900662251655, 'fraction_numerical': 0.0033112582781456954, 'mean_word_length': 2.1348897535667963, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3426292', 'n_tokens_mistral': 609, 'n_tokens_neox': 596, 'n_words': 153}