<commit_before>import React from 'react';
import { CSSTransitionGroup } from 'react-transition-group'
import PropTypes from 'prop-types';
import ImageContent from './Image';
import Button from './Button';
import { addClass, removeClass, classToggle } from './utils/classNames';
import './Container.css'

const transitionTime = 300;
const transitionDelta = 50;
export default class Container extends React.Component {
  constructor(props) {
    super(props);
    this.handleLeftClick = this.handleLeftClick.bind(this);
    this.handleRightClick = this.handleRightClick.bind(this);
    this.canMoveToLeft = this.canMoveToLeft.bind(this);
    this.canMoveToRight = this.canMoveToRight.bind(this);
    this.toggleControls = this.toggleControls.bind(this);
    this.handleKeyboard = this.handleKeyboard.bind(this);
    this.getDescriptions = this.getDescriptions.bind(this);
    this.state = {
      selectedImageIndex: props.selectedImage,
      direction: 'none',
      imagesDescriptions: {}
    };
  }

  getDescriptions(){
    let images = this.state.imagesDescriptions;
    this.props.images.forEach((image, index) => {
      if(!image.description) return;
      if(image.description.then){ //if promise
        image.description.then((data) => {
          images[index] = data.data.first_name;
          this.setState({imagesDescriptions: images});
        });
        return;
      }
      images[index] = image.description;
      this.setState({imagesDescriptions: images});<commit_msg>Deleted test code<commit_after>import React from 'react';
import { CSSTransitionGroup } from 'react-transition-group'
import PropTypes from 'prop-types';
import ImageContent from './Image';
import Button from './Button';
import { addClass, removeClass, classToggle } from './utils/classNames';
import './Container.css'

const transitionTime = 300;
const transitionDelta = 50;
export default class Container extends React.Component {
  constructor(props) {
    super(props);
    this.handleLeftClick = this.handleLeftClick.bind(this);
    this.handleRightClick = this.handleRightClick.bind(this);
    this.canMoveToLeft = this.canMoveToLeft.bind(this);
    this.canMoveToRight = this.canMoveToRight.bind(this);
    this.toggleControls = this.toggleControls.bind(this);
    this.handleKeyboard = this.handleKeyboard.bind(this);
    this.getDescriptions = this.getDescriptions.bind(this);
    this.state = {
      selectedImageIndex: props.selectedImage,
      direction: 'none',
      imagesDescriptions: {}
    };
  }

  getDescriptions(){
    let images = this.state.imagesDescriptions;
    this.props.images.forEach((image, index) => {
      if(!image.description) return;
      if(image.description.then){ //if promise
        image.description.then((data) => {
          images[index] = data;
          this.setState({imagesDescriptions: images});
        });
        return;
      }
      images[index] = image.description;
      this.setState({imagesDescriptions: images});
{'fraction_non_alphanumeric': 0.12398921832884097, 'fraction_numerical': 0.0033692722371967657, 'mean_word_length': 3.7352472089314195, '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': '5878630', 'n_tokens_mistral': 837, 'n_tokens_neox': 833, 'n_words': 167}