<commit_before>// matchMedia polyfill for
// https://github.com/WickyNilliams/enquire.js/issues/82
import assign from 'object-assign';
if (typeof window !== 'undefined') {
  const matchMediaPolyfill = function matchMediaPolyfill(mediaQuery: string): MediaQueryList {
    return {
      media: mediaQuery,
      matches: false,
      addListener() {
      },
      removeListener() {
      },
    };
  };
  window.matchMedia = window.matchMedia || matchMediaPolyfill;
}

import SlickCarousel from 'react-slick';
import React from 'react';

export type CarouselEffect = 'scrollx' | 'fade'
// Carousel
export interface CarouselProps {
  /** 动画效果函数，可取 scrollx, fade */
  effect?: CarouselEffect;
  /** 是否显示面板指示点 */
  dots?: boolean;
  /** 垂直显示 */
  vertical?: boolean;
  /** 是否自动切换 */
  autoplay?: boolean;
  /** 动画效果 */
  easing?: string;
  /** 切换面板的回调 */
  beforeChange?: (from: number, to: number) => void;
  /** 切换面板的回调 */
  afterChange?: (current: number) => void;
  /** 行内样式 */
  style?: React.CSSProperties;
  prefixCls?: string;
}

export default class Carousel extends React.Component<CarouselProps, any> {
  static defaultProps = {
    dots: true,
    arrows: false,
    prefixCls: 'ant-carousel',
  };

  render() {
    let props = assign({}, this.props);

    if (props.effect === 'fade') {
      props.fade = true;
      props.draggable = false;
    }

    let className = props.prefixCls;
    if (props.vertical) {
      className = `${className} ${className}-vertical`;
    }

    return (
      <div className={className}>
        <SlickCarousel {...props} />
      </div>
    );
  }
}<commit_msg>fix: should allow ref to react-slick, close: #3164<commit_after>// matchMedia polyfill for
// https://github.com/WickyNilliams/enquire.js/issues/82
import assign from 'object-assign';
if (typeof window !== 'undefined') {
  const matchMediaPolyfill = function matchMediaPolyfill(mediaQuery: string): MediaQueryList {
    return {
      media: mediaQuery,
      matches: false,
      addListener() {
      },
      removeListener() {
      },
    };
  };
  window.matchMedia = window.matchMedia || matchMediaPolyfill;
}

import SlickCarousel from 'react-slick';
import React from 'react';

export type CarouselEffect = 'scrollx' | 'fade'
// Carousel
export interface CarouselProps {
  /** 动画效果函数，可取 scrollx, fade */
  effect?: CarouselEffect;
  /** 是否显示面板指示点 */
  dots?: boolean;
  /** 垂直显示 */
  vertical?: boolean;
  /** 是否自动切换 */
  autoplay?: boolean;
  /** 动画效果 */
  easing?: string;
  /** 切换面板的回调 */
  beforeChange?: (from: number, to: number) => void;
  /** 切换面板的回调 */
  afterChange?: (current: number) => void;
  /** 行内样式 */
  style?: React.CSSProperties;
  prefixCls?: string;
}

export default class Carousel extends React.Component<CarouselProps, any> {
  static defaultProps = {
    dots: true,
    arrows: false,
    prefixCls: 'ant-carousel',
  };

  render() {
    let props = assign({}, this.props);

    if (props.effect === 'fade') {
      props.fade = true;
      props.draggable = false;
    }

    let className = props.prefixCls;
    if (props.vertical) {
      className = `${className} ${className}-vertical`;
    }

    return (
      <div className={className}>
        <SlickCarousel ref="slick" {...props} />
      </div>
    );
  }
}
{'fraction_non_alphanumeric': 0.15182124273033365, 'fraction_numerical': 0.002448729721456994, 'mean_word_length': 2.956416464891041, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, 'https://': 2, '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': '5660802', 'n_tokens_mistral': 1127, 'n_tokens_neox': 1139, 'n_words': 250}