<commit_before>import I from 'immutable';
import {evaluateAll, expressionToString} from './expression';

export default (
  identifiers,
  topLevelExpressions,
  subExpressions = I.List(),
  formatter
) => {
  const groups = [];

  if (identifiers.size) {
    groups.push({
      name: "identifiers",
      columns: identifiers.map(
        (i) => ({name: expressionToString(i, formatter)})
      ).toArray(),
    });
  }

  if (topLevelExpressions.size) {
    groups.push({
      name: "expressions",
      columns: topLevelExpressions.map(
        (e) => ({name: expressionToString(e.content, formatter)})
      ).toArray(),
    });
  }

  if (subExpressions.size) {
    groups.push({
      name: "Sub expressions",
      columns: subExpressions.map(
        (e) => ({name: expressionToString(e, formatter)})
      ).toArray(),
    });
  }
  return {
    columnGroups: groups,

    rows: identifiers.size < 9 ? evaluateAll({
      expressions: identifiers
        .concat(topLevelExpressions.map((e) => e.content))
        .concat(subExpressions).toList(),
      identifiers,
    }).map((row) => ({
      values: row.values.map(
        (v) => v ? '1' : '0'
      ).toArray(),
    })).toArray() : [],

    error: identifiers.size < 9 ? null :
      "Two many variables",
  };
};
<commit_msg>show labels in table<commit_after>import I from 'immutable';
import {evaluateAll, expressionToString} from './expression';

export default (
  identifiers,
  topLevelExpressions,
  subExpressions = I.List(),
  formatter
) => {
  const groups = [];

  if (identifiers.size) {
    groups.push({
      name: "identifiers",
      columns: identifiers.map(
        (i) => ({name: expressionToString(i, formatter)})
      ).toArray(),
    });
  }

  if (topLevelExpressions.size) {
    groups.push({
      name: "expressions",
      columns: topLevelExpressions.map(
        (e) => ({name: e.name || expressionToString(e.content, formatter)})
      ).toArray(),
    });
  }

  if (subExpressions.size) {
    groups.push({
      name: "Sub expressions",
      columns: subExpressions.map(
        (e) => ({name: expressionToString(e, formatter)})
      ).toArray(),
    });
  }
  return {
    columnGroups: groups,

    rows: identifiers.size < 9 ? evaluateAll({
      expressions: identifiers
        .concat(topLevelExpressions.map((e) => e.content))
        .concat(subExpressions).toList(),
      identifiers,
    }).map((row) => ({
      values: row.values.map(
        (v) => v ? '1' : '0'
      ).toArray(),
    })).toArray() : [],

    error: identifiers.size < 9 ? null :
      "Two many variables",
  };
};

{'fraction_non_alphanumeric': 0.16711486746062235, 'fraction_numerical': 0.003073376872839032, 'mean_word_length': 2.6317991631799162, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, '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': '907284', 'n_tokens_mistral': 840, 'n_tokens_neox': 811, 'n_words': 172}