<commit_before>/* Copyright 2002-2021, OpenNebula Project, OpenNebula 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 * as React from 'react'
import PropTypes from 'prop-types'

import { StaticRouter, BrowserRouter } from 'react-router-dom'
import { Provider as ReduxProvider } from 'react-redux'

import SocketProvider from 'client/providers/socketProvider'
import MuiProvider from 'client/providers/muiProvider'
import NotistackProvider from 'client/providers/notistackProvider'
import { TranslateProvider } from 'client/components/HOC'

import App from 'client/apps/flow/_app'
import theme from 'client/apps/flow/theme'
import { _APPS, APP_URL } from 'client/constants'

const APP_NAME = _APPS.flow.name

const Flow = ({ store, location, context }) => (
  <ReduxProvider store={store}>
    <SocketProvider>
      <TranslateProvider>
        <MuiProvider theme={theme}>
          <NotistackProvider>
            {location && context ? (
              // server build
              <StaticRouter location={location} context={context}>
                <App />
              </StaticRouter>
            ) : (
              // browser build
              <BrowserRouter basename={`${APP_URL}/${APP_NAME}`}>
                <App />
              </BrowserRouter>
            )}
          </NotistackProvider>
        </MuiProvider>
      </TranslateProvider>
    </SocketProvider>
  </ReduxProvider>
)

Flow.propTypes = {
  location: PropTypes.string,
  context: PropTypes.shape({}),
  store: PropTypes.shape({})
}

Flow.defaultProps = {
  location: '',
  context: {},
  store: {}
}<commit_msg>F OpenNebula/one#5422: Remove socket on flow app<commit_after>/* Copyright 2002-2021, OpenNebula Project, OpenNebula 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 * as React from 'react'
import PropTypes from 'prop-types'

import { StaticRouter, BrowserRouter } from 'react-router-dom'
import { Provider as ReduxProvider } from 'react-redux'

import MuiProvider from 'client/providers/muiProvider'
import NotistackProvider from 'client/providers/notistackProvider'
import { TranslateProvider } from 'client/components/HOC'

import App from 'client/apps/flow/_app'
import theme from 'client/apps/flow/theme'
import { _APPS, APP_URL } from 'client/constants'

const APP_NAME = _APPS.flow.name

const Flow = ({ store, location, context }) => (
  <ReduxProvider store={store}>
    <TranslateProvider>
      <MuiProvider theme={theme}>
        <NotistackProvider>
          {location && context ? (
            // server build
            <StaticRouter location={location} context={context}>
              <App />
            </StaticRouter>
          ) : (
            // browser build
            <BrowserRouter basename={`${APP_URL}/${APP_NAME}`}>
              <App />
            </BrowserRouter>
          )}
        </NotistackProvider>
      </MuiProvider>
    </TranslateProvider>
  </ReduxProvider>
)

Flow.propTypes = {
  location: PropTypes.string,
  context: PropTypes.shape({}),
  store: PropTypes.shape({})
}

Flow.defaultProps = {
  location: '',
  context: {},
  store: {}
}
{'fraction_non_alphanumeric': 0.13069614116734535, 'fraction_numerical': 0.005429513282916424, 'mean_word_length': 1.5648930880159124, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 26, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2000451', 'n_tokens_mistral': 1207, 'n_tokens_neox': 1185, 'n_words': 360}