<commit_before>import React, { Component, PropTypes } from 'react';
import { I18nManager } from '@opuscapita/i18n';
import showroomScopeDecorator from '../../decorators/showroomScopeDecorator';

const formatPatterns = {
  en: {
    datePattern: 'MM/dd/yyyy',
    integerPattern: '#,##0',
    numberPattern: '#,##0.00',
    numberDecimalSeparator: '.',
    numberGroupingSeparator: ',',
    numberGroupingSeparatorUse: true
  },
  de: {
    datePattern: "dd.MM.yyyy",
    integerPattern: "#,##0",
    numberPattern: "#,##0.00",
    numberDecimalSeparator: ",",
    numberGroupingSeparator: ".",
    numberGroupingSeparatorUse: true
  }
};

const host = (window._showroom && window._showroom.env && window._showroom.env.HOST) || '';
const port = (window._showroom && window._showroom.env && window._showroom.env.PORT) || '3000';

@showroomScopeDecorator
class DefaultScopeComponent extends Component {
  getChildContext() {
    if (!this.context.i18n) {
      this.context.i18n = new I18nManager('en', null, formatPatterns);
    }
    return {
      i18n: this.context.i18n,
      serviceRegistry: serviceName => ({ url: `http://${host}:${port}` })
    };
  }

  render = () => (<div>{this._renderChildren()}</div>);
}

DefaultScopeComponent.contextTypes = {
  i18n: PropTypes.object
};<commit_msg>Fix DefaultScopeComponent service registry<commit_after>import React, { Component, PropTypes } from 'react';
import { I18nManager } from '@opuscapita/i18n';
import showroomScopeDecorator from '../../decorators/showroomScopeDecorator';

const formatPatterns = {
  en: {
    datePattern: 'MM/dd/yyyy',
    integerPattern: '#,##0',
    numberPattern: '#,##0.00',
    numberDecimalSeparator: '.',
    numberGroupingSeparator: ',',
    numberGroupingSeparatorUse: true
  },
  de: {
    datePattern: "dd.MM.yyyy",
    integerPattern: "#,##0",
    numberPattern: "#,##0.00",
    numberDecimalSeparator: ",",
    numberGroupingSeparator: ".",
    numberGroupingSeparatorUse: true
  }
};

const host = (window._showroom && window._showroom.env && window._showroom.env.HOST) || 'localhost';
const port = (window._showroom && window._showroom.env && window._showroom.env.PORT) || '3000';

@showroomScopeDecorator
class DefaultScopeComponent extends Component {
  getChildContext() {
    if (!this.context.i18n) {
      this.context.i18n = new I18nManager('en', null, formatPatterns);
    }
    return {
      i18n: this.context.i18n,
      serviceRegistry: serviceName => ({ url: `http://${host}:${port}` })
    };
  }

  render = () => (<div>{this._renderChildren()}</div>);
}

DefaultScopeComponent.contextTypes = {
  i18n: PropTypes.object
};
{'fraction_non_alphanumeric': 0.16577946768060836, 'fraction_numerical': 0.02129277566539924, 'mean_word_length': 4.059615384615385, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '5325965', 'n_tokens_mistral': 870, 'n_tokens_neox': 853, 'n_words': 152}