<commit_before>import React, { Component } from 'react';
import { Panel } from 'react-bootstrap';

export default class ImgurImage extends Component {

  formatDate(date) {
    const monthNames = [
      'Jan',
      'Feb',
      'Mar',
      'Apr',
      'Jun',
      'Jul',
      'Aug',
      'Sep',
      'Oct',
      'Nov',
      'Dev'
    ];
    return date.getHours() + ':' + date.getMinutes() + ', ' + monthNames[date.getMonth() - 1] + ' ' + date.getDay();
  }

  render() {

    const footer = (
      <div className='row'>
        <div className='col-md-4'>
          Posted at {this.formatDate(new Date(this.props.image.datetime * 1000))}
          &nbsp;by&nbsp;
          <a href={'https://imgur.com/user/' + this.props.image.account_url} target='_blank'>
            {this.props.image.account_url}
          </a>
        </div>
        <div className='col-md-8'>
          <div className='row'>
            <div className='col-md-2 col-md-offset-2'>
              <i className='glyphicon glyphicon-eye-open'></i> {this.props.image.views}
            </div>
            <div className='col-md-2'>
              <i className='glyphicon glyphicon-comment'></i> {this.props.image.comment_count}
            </div>
            <div className='col-md-2'>
              <i className='glyphicon glyphicon-thumbs-up'></i> {this.props.image.ups}
            </div>
            <div className='col-md-2'>
              <i className='glyphicon glyphicon-thumbs-down'></i> {this.props.image.downs}
            </div>
            <div className='col-md-2'>
              <i className='glyphicon glyphicon-list'></i> {this.props.image.section}
            </div>
          </div>
        </div>

      </div>
    );

    return (
      <div>
        <Panel header={this.props.image.title} footer={footer} bsStyle='primary'>
          <p>{this.props.image.description}</p>
          <a href={this.props.image.link} target='_blank'>
            <img
              className='img-responsive center-block img-thumbnail'
              src={this.props.image.cover ? 'https://imgur.com/' + this.props.image.cover + '.jpg' : this.props.image.link} />
          </a>
        </Panel>
      </div>
    );<commit_msg>Use https images<commit_after>import React, { Component } from 'react';
import { Panel } from 'react-bootstrap';

export default class ImgurImage extends Component {

  formatDate(date) {
    const monthNames = [
      'Jan',
      'Feb',
      'Mar',
      'Apr',
      'Jun',
      'Jul',
      'Aug',
      'Sep',
      'Oct',
      'Nov',
      'Dev'
    ];
    return date.getHours() + ':' + date.getMinutes() + ', ' + monthNames[date.getMonth() - 1] + ' ' + date.getDay();
  }

  getImage() {
    if (this.props.image.cover) {
      return 'https://imgur.com/' + this.props.image.cover + '.jpg';
    }
    return this.props.image.link.replace('http://', 'https://');
  }

  render() {

    const footer = (
      <div className='row'>
        <div className='col-md-4'>
          Posted at {this.formatDate(new Date(this.props.image.datetime * 1000))}
          &nbsp;by&nbsp;
          <a href={'https://imgur.com/user/' + this.props.image.account_url} target='_blank'>
            {this.props.image.account_url}
          </a>
        </div>
        <div className='col-md-8'>
          <div className='row'>
            <div className='col-md-2 col-md-offset-2'>
              <i className='glyphicon glyphicon-eye-open'></i> {this.props.image.views}
            </div>
            <div className='col-md-2'>
              <i className='glyphicon glyphicon-comment'></i> {this.props.image.comment_count}
            </div>
            <div className='col-md-2'>
              <i className='glyphicon glyphicon-thumbs-up'></i> {this.props.image.ups}
            </div>
            <div className='col-md-2'>
              <i className='glyphicon glyphicon-thumbs-down'></i> {this.props.image.downs}
            </div>
            <div className='col-md-2'>
              <i className='glyphicon glyphicon-list'></i> {this.props.image.section}
            </div>
          </div>
        </div>

      </div>
    );

    return (
      <div>
        <Panel header={this.props.image.title} footer={footer} bsStyle='primary'>
          <p>{this.props.image.description}</p>
          <a href={this.props.image.link} target='_blank'>
            <img
              className='img-responsive center-block img-thumbnail'
              src={this.getImage()} />
          </a>
        </Panel>
      </div>
    );
{'fraction_non_alphanumeric': 0.17467345583351782, 'fraction_numerical': 0.005756032765109586, 'mean_word_length': 1.8558786346396965, 'pattern_counts': {'":': 0, '<': 81, '<?xml version=': 0, '>': 81, 'https://': 5, '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': '1853855', 'n_tokens_mistral': 1472, 'n_tokens_neox': 1415, 'n_words': 248}