<commit_before>/* jshint ignore:start */
import Ember from 'ember';
import anime from 'ember-animejs';

const {
  assign,
  computed,
  get,
  set
} = Ember;

const { RSVP: { Promise, resolve } } = Ember;

export default Ember.Object.extend({
  easingIn: 'easeOutSine',
  easingOut: 'easeInExpo',

  transformMapping: computed(() => new Map()),

  animate(element, effect, options) {
    if (get(options, 'clear')) {
      set(this, 'transformMapping', new Map());
    } else {
      const transformMapping = get(this, 'transformMapping');
      let elementMap = transformMapping.get(element);
      if (!elementMap) { elementMap = {}; transformMapping.set(element, elementMap); }
      const transforms = [
        'translateX', 'translateY', 'translateZ',
        'rotateX', 'rotateY', 'rotateZ',
        'scaleX', 'scaleY', 'scaleZ',
        'skewX', 'skewY', 'skewZ'
      ].reduce((transforms, transform) => {
        if (elementMap[transform]) { transforms[transform] = elementMap[transform]; }
        if (effect[transform]) { elementMap[transform] = effect[transform]; }

        return transforms;
      }, {});

      effect = assign(transforms, effect);
    }

    if (!options.easing) { options.easing = 'easeInOutSine'; }
    if (options.duration === 0) { options.duration = 1; }

    return new Promise((resolve) => {
      anime({
        targets: element,
        complete: resolve,
        ...options,
        ...effect
      });
    });
  }
});
<commit_msg>help anime adapter remember state<commit_after>/* jshint ignore:start */
import Ember from 'ember';
import anime from 'ember-animejs';

const {
  assign,
  computed,
  get,
  isPresent,
  set,
  typeOf
} = Ember;

const { RSVP: { Promise, resolve } } = Ember;

export default Ember.Object.extend({
  easingIn: 'easeOutSine',
  easingOut: 'easeInExpo',

  transformMapping: computed(() => new Map()),

  animate(element, effect, options) {
    if (get(options, 'clear')) {
      set(this, 'transformMapping', new Map());
    } else {
      const transformMapping = get(this, 'transformMapping');
      let elementMap = transformMapping.get(element);
      if (!elementMap) { elementMap = {}; transformMapping.set(element, elementMap); }

      Object.keys(elementMap).forEach((key) => {
        const current = typeOf(elementMap[key]) === 'array' ? elementMap[key][1] : elementMap[key];
        const next = isPresent(effect[key]) ? effect[key] : current;

        effect[key] = [current, next];
      });

      assign(elementMap, effect);
    }

    if (!options.easing) { options.easing = 'easeInOutSine'; }
    if (options.duration === 0) { options.duration = 1; }

    return new Promise((resolve) => {
      anime({
        targets: element,
        complete: resolve,
        ...options,
        ...effect
      });
    });
  }
});

{'fraction_non_alphanumeric': 0.1581940988268752, 'fraction_numerical': 0.0017774617845716318, 'mean_word_length': 2.991489361702128, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '5816904', 'n_tokens_mistral': 884, 'n_tokens_neox': 864, 'n_words': 202}