<commit_before>'use strict';

module.exports = class Context {
  constructor(hash) {
    if (!hash)
      return;

    this.collection = [];

    Object.keys(hash).forEach((key) => {
      if (key == 'next_token')
        return;

      if (hash[key] && hash[key].collection) {<commit_msg>Make sure to properly create contexts with arrays<commit_after>'use strict';

module.exports = class Context {
  constructor(hash) {
    if (!hash)
      return;

    if (hash instanceof Array) {
      this.collection = hash;
      return this;
    }

    this.collection = [];

    Object.keys(hash).forEach((key) => {
      if (key == 'next_token')
        return;

      if (hash[key] && hash[key].collection) {
{'fraction_non_alphanumeric': 0.14793741109530584, 'fraction_numerical': 0.0, 'mean_word_length': 2.6476683937823835, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1836811', 'n_tokens_mistral': 219, 'n_tokens_neox': 210, 'n_words': 51}