<commit_before><!--
    Listens for external elements and notifies locally. Target can be any window
    accessible property path, for example "document" or "screen.orientation". By
    default if no path is specified events are listened for on the window
    itself.

    The presence of an attribute that starts with "on-" will trigger a listener
    on the target for the event name following the dash. This works implicitly
    in polymer's declarative event handlers. If you're not using polymer, or are
    creating an element programatically you can add an attribute
    "on-{eventname}" to the element with no value.

    Dynamically changing the target or event attributes after inserting into the
    document is not supported.

    Usage:

    <fx-listener on-hashchange="{{ handleHashChange }}"></fx-listener>
    <fx-listener
        target="screen.orientation"
        on-orientationchange="{{ handleHashChange }}"></fx-listener>
-->
<link href="../polymer/polymer.html" rel="import">

<link href="fx-shared-instance.html" rel="import">

<polymer-element name="fx-listener" constructor="FxListener" attributes="target">
<script>
(function() {
    var listeners = {};

    function addEventListener(target, eventName, listener) {
        if (!target || !target.addEventListener || !eventName)
            return;
        var data = findListenerData(target, eventName);
        if (!data) {
            data = {
                target: target,
                listeners: [],
                handler: function(event) {
                    dispatchEvents(event, data.listeners);
                },
            };
            listeners[eventName] = listeners[eventName] || [];
            listeners[eventName].push(data);
            target.addEventListener(eventName, data.handler);
        }
        if (!data.listeners.find(listener))
            data.listeners.add(listener);
    }

    function removeEventListener(target, eventName, listener) {<commit_msg>Remove extra import.<commit_after><!--
    Listens for external elements and notifies locally. Target can be any window
    accessible property path, for example "document" or "screen.orientation". By
    default if no path is specified events are listened for on the window
    itself.

    The presence of an attribute that starts with "on-" will trigger a listener
    on the target for the event name following the dash. This works implicitly
    in polymer's declarative event handlers. If you're not using polymer, or are
    creating an element programatically you can add an attribute
    "on-{eventname}" to the element with no value.

    Dynamically changing the target or event attributes after inserting into the
    document is not supported.

    Usage:

    <fx-listener on-hashchange="{{ handleHashChange }}"></fx-listener>
    <fx-listener
        target="screen.orientation"
        on-orientationchange="{{ handleHashChange }}"></fx-listener>
-->
<link href="../polymer/polymer.html" rel="import">

<polymer-element name="fx-listener" constructor="FxListener" attributes="target">
<script>
(function() {
    var listeners = {};

    function addEventListener(target, eventName, listener) {
        if (!target || !target.addEventListener || !eventName)
            return;
        var data = findListenerData(target, eventName);
        if (!data) {
            data = {
                target: target,
                listeners: [],
                handler: function(event) {
                    dispatchEvents(event, data.listeners);
                },
            };
            listeners[eventName] = listeners[eventName] || [];
            listeners[eventName].push(data);
            target.addEventListener(eventName, data.handler);
        }
        if (!data.listeners.find(listener))
            data.listeners.add(listener);
    }

    function removeEventListener(target, eventName, listener) {
{'fraction_non_alphanumeric': 0.10161662817551963, 'fraction_numerical': 0.0, 'mean_word_length': 2.6877956480605487, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, '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': '3550623', 'n_tokens_mistral': 979, 'n_tokens_neox': 934, 'n_words': 327}