<commit_before>/* global $ */
import Promise from "./promise";
import Ember from "ember";

// Make sure Velocity always has promise support by injecting our own
// RSVP-based implementation if it doesn't already have one.
if (!$.Velocity.Promise) {
  $.Velocity.Promise = Promise;
}

export function animate(view, props, opts, label) {
  // These numbers are just sane defaults in the probably-impossible
  // case where somebody tries to read our state before the first
  // 'progress' callback has fired.
  var state = { percentComplete: 0, timeRemaining: 100, timeSpent: 0 },
      elt;

  if (!view || !(elt = view.$()) || !elt[0]) {
    return Promise.cast();
  }

  if (!opts) {
    opts = {};
  } else {
    opts = Ember.copy(opts);
  }

  // By default, we ask velocity to clear the element's `display`
  // property at the start of animation. Our animated divs are all
  // initially rendered at display:none to prevent a flash of
  // before-animated content.
  if (typeof(opts.display) === 'undefined') {
    opts.display = '';
  }<commit_msg>newView is displayed earlier for measurement<commit_after>/* global $ */
import Promise from "./promise";
import Ember from "ember";

// Make sure Velocity always has promise support by injecting our own
// RSVP-based implementation if it doesn't already have one.
if (!$.Velocity.Promise) {
  $.Velocity.Promise = Promise;
}

export function animate(view, props, opts, label) {
  // These numbers are just sane defaults in the probably-impossible
  // case where somebody tries to read our state before the first
  // 'progress' callback has fired.
  var state = { percentComplete: 0, timeRemaining: 100, timeSpent: 0 },
      elt;

  if (!view || !(elt = view.$()) || !elt[0]) {
    return Promise.cast();
  }

  if (!opts) {
    opts = {};
  } else {
    opts = Ember.copy(opts);
  }
{'fraction_non_alphanumeric': 0.12880434782608696, 'fraction_numerical': 0.006521739130434782, 'mean_word_length': 3.232183908045977, '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': '5432396', 'n_tokens_mistral': 558, 'n_tokens_neox': 530, 'n_words': 211}