<commit_before>import { ACTION_TYPE, INTROSPECTION_PROPERTY } from './types';

/**
 * Get a set of actions, connected to this store ready to dispatch to the reducers.
 *
 * @param  {String} actionSetID The unique identifier for the action set
 * @return {Object}             The connected action functions
 */
function getConnectedActionSet({ actionSet, actionSetID, getAllConnectedActionSets, dispatch, getConsensusForIntrospection }) {
  let connectedActionSet = {};
  
  Object.keys(actionSet).forEach(actionID => {
    if (actionID === INTROSPECTION_PROPERTY) {
      const introspectionIDs = Object.keys(actionSet[INTROSPECTION_PROPERTY]);
      connectedActionSet.consensus = introspectionIDs.reduce((consensusFunctions, introspectionID) => {
        consensusFunctions[introspectionID] = getConsensusForIntrospection(introspectionID);
        return consensusFunctions;
      }, {});<commit_msg>Add compatibility for old getConsensus API<commit_after>import { ACTION_TYPE, INTROSPECTION_PROPERTY } from './types';

/**
 * Get a set of actions, connected to this store ready to dispatch to the reducers.
 *
 * @param  {String} actionSetID The unique identifier for the action set
 * @return {Object}             The connected action functions
 */
function getConnectedActionSet({ actionSet, actionSetID, getAllConnectedActionSets, dispatch, getConsensusForIntrospection }) {
  let connectedActionSet = {};

  Object.keys(actionSet).forEach(actionID => {
    if (actionID === INTROSPECTION_PROPERTY) {
      const introspectionIDs = Object.keys(actionSet[INTROSPECTION_PROPERTY]);
      connectedActionSet.getConsensus = connectedActionSet.consensus = introspectionIDs.reduce((consensusFunctions, introspectionID) => {
        consensusFunctions[introspectionID] = getConsensusForIntrospection(introspectionID);
        return consensusFunctions;
      }, {});
{'fraction_non_alphanumeric': 0.09222520107238606, 'fraction_numerical': 0.0, 'mean_word_length': 4.886435331230284, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '6781411', 'n_tokens_mistral': 493, 'n_tokens_neox': 503, 'n_words': 124}