<commit_before>import React, {Component} from 'react';
import{Linking} from 'react-native';

import configureStore from './store/configureStore';

import * as login from './actions/login'

//temp
import { Actions, Router, Scene } from 'react-native-router-flux'
import HomeContainer from './routes/home/containers/HomeContainer'
import LoginContainer from './routes/login/containers/LoginContainer'


import { Provider, connect } from 'react-redux'


const store = configureStore();

//TODO: use react navigation instead.
const Scenes = Actions.create(
    <Scene key="root" hideNavBar={true}>
        <Scene key="login" component={LoginContainer} hideNavBar={true}/>
        <Scene key="localhost" component={HomeContainer}/>
    </Scene>
);

//TODO: use react navigation instead.
const ConnectedRouter = connect()(Router);

function handleOpenURL(url) {

    if(url != null){
        let myRegexp = /(?:&code=)(\w*)/g;
        let match = myRegexp.exec(url);
        store.dispatch(login.getTemporaryAcessToken(match[1]));
    }
}

Linking.addEventListener('url',(event) => handleOpenURL(event.url));


export default class App extends Component {

    constructor() {
        super();
    }

    componentDidMount() {
        let url = Linking.getInitialURL()
            .then(handleOpenURL)
            .catch(err => console.error('An error occurred', err));
    }

    componentWillUnmount() {
        Linking.removeEventListener('url', handleOpenURL);
    }

    render() {
        return (
            <Provider store={store}>
                <ConnectedRouter scenes={Scenes}/>
            </Provider>
        );
    }<commit_msg>fix line spaces and import<commit_after>//react-native
import React, {Component} from 'react';
import{Linking} from 'react-native';

//redux
import {Provider, connect} from 'react-redux'

//actions
import {getTemporaryAcessToken} from './actions/login'

//temp
import { Actions, Router, Scene } from 'react-native-router-flux'
import HomeContainer from './routes/home/containers/HomeContainer'
import LoginContainer from './routes/login/containers/LoginContainer'


//store
import configureStore from './store/configureStore';


const store = configureStore();

//TODO: use react navigation or react-router v4 instead.
const Scenes = Actions.create(
    <Scene key="root" hideNavBar={true}>
        <Scene key="login" component={LoginContainer} hideNavBar={true}/>
        <Scene key="localhost" component={HomeContainer}/>
    </Scene>
);

const ConnectedRouter = connect()(Router);

function handleOpenURL(url) {

    if(url != null){
        let myRegexp = /(?:&code=)(\w*)/g;
        let match = myRegexp.exec(url);
        store.dispatch(getTemporaryAcessToken(match[1]));
    }
}

Linking.addEventListener('url',(event) => handleOpenURL(event.url));


export default class App extends Component {

    constructor() {
        super();
    }

    componentDidMount() {
        let url = Linking.getInitialURL()
            .then(handleOpenURL)
            .catch(err => console.error('An error occurred', err));
    }

    componentWillUnmount() {
        Linking.removeEventListener('url', handleOpenURL);
    }

    render() {
        return (
            <Provider store={store}>
                <ConnectedRouter scenes={Scenes}/>
            </Provider>
        );
    }
{'fraction_non_alphanumeric': 0.139282484172445, 'fraction_numerical': 0.0009044317154054868, 'mean_word_length': 3.1631116687578418, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 21, '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': '1617992', 'n_tokens_mistral': 964, 'n_tokens_neox': 933, 'n_words': 221}