<commit_before>// @flow
import createLogger from 'redux-logger'
import createSagaMiddleware from 'redux-saga'
import mainSaga from './configure-sagas'
import rootReducer from '../reducers'
import storeEnhancer from './enhancer.platform'
import thunkMiddleware from 'redux-thunk'
import {Iterable} from 'immutable'
import {actionLogger} from './action-logger'
import {closureCheck} from './closure-check'
import {createStore} from 'redux'
import {enableStoreLogging, enableActionLogging, closureStoreCheck} from '../local-debug'
import {isMobile} from '../constants/platform'
import {requestIdleCallback} from '../util/idle-callback'

// Transform objects from Immutable on printing
const objToJS = state => {
  var newState = {}

  Object.keys(state).forEach(i => {
    if (Iterable.isIterable(state[i])) {
      newState[i] = state[i].toJS()
    } else {
      newState[i] = state[i]
    }
  })

  return newState
}

const logger = {}

for (const method in console) {
  if (typeof console[method] === 'function') {
    logger[method] = (...args) => {
      requestIdleCallback(() => {
        console[method](...args)
      }, {timeout: 1e3})
    }
  }
}

const loggerMiddleware: any = enableStoreLogging ? createLogger({
  duration: true,
  stateTransformer: objToJS,
  actionTransformer: objToJS,
  collapsed: true,
  logger,
}) : null

const sagaMiddleware = createSagaMiddleware()
let middlewares = [sagaMiddleware, thunkMiddleware]

if (enableStoreLogging) {
  middlewares.push(loggerMiddleware)
} else if (enableActionLogging) {
  middlewares.push(actionLogger)
}

if (closureStoreCheck) {
  middlewares.push(closureCheck)
}

export default function configureStore (initialState: any) {
  const store = createStore(rootReducer, initialState, storeEnhancer(middlewares))

  if (module.hot && isMobile) {
    // $FlowIssue
    module.hot.accept('../reducers', () => {
      store.replaceReducer(require('../reducers').default)
    })
  }

  sagaMiddleware.run(mainSaga)
  return store
}
<commit_msg>incorrect flag (#4508)<commit_after>// @flow
import createLogger from 'redux-logger'
import createSagaMiddleware from 'redux-saga'
import mainSaga from './configure-sagas'
import rootReducer from '../reducers'
import storeEnhancer from './enhancer.platform'
import thunkMiddleware from 'redux-thunk'
import {Iterable} from 'immutable'
import {actionLogger} from './action-logger'
import {closureCheck} from './closure-check'
import {createStore} from 'redux'
import {enableStoreLogging, enableActionLogging, closureStoreCheck} from '../local-debug'
import {isMobile} from '../constants/platform'
import {requestIdleCallback} from '../util/idle-callback'

// Transform objects from Immutable on printing
const objToJS = state => {
  var newState = {}

  Object.keys(state).forEach(i => {
    if (Iterable.isIterable(state[i])) {
      newState[i] = state[i].toJS()
    } else {
      newState[i] = state[i]
    }
  })

  return newState
}

const logger = {}

for (const method in console) {
  if (typeof console[method] === 'function') {
    logger[method] = (...args) => {
      requestIdleCallback(() => {
        console[method](...args)
      }, {timeout: 1e3})
    }
  }
}

const loggerMiddleware: any = enableStoreLogging ? createLogger({
  duration: true,
  stateTransformer: objToJS,
  actionTransformer: objToJS,
  collapsed: true,
  logger,
}) : null

const sagaMiddleware = createSagaMiddleware()
let middlewares = [sagaMiddleware, thunkMiddleware]

if (enableStoreLogging) {
  middlewares.push(loggerMiddleware)
} else if (enableActionLogging) {
  middlewares.push(actionLogger)
}

if (closureStoreCheck) {
  middlewares.push(closureCheck)
}

export default function configureStore (initialState: any) {
  const store = createStore(rootReducer, initialState, storeEnhancer(middlewares))

  if (module.hot && !isMobile) {
    // $FlowIssue
    module.hot.accept('../reducers', () => {
      store.replaceReducer(require('../reducers').default)
    })
  }

  sagaMiddleware.run(mainSaga)
  return store
}

{'fraction_non_alphanumeric': 0.13489298158287705, 'fraction_numerical': 0.001991040318566451, 'mean_word_length': 4.25359477124183, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '340263', 'n_tokens_mistral': 1284, 'n_tokens_neox': 1279, 'n_words': 294}