<commit_before>import * as React from 'react';
import { Image } from 'react-bootstrap';
import { Icon } from 'react-fa';
import * as classNames from 'classnames';

import { renderConditional } from '../../React/RenderHelpers';

import './ProfilePicture.less';

export interface ProfilePictureProps extends React.HTMLAttributes<ProfilePicture> {
  src: string;
  size?: number;
  responsive?: boolean;
  rounded?: boolean;
  circle?: boolean;
  thumbnail?: boolean;
  defaultSrc?: string;
  defaultIcon?: string;
  iconSize?: string;
}

const dataUriPrefix = 'data:image;base64,';

export class ProfilePicture extends React.Component<ProfilePictureProps, any> {
  public static displayName = 'ProfilePicture';

  static defaultProps = {
    size: 65,
    responsive: false,
    rounded: false,
    circle: false,
    thumbnail: false,
    defaultIcon: 'user',
    iconSize: '4x',
  };

  private getImageSource() {
    let src = this.props.src || this.props.defaultSrc;

    // if we're using a src URI, ensure it contains a data URI prefix
    if (String.isNullOrEmpty(src) === false && src.indexOf(dataUriPrefix) < 0) {
      src = `${dataUriPrefix}${src}`;
    }

    return src;
  }<commit_msg>fixing icon size prop typing (uses the string based enum type from the react-fa typings)<commit_after>import * as React from 'react';
import { Image } from 'react-bootstrap';
import { Icon, IconSize } from 'react-fa';
import * as classNames from 'classnames';

import { renderConditional } from '../../React/RenderHelpers';

import './ProfilePicture.less';

export interface ProfilePictureProps extends React.HTMLAttributes<ProfilePicture> {
  src: string;
  size?: number;
  responsive?: boolean;
  rounded?: boolean;
  circle?: boolean;
  thumbnail?: boolean;
  defaultSrc?: string;
  defaultIcon?: string;
  iconSize?: IconSize;
}

const dataUriPrefix = 'data:image;base64,';

export class ProfilePicture extends React.Component<ProfilePictureProps, any> {
  public static displayName = 'ProfilePicture';

  static defaultProps = {
    size: 65,
    responsive: false,
    rounded: false,
    circle: false,
    thumbnail: false,
    defaultIcon: 'user',
    iconSize: '4x',
  };

  private getImageSource() {
    let src = this.props.src || this.props.defaultSrc;

    // if we're using a src URI, ensure it contains a data URI prefix
    if (String.isNullOrEmpty(src) === false && src.indexOf(dataUriPrefix) < 0) {
      src = `${dataUriPrefix}${src}`;
    }

    return src;
  }
{'fraction_non_alphanumeric': 0.12494961708988311, 'fraction_numerical': 0.0048367593712212815, 'mean_word_length': 3.9343936381709743, 'pattern_counts': {'":': 0, '<': 9, '<?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': '3311238', 'n_tokens_mistral': 757, 'n_tokens_neox': 730, 'n_words': 223}