<commit_before>/**
 * This is a facade wrapping the Visma API, the Epinova API and the project files API
 */
import assert from 'assert'
import {keyBy} from 'lodash'
import omit from 'lodash.omit'

export function create({vismaAPI, epinovaAPI, fileAPI} = {}) {

  assert(vismaAPI, 'You must provide a Visma API client when calling apiClient.create(...)')
  assert(epinovaAPI, 'You must provide a Epinova API client when calling apiClient.create(...)')
  assert(fileAPI, 'You must provide a file API client when calling apiClient.create(...)')

  return {
    getHeaderGroups: vismaAPI.getHeaderGroups,
    query: vismaAPI.query,

    getDimensionLabels: epinovaAPI.getDimensionLabels,

    getVariableDefinitions: epinovaAPI.getVariableDefinitions,

    getAllRegions: fileAPI.getAllRegions,
    getRegionByCode: fileAPI.getRegionByCode,
    getCardsPageByName: getCardsPageByName,
    getCardsPages: _getDecoratedCardsPages
  }

  function _getDecoratedCardsPages() {
    const gotIndexedCardsDescriptions = epinovaAPI.getCardsDescriptions().then(cardsDescriptions => {
      return keyBy(cardsDescriptions, 'cardName')<commit_msg>Fix wrong import of single lodash function<commit_after>/**
 * This is a facade wrapping the Visma API, the Epinova API and the project files API
 */
import assert from 'assert'
import {keyBy, omit} from 'lodash'

export function create({vismaAPI, epinovaAPI, fileAPI} = {}) {

  assert(vismaAPI, 'You must provide a Visma API client when calling apiClient.create(...)')
  assert(epinovaAPI, 'You must provide a Epinova API client when calling apiClient.create(...)')
  assert(fileAPI, 'You must provide a file API client when calling apiClient.create(...)')

  return {
    getHeaderGroups: vismaAPI.getHeaderGroups,
    query: vismaAPI.query,

    getDimensionLabels: epinovaAPI.getDimensionLabels,

    getVariableDefinitions: epinovaAPI.getVariableDefinitions,

    getAllRegions: fileAPI.getAllRegions,
    getRegionByCode: fileAPI.getRegionByCode,
    getCardsPageByName: getCardsPageByName,
    getCardsPages: _getDecoratedCardsPages
  }

  function _getDecoratedCardsPages() {
    const gotIndexedCardsDescriptions = epinovaAPI.getCardsDescriptions().then(cardsDescriptions => {
      return keyBy(cardsDescriptions, 'cardName')
{'fraction_non_alphanumeric': 0.0890652557319224, 'fraction_numerical': 0.0, 'mean_word_length': 4.986807387862797, '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': '1271597', 'n_tokens_mistral': 696, 'n_tokens_neox': 683, 'n_words': 186}