<commit_before>@do_nothing = -> null

@ensure_element = (x) -> if x.length then x

@ensure_element_array = (x) ->
  if not $.isArray x
    return x
  r = []
  for i in x
    if $.isArray i
      r = $.merge r, i
    else
      r.push i
  r
<commit_msg>ensure_element_array(): Flatten nested arrays.<commit_after>@do_nothing = -> null

@ensure_element = (x) -> if x.length then x

@ensure_element_array = (x) ->
  if not $.isArray x
    return x
  r = []
  add_items = (x) ->
    for i in x
      if i
        if $.isArray i
          add_items i
        else
          r.push i
  add_items x
  r

{'fraction_non_alphanumeric': 0.11577181208053691, 'fraction_numerical': 0.0, 'mean_word_length': 1.9264705882352942, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '7177778', 'n_tokens_mistral': 217, 'n_tokens_neox': 220, 'n_words': 71}