<commit_before>import _ from 'underscore';
import React from 'react';
import { Card, CardHeader } from 'material-ui/Card';
import muiThemeable from 'material-ui/styles/muiThemeable';
import equip from './equip';

const time = require('time-ago')();

const smooth = 'all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms';
const fast = '';

const Post = React.createClass({
    getInitialState() {
        return { right: 0, transition: smooth, opacity: 1 };
    },
    move(e) {
        const delta = e.nativeEvent.touches[0].clientX - this.state.start;
        this.setState({ right: delta, opacity: (1 - Math.abs(delta) / 400) - 0.2 });
    },
    swiped() {
        if (this.state.right > 30) {
            this.add();
        } else if (this.state.right < -30) {
            this.drop();
        }
        this.setState({ right: 0, start: 0, transition: smooth, opacity: 1 });
    },
    start(e) {
        this.setState({ start: e.nativeEvent.touches[0].clientX, transition: fast, opacity: 0.8 });
    },
    render() {
        const { post, style, muiTheme, add, drop } = this.props;
        this.add = add;
        this.drop = drop;

        const { right, transition, opacity } = this.state;
        const link = (
            <sub style={{ width: '100%', position: 'absolute', bottom: '0px', right: '0px', color: muiTheme.card.subtitleColor, textAlign: 'right', padding: '16px' }}>
                <a href={post.sourceUrl}>{time.ago(post.added)} • {post.source} <img src={post.sourceImage} alt={post.title} style={{ paddingLeft: '8px', verticalAlign: 'middle' }} /></a>
            </sub>
        );
        return (
            <div style={{ position: 'relative', display: 'inline-block' }} onTouchMove={this.move} onTouchEnd={this.swiped} onTouchStart={this.start}>
                <Card style={_.extend({ marginLeft: `${right}px`, transition, opacity }, _.omit(style, 'opacity'))}><commit_msg>Pseudo delay the status change and return the card.<commit_after>import _ from 'underscore';
import React from 'react';
import { Card, CardHeader } from 'material-ui/Card';
import muiThemeable from 'material-ui/styles/muiThemeable';
import equip from './equip';

const time = require('time-ago')();

const smooth = 'all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms';
const fast = '';

const Post = React.createClass({
    getInitialState() {
        return { right: 0, transition: smooth, opacity: 1 };
    },
    move(e) {
        const delta = e.nativeEvent.touches[0].clientX - this.state.start;
        this.setState({ right: delta, opacity: (1 - Math.abs(delta) / 400) - 0.2 });
    },
    swiped() {
        if (this.state.right > 30) {
            setTimeout(() => {
                this.add();
                this.setState({ right: 0, start: 0, transition: smooth, opacity: 1 });
            }, 1000);
            this.setState({ right: 400, start: 0, transition: smooth, opacity: 0 });
            return;
        } else if (this.state.right < -30) {
            setTimeout(() => {
                this.drop();
                this.setState({ right: 0, start: 0, transition: smooth, opacity: 1 });
            }, 1000);
            this.setState({ right: -400, start: 0, transition: smooth, opacity: 0 });
            return;
        }
        this.setState({ right: 0, start: 0, transition: smooth, opacity: 1 });
    },
    start(e) {
        this.setState({ start: e.nativeEvent.touches[0].clientX, transition: fast, opacity: 0.8 });
    },
    render() {
        const { post, style, muiTheme, add, drop } = this.props;
        this.add = add;
        this.drop = drop;

        const { right, transition, opacity } = this.state;
        const link = (
            <sub style={{ width: '100%', position: 'absolute', bottom: '0px', right: '0px', color: muiTheme.card.subtitleColor, textAlign: 'right', padding: '16px' }}>
                <a href={post.sourceUrl}>{time.ago(post.added)} • {post.source} <img src={post.sourceImage} alt={post.title} style={{ paddingLeft: '8px', verticalAlign: 'middle' }} /></a>
            </sub>
        );
        return (
            <div style={{ position: 'relative', display: 'inline-block' }} onTouchMove={this.move} onTouchEnd={this.swiped} onTouchStart={this.start}>
                <Card style={_.extend({ marginLeft: `${right}px`, transition, opacity }, _.omit(style, 'opacity'))}>
{'fraction_non_alphanumeric': 0.1690921690921691, 'fraction_numerical': 0.02356202356202356, 'mean_word_length': 2.5404742436631236, 'pattern_counts': {'":': 0, '<': 19, '<?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': '2868538', 'n_tokens_mistral': 1408, 'n_tokens_neox': 1336, 'n_words': 353}