<commit_before>/*
 * Copyright 2019 EPAM Systems
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import { takeEvery, call, all, put, select, cancelled } from 'redux-saga/effects';
import { fetch, updateToken } from 'common/utils/fetch';
import { showDefaultErrorNotification } from 'controllers/notification';
import { SET_TOKEN, tokenSelector } from 'controllers/auth';
import { SET_API_TOKEN } from 'controllers/user';
import { CHANGE_FULL_SCREEN_MODE, TOGGLE_FULL_SCREEN_MODE } from 'controllers/dashboard';
import { FETCH_DATA, FETCH_ERROR, BULK_FETCH_DATA, CONCAT_FETCH_DATA } from './constants';
import {
  fetchSuccessAction,
  fetchStartAction,
  fetchErrorAction,
  concatFetchSuccessAction,
} from './actionCreators';

const silentFetch = (...args) => fetch(...args).catch(() => null);

function* bulkFetchData({ payload, meta }) {
  const namespace = meta.namespace;
  const urls = payload.urls;
  const fetchFunc = meta.silent ? silentFetch : fetch;
  try {
    yield put(fetchStartAction(namespace, payload));
    const responses = yield all(urls.map((url) => call(fetchFunc, url, payload.options)));<commit_msg>EPMRPP-38631: Fix circular dependencies in prod build<commit_after>/*
 * Copyright 2019 EPAM Systems
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import { takeEvery, call, all, put, select, cancelled } from 'redux-saga/effects';
import { fetch, updateToken } from 'common/utils/fetch';
import { showDefaultErrorNotification } from 'controllers/notification';
import { SET_TOKEN, tokenSelector } from 'controllers/auth';
import { SET_API_TOKEN } from 'controllers/user';
import { CHANGE_FULL_SCREEN_MODE, TOGGLE_FULL_SCREEN_MODE } from 'controllers/dashboard/constants';
import { FETCH_DATA, FETCH_ERROR, BULK_FETCH_DATA, CONCAT_FETCH_DATA } from './constants';
import {
  fetchSuccessAction,
  fetchStartAction,
  fetchErrorAction,
  concatFetchSuccessAction,
} from './actionCreators';

const silentFetch = (...args) => fetch(...args).catch(() => null);

function* bulkFetchData({ payload, meta }) {
  const namespace = meta.namespace;
  const urls = payload.urls;
  const fetchFunc = meta.silent ? silentFetch : fetch;
  try {
    yield put(fetchStartAction(namespace, payload));
    const responses = yield all(urls.map((url) => call(fetchFunc, url, payload.options)));
{'fraction_non_alphanumeric': 0.10505719446116797, 'fraction_numerical': 0.006321493076459964, 'mean_word_length': 4.8196147110332745, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3084341', 'n_tokens_mistral': 949, 'n_tokens_neox': 939, 'n_words': 325}