<commit_before>import React, { PureComponent, Children, cloneElement } from 'react';
import classnames from 'classnames';
import { BaseAccordionProps } from './PropsType';
import { isArray } from '../utils/validate';

export interface AccordionProps extends BaseAccordionProps {
  prefixCls?: string;
  className?: string;
}

export default class Accordion extends PureComponent<AccordionProps, any> {

  static defaultProps = {
    prefixCls: 'za-accordion',
    multiple: true,
    animated: false,
    open: false,
    onChange: () => {},
  };

  static Item: any;

  constructor(props) {
    super(props);

    this.state = {
      activeIndex: this.getActiveIndex(props),
    };
  }

  componentWillReceiveProps(nextProps) {
    if (!this.isPropEqual(this.props.activeIndex, nextProps.activeIndex)) {
      this.setState({
        activeIndex: this.getActiveIndex(nextProps),
      });
    }
  }

  onItemChange = (key) => {
    alert(key);
    const { multiple, onChange } = this.props;
    const { activeIndex } = this.state;
    const hasKey = activeIndex.indexOf(key) > -1;

    let newActiveIndex: Array<string> = [];
    if (multiple) {
      if (hasKey) {
        newActiveIndex = activeIndex.filter(i => i !== key);
      } else {
        newActiveIndex = activeIndex.slice(0);
        newActiveIndex.push(key);
      }
    } else {
      newActiveIndex = hasKey ? [] : [key];
    }
    this.setState({
      activeIndex: newActiveIndex,
    });
    onChange(Number(key));
  }
<commit_msg>remove alert<commit_after>import React, { PureComponent, Children, cloneElement } from 'react';
import classnames from 'classnames';
import { BaseAccordionProps } from './PropsType';
import { isArray } from '../utils/validate';

export interface AccordionProps extends BaseAccordionProps {
  prefixCls?: string;
  className?: string;
}

export default class Accordion extends PureComponent<AccordionProps, any> {

  static defaultProps = {
    prefixCls: 'za-accordion',
    multiple: true,
    animated: false,
    open: false,
    onChange: () => {},
  };

  static Item: any;

  constructor(props) {
    super(props);

    this.state = {
      activeIndex: this.getActiveIndex(props),
    };
  }

  componentWillReceiveProps(nextProps) {
    if (!this.isPropEqual(this.props.activeIndex, nextProps.activeIndex)) {
      this.setState({
        activeIndex: this.getActiveIndex(nextProps),
      });
    }
  }

  onItemChange = (key) => {
    const { multiple, onChange } = this.props;
    const { activeIndex } = this.state;
    const hasKey = activeIndex.indexOf(key) > -1;

    let newActiveIndex: Array<string> = [];
    if (multiple) {
      if (hasKey) {
        newActiveIndex = activeIndex.filter(i => i !== key);
      } else {
        newActiveIndex = activeIndex.slice(0);
        newActiveIndex.push(key);
      }
    } else {
      newActiveIndex = hasKey ? [] : [key];
    }
    this.setState({
      activeIndex: newActiveIndex,
    });
    onChange(Number(key));
  }

{'fraction_non_alphanumeric': 0.13157013726146635, 'fraction_numerical': 0.0013391362571141614, 'mean_word_length': 3.032388663967611, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, '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': '4872228', 'n_tokens_mistral': 926, 'n_tokens_neox': 915, 'n_words': 196}