<commit_before>import React, { Component } from 'react'
import ReactDOM from 'react-dom'
import moment from 'moment'

export default class extends React.Component {
  constructor(props) {
    super(props)
    this.state = {
      post:props.data
    }

  }
  convertTime(date){
    return (moment(new Date(date)).fromNow() + ':')
  }
  render(){
    if(!this.state.post){
      return(<tweet></tweet>)
    }
    return(
      <twitter className={this.props.className} id={this.state.post.id}>
        <time>{this.convertTime(this.state.post.created_at)}</time>
        <a
          className="from"
          href={this.state.post.url}
          title={this.state.post.title}>
            @{this.state.post.name}
        </a>
        <a
          className="profile"
          href={this.state.post.url}
          title={this.state.post.title}>
          <img src={this.state.post.img} alt={this.state.post.name}/>
        </a>
        <div className="tweet" dangerouslySetInnerHTML={{__html: this.state.post.tweet}} />
      </twitter>
    )
  }
}<commit_msg>add support for profile toggling<commit_after>import React, { Component } from 'react'
import ReactDOM from 'react-dom'
import moment from 'moment'

export default class extends React.Component {
  constructor(props) {
    super(props)
    this.state = {
      post:props.data,
      showProfile: (props.showProfile ? true : false)
    }

  }
  convertTime(date){
    return (moment(new Date(date)).fromNow() + ':')
  }

  Profile(){
    return(
        <a
          className="profile"
          href={this.state.post.url}
          title={this.state.post.title}>
          <img src={this.state.post.img} alt={this.state.post.name}/>
        </a>
    )
  }

  render(){
    if(!this.state.post){
      return(<tweet></tweet>)
    }
    let profile = '';
    if(this.state.showProfile){
      profile = this.Profile();
    }
    return(
      <twitter className={this.props.className} id={this.state.post.id}>
        <time>{this.convertTime(this.state.post.created_at)}</time>
        <a
          className="from"
          href={this.state.post.url}
          title={this.state.post.title}>
            @{this.state.post.name}
        </a>
        {profile}
        <div className="tweet" dangerouslySetInnerHTML={{__html: this.state.post.tweet}} />
      </twitter>
    )
  }
}
{'fraction_non_alphanumeric': 0.15805211448099102, 'fraction_numerical': 0.0, 'mean_word_length': 2.321985815602837, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '5079371', 'n_tokens_mistral': 751, 'n_tokens_neox': 742, 'n_words': 122}