<commit_before>import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import Box from '../box';
import { TextBody } from '../typography';
import cx from 'classnames';
import theme from './theme.css';

class Badge extends PureComponent {
  static propTypes = {
    children: PropTypes.any,
    className: PropTypes.string,
    disabled: PropTypes.bool,
    element: PropTypes.oneOfType([PropTypes.element, PropTypes.string]),
    icon: PropTypes.element,
    iconPlacement: PropTypes.oneOf(['left', 'right']),
    inherit: PropTypes.bool,
    inverse: PropTypes.bool,
    onMouseLeave: PropTypes.func,
    onMouseUp: PropTypes.func,
  };

  static defaultProps = {
    disabled: false,
    element: 'button',
    iconPlacement: 'left',
    inherit: true,
    inverse: false,
  };

  handleMouseUp = event => {
    this.badgeNode.getNode().blur();
    if (this.props.onMouseUp) {
      this.props.onMouseUp(event);
    }
  };

  handleMouseLeave = event => {
    this.badgeNode.getNode().blur();
    if (this.props.onMouseLeave) {
      this.props.onMouseLeave(event);
    }
  };

  render() {
    const { children, className, disabled, element, icon, iconPlacement, inherit, inverse, ...others } = this.props;<commit_msg>Badge: add propType descriptions<commit_after>import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import Box from '../box';
import { TextBody } from '../typography';
import cx from 'classnames';
import theme from './theme.css';

class Badge extends PureComponent {
  static propTypes = {
    /** The content to display inside the badge. */
    children: PropTypes.any,
    /** A class name for the wrapper to give custom styles. */
    className: PropTypes.string,
    /** If true, component will be disabled. */
    disabled: PropTypes.bool,
    /** Sets a custom element to use as the badge component wrapper. */
    element: PropTypes.oneOfType([PropTypes.element, PropTypes.string]),
    /** The icon displayed inside the badge. */
    icon: PropTypes.element,
    /** The position of the icon inside the badge. */
    iconPlacement: PropTypes.oneOf(['left', 'right']),
    /** If true, component will adapt styles from it's parent component. */
    inherit: PropTypes.bool,
    /** If true, component will be rendered in inverse mode. */
    inverse: PropTypes.bool,
    /** Callback function that is fired when mouse leaves the component. */
    onMouseLeave: PropTypes.func,
    /** Callback function that is fired when the mouse button is released. */
    onMouseUp: PropTypes.func,
  };

  static defaultProps = {
    disabled: false,
    element: 'button',
    iconPlacement: 'left',
    inherit: true,
    inverse: false,
  };

  handleMouseUp = event => {
    this.badgeNode.getNode().blur();
    if (this.props.onMouseUp) {
      this.props.onMouseUp(event);
    }
  };

  handleMouseLeave = event => {
    this.badgeNode.getNode().blur();
    if (this.props.onMouseLeave) {
      this.props.onMouseLeave(event);
    }
  };

  render() {
    const { children, className, disabled, element, icon, iconPlacement, inherit, inverse, ...others } = this.props;
{'fraction_non_alphanumeric': 0.1313613231552163, 'fraction_numerical': 0.0, 'mean_word_length': 3.261517615176152, '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': '4006177', 'n_tokens_mistral': 910, 'n_tokens_neox': 915, 'n_words': 268}