<commit_before>// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

part of polymer;

/** Annotation used to automatically register polymer elements. */
class CustomTag {
  final String tagName;
  const CustomTag(this.tagName);
}

/**
 * Metadata used to label static or top-level methods that are called
 * automatically when loading the library of a custom element.
 */
const initMethod = const _InitMethodAnnotation();

/**
 * Initializes a polymer application as follows:
 *   * set up up polling for observable changes
 *   * initialize Model-Driven Views
 *   * Include some style to prevent flash of unstyled content (FOUC)
 *   * for each library in [libraries], register custom elements labeled with
 *      [CustomTag] and invoke the initialization method on it. If [libraries]
 *      is null, first find all libraries that need to be loaded by scanning for
 *      HTML imports in the main document.
 *
 * The initialization on each library is a top-level function and annotated with
 * [initMethod].
 *
 * The urls in [libraries] can be absolute or relative to
 * `currentMirrorSystem().isolate.rootLibrary.uri`.
 */
void initPolymer() {
  if (_useDirtyChecking) {
    dirtyCheckZone().run(_initPolymerOptimized);
  } else {
    _initPolymerOptimized();
  }
}

/**
 * Same as [initPolymer], but runs the version that is optimized for deployment
 * to the internet. The biggest difference is it omits the [Zone] that
 * automatically invokes [Observable.dirtyCheck], and the list of libraries must
 * be supplied instead of being dynamically searched for at runtime.
 */
// TODO(jmesserly): change the Polymer build step to call this directly.
void _initPolymerOptimized() {
  document.register(PolymerDeclaration._TAG, PolymerDeclaration);

  _loadLibraries();

  // Run this after user code so they can add to Polymer.veiledElements
  _preventFlashOfUnstyledContent();

  customElementsReady.then((_) => Polymer._ready.complete());
}

/**<commit_msg>Return zone from initPolymer<commit_after>// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

part of polymer;

/** Annotation used to automatically register polymer elements. */
class CustomTag {
  final String tagName;
  const CustomTag(this.tagName);
}

/**
 * Metadata used to label static or top-level methods that are called
 * automatically when loading the library of a custom element.
 */
const initMethod = const _InitMethodAnnotation();

/**
 * Initializes a polymer application as follows:
 *   * set up up polling for observable changes
 *   * initialize Model-Driven Views
 *   * Include some style to prevent flash of unstyled content (FOUC)
 *   * for each library in [libraries], register custom elements labeled with
 *      [CustomTag] and invoke the initialization method on it. If [libraries]
 *      is null, first find all libraries that need to be loaded by scanning for
 *      HTML imports in the main document.
 *
 * The initialization on each library is a top-level function and annotated with
 * [initMethod].
 *
 * The urls in [libraries] can be absolute or relative to
 * `currentMirrorSystem().isolate.rootLibrary.uri`.
 */
Zone initPolymer() {
  if (_useDirtyChecking) {
    return dirtyCheckZone()..run(_initPolymerOptimized);
  }

  _initPolymerOptimized();
  return Zone.current;
}

/**
 * Same as [initPolymer], but runs the version that is optimized for deployment
 * to the internet. The biggest difference is it omits the [Zone] that
 * automatically invokes [Observable.dirtyCheck], and the list of libraries must
 * be supplied instead of being dynamically searched for at runtime.
 */
// TODO(jmesserly): change the Polymer build step to call this directly.
void _initPolymerOptimized() {
  document.register(PolymerDeclaration._TAG, PolymerDeclaration);

  _loadLibraries();

  // Run this after user code so they can add to Polymer.veiledElements
  _preventFlashOfUnstyledContent();

  customElementsReady.then((_) => Polymer._ready.complete());
}

/**
{'fraction_non_alphanumeric': 0.08135198135198135, 'fraction_numerical': 0.0018648018648018648, 'mean_word_length': 3.9953434225844005, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '614907', 'n_tokens_mistral': 1167, 'n_tokens_neox': 1117, 'n_words': 499}