<commit_before>import { Component, PropTypes, Children } from 'react';

export class Provider extends Component {
  static propTypes = {
    store: PropTypes.object.isRequired,
    services: PropTypes.object.isRequired,
    children: PropTypes.element.isRequired,
  }

  static childContextTypes = {
    services: PropTypes.object.isRequired,
    store: PropTypes.object.isRequired,
  }

  constructor(props, context) {
    super(props, context);

    const { store, services } = this.props;

    this.roots = {
      store,
      services: Object
        .keys(services)
        .reduce((initializedServices, serviceName) => ({
          ...initializedServices,
          [serviceName]: new services[serviceName],
        }), {}),
    };

    Object
      .keys(services)
      .forEach(actionName => {
        this.roots.services[actionName].store = this.roots.store;
        this.roots.services[actionName].services = this.roots.services;
      });
  }

  getChildContext() {
    return {
      services: this.roots.services,
      store: this.roots.store,
    };
  }

  render() {
    return Children.only(this.props.children);
  }
}<commit_msg>refactor: simplify variables<commit_after>import { Component, PropTypes, Children } from 'react';

export class Provider extends Component {
  static propTypes = {
    store: PropTypes.object.isRequired,
    services: PropTypes.object.isRequired,
    children: PropTypes.element.isRequired,
  }

  static childContextTypes = {
    services: PropTypes.object.isRequired,
    store: PropTypes.object.isRequired,
  }

  constructor(props, context) {
    super(props, context);

    const { store, services } = this.props;

    this.store = store;
    this.services = Object
      .keys(services)
      .reduce((initializedServices, serviceName) => ({
        ...initializedServices,
        [serviceName]: new services[serviceName],
      }), {});

    Object
      .keys(services)
      .forEach(actionName => {
        this.services[actionName].store = this.store;
        this.services[actionName].services = this.services;
      });
  }

  getChildContext() {
    return {
      services: this.services,
      store: this.store,
    };
  }

  render() {
    return Children.only(this.props.children);
  }
}
{'fraction_non_alphanumeric': 0.12367021276595745, 'fraction_numerical': 0.0, 'mean_word_length': 2.7932773109243696, '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': '7210318', 'n_tokens_mistral': 651, 'n_tokens_neox': 641, 'n_words': 122}