<commit_before>import { addLocaleData, IntlProvider } from 'react-intl';
import ApolloClient from 'apollo-client';
import { ApolloProvider } from 'react-apollo';
import App from './App';
import { BatchHttpLink } from 'apollo-link-batch-http';
import { BrowserRouter as Router } from 'react-router-dom';
import { buildUrl } from '../../shared/util/url_factory';
import configuration from '../app/configuration';
import CurrentUser from './current_user';
import { dataIdFromObject } from '../../shared/data/apollo';
import { HttpLink } from 'apollo-link-http';
import './index.css';
import { InMemoryCache } from 'apollo-cache-inmemory';
import JssProvider from 'react-jss/lib/JssProvider';
import { MuiThemeProvider, createMuiTheme, createGenerateClassName } from '@material-ui/core/styles';
import React from 'react';
import ReactDOM from 'react-dom';
import * as serviceWorker from './serviceWorker';
import { split } from 'apollo-link';

async function renderAppTree(app) {
  const apolloUrl = buildUrl({ isAbsolute: true, pathname: '/graphql' });

  // link to use if batching
  // also adds a `batch: true` header to the request to prove it's a different link
  const batchHttpLink = new BatchHttpLink({ apolloUrl });
  // link to use if not batching (default)
  const httpLink = new HttpLink({ apolloUrl });

  // We add the Apollo/GraphQL capabilities here (also notice ApolloProvider below).
  const cache = new InMemoryCache({ dataIdFromObject }).restore(window['__APOLLO_STATE__']);
  const client = new ApolloClient({
    request: async op => {
      op.setContext({
        headers: {
          'x-xsrf-token': configuration.csrf || '',
        },
      });
    },
    link: split(
      op => op.getContext().important === true,
      httpLink, // if test is true, debatch
      batchHttpLink // otherwise, batch<commit_msg>apollo: fix typo about default for batching/caching<commit_after>import { addLocaleData, IntlProvider } from 'react-intl';
import ApolloClient from 'apollo-client';
import { ApolloProvider } from 'react-apollo';
import App from './App';
import { BatchHttpLink } from 'apollo-link-batch-http';
import { BrowserRouter as Router } from 'react-router-dom';
import { buildUrl } from '../../shared/util/url_factory';
import configuration from '../app/configuration';
import CurrentUser from './current_user';
import { dataIdFromObject } from '../../shared/data/apollo';
import { HttpLink } from 'apollo-link-http';
import './index.css';
import { InMemoryCache } from 'apollo-cache-inmemory';
import JssProvider from 'react-jss/lib/JssProvider';
import { MuiThemeProvider, createMuiTheme, createGenerateClassName } from '@material-ui/core/styles';
import React from 'react';
import ReactDOM from 'react-dom';
import * as serviceWorker from './serviceWorker';
import { split } from 'apollo-link';

async function renderAppTree(app) {
  const apolloUrl = buildUrl({ isAbsolute: true, pathname: '/graphql' });

  // link to use if batching
  // also adds a `batch: true` header to the request to prove it's a different link (default)
  const batchHttpLink = new BatchHttpLink({ apolloUrl });
  // link to use if not batching
  const httpLink = new HttpLink({ apolloUrl });

  // We add the Apollo/GraphQL capabilities here (also notice ApolloProvider below).
  const cache = new InMemoryCache({ dataIdFromObject }).restore(window['__APOLLO_STATE__']);
  const client = new ApolloClient({
    request: async op => {
      op.setContext({
        headers: {
          'x-xsrf-token': configuration.csrf || '',
        },
      });
    },
    link: split(
      op => op.getContext().important === true,
      httpLink, // if test is true, debatch
      batchHttpLink // otherwise, batch
{'fraction_non_alphanumeric': 0.13045822102425875, 'fraction_numerical': 0.0, 'mean_word_length': 3.9217506631299734, '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': '6157611', 'n_tokens_mistral': 1082, 'n_tokens_neox': 1055, 'n_words': 341}