<commit_before>import React, { Component } from 'react';
import PropTypes from 'prop-types';
import {
  StyleSheet,
  Text,
  Image,
  Dimensions,
  View,
  Animated
} from 'react-native';

import { getTouchableComponent } from './utils/touchable';

const DEVICE_WIDTH = Dimensions.get('window').width;

class FloatingActionItem extends Component {
  constructor(props) {
    super(props);

    this.animation = new Animated.Value(0);
  }

  componentWillReceiveProps(nextProps) {
    if (nextProps.active !== this.props.active) {
      Animated.spring(this.animation, { toValue: nextProps.active ? 1 : 0 }).start();
    }
  }

  handleOnPress = () => {
    const { name, onPress } = this.props;

    onPress(name);
  };

  renderText() {
    const { text, position } = this.props;

    if (Boolean(text)) {  // eslint-disable-line no-extra-boolean-cast
      return (
        <View key="text" style={[styles.textContainer, styles[`${position}TextContainer`]]}>
          <Text style={styles.text}>
            {text}
          </Text>
        </View>
      );
    }

    return null;
  }

  renderButton() {
    const { icon, color } = this.props;

    let iconStyle;

    if (icon && icon.uri) {
      iconStyle = styles.iconLogo;
    } else {
      iconStyle = styles.icon;
    }

    return (
      <View key="button" style={[styles.button, { backgroundColor: color }]}>
        {
          Boolean(icon) &&
            <Image style={iconStyle} source={icon} />
        }
      </View>
    );
  }

  render() {
    const { position } = this.props;
    const Touchable = getTouchableComponent();

    const animatedActionContainerStyle = {
      marginBottom: this.animation.interpolate({
        inputRange: [0, 1],
        outputRange: [5, 20]
      })
    };<commit_msg>Added possibility to render component<commit_after>import React, { Component } from 'react';
import PropTypes from 'prop-types';
import {
  StyleSheet,
  Text,
  Image,
  Dimensions,
  View,
  Animated
} from 'react-native';

import { getTouchableComponent } from './utils/touchable';

const DEVICE_WIDTH = Dimensions.get('window').width;

class FloatingActionItem extends Component {
  constructor(props) {
    super(props);

    this.animation = new Animated.Value(0);
  }

  componentWillReceiveProps(nextProps) {
    if (nextProps.active !== this.props.active) {
      Animated.spring(this.animation, { toValue: nextProps.active ? 1 : 0 }).start();
    }
  }

  handleOnPress = () => {
    const { name, onPress } = this.props;

    onPress(name);
  };

  renderText() {
    const { text, position } = this.props;

    if (Boolean(text)) {  // eslint-disable-line no-extra-boolean-cast
      return (
        <View key="text" style={[styles.textContainer, styles[`${position}TextContainer`]]}>
          <Text style={styles.text}>
            {text}
          </Text>
        </View>
      );
    }

    return null;
  }

  renderButton() {
    const { icon, color } = this.props;

    let iconStyle;

    if (icon && icon.uri) {
      iconStyle = styles.iconLogo;
    } else {
      iconStyle = styles.icon;
    }

    return (
      <View key="button" style={[styles.button, { backgroundColor: color }]}>
        {
          React.isValidElement(icon) ? icon : <Image style={iconStyle} source={icon} />
        }
      </View>
    );
  }

  render() {
    const { position } = this.props;
    const Touchable = getTouchableComponent();

    const animatedActionContainerStyle = {
      marginBottom: this.animation.interpolate({
        inputRange: [0, 1],
        outputRange: [5, 20]
      })
    };
{'fraction_non_alphanumeric': 0.14205972648618476, 'fraction_numerical': 0.004465531677365337, 'mean_word_length': 2.534516765285996, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, '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': '2623037', 'n_tokens_mistral': 1138, 'n_tokens_neox': 1103, 'n_words': 233}