<commit_before>/**
 * Simple initializer that implements the mutationObserverMixin 
 * in all the Components. It uses a flag defined in the app 
 * environment for it.
 */

import Ember from 'ember';
import mutationObserver from '../mixins/mutation-observer';

export function initialize(app) {
  const config = app.lookupFactory ? 
    app.lookupFactory('config:environment') :
    app.__container__.lookupFactory('config:environment');
  
  if (!config || !config.mutationObserverInjection) {return;}

  Ember.Component.reopen(mutationObserver);
}

export default {
  name: 'mutation-observer',
  initialize: initialize
};<commit_msg>Fix initializer for Ember 2.15+<commit_after>/**
 * Simple initializer that implements the mutationObserverMixin 
 * in all the Components. It uses a flag defined in the app 
 * environment for it.
 */

import Ember from 'ember';
import mutationObserver from '../mixins/mutation-observer';

export function initialize(app) {
  let config;
  try {
    // Ember 2.15+
    config = app.resolveRegistration('config:environment');
  } catch (e) {
    // Older Ember approach
    config = app.lookupFactory ?
      app.lookupFactory('config:environment') :
      app.__container__.lookupFactory('config:environment');
  }

  if (!config || !config.mutationObserverInjection) {return;}

  Ember.Component.reopen(mutationObserver);
}

export default {
  name: 'mutation-observer',
  initialize: initialize
};
{'fraction_non_alphanumeric': 0.11350974930362116, 'fraction_numerical': 0.004178272980501393, 'mean_word_length': 4.302583025830258, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3615840', 'n_tokens_mistral': 419, 'n_tokens_neox': 398, 'n_words': 113}