<commit_before>import React, { Component } from 'react';
import SizeContext from './SizeContext';

export interface SizeProps {
  width: number;
  height: number;
  zoomMultiple: number;
}

type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
type Subtract<T, K> = Omit<T, keyof K>;

const withSize = <P extends SizeProps>(
  WrappedComponent: React.ComponentType<P>,
) =>
  class WithSize extends Component<Subtract<P, SizeProps>> {
    render() {
      return (
        <SizeContext.Consumer>
          {size => <WrappedComponent {...this.props} {...size} />}
        </SizeContext.Consumer>
      );
    }
  };

export default withSize;
<commit_msg>Updated withSize to use PureComponent instead of Component<commit_after>import React, { PureComponent } from 'react';
import SizeContext from './SizeContext';

export interface SizeProps {
  width: number;
  height: number;
  zoomMultiple: number;
}

type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
type Subtract<T, K> = Omit<T, keyof K>;

const withSize = <P extends SizeProps>(
  WrappedComponent: React.ComponentType<P>,
) =>
  class WithSize extends PureComponent<Subtract<P, SizeProps>> {
    render() {
      return (
        <SizeContext.Consumer>
          {size => <WrappedComponent {...this.props} {...size} />}
        </SizeContext.Consumer>
      );
    }
  };

export default withSize;

{'fraction_non_alphanumeric': 0.13956941351150706, 'fraction_numerical': 0.0, 'mean_word_length': 3.4635761589403975, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 31, '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': '4536666', 'n_tokens_mistral': 429, 'n_tokens_neox': 425, 'n_words': 115}