<commit_before>/*
2014 <NAME>
*/
//
// DDCompass
//
function DDCompass() {
    "use strict";

    var compass = this;
    if (window.DeviceOrientationEvent) {
        window.addEventListener("deviceorientation", function (e) {
            var deg = (e.alpha);
            $(compass).trigger('headingChanged', [deg]);
        }, false);
        return this;
    }
    else {
        return null;
    }
}

var _deviceCompass = undefined;
DDCompass.getDeviceCompass = function() {
    if(_deviceCompass === undefined) {<commit_msg>rewrote parts<commit_after>/*
2014 <NAME>
*/
//
// DDCompass
// based on http://null-byte.wonderhowto.com/how-to/hack-together-accelerometer-aware-mobile-website-by-accessing-motion-sensors-javascript-0134154/
//
function DDCompass() {
    "use strict";

    var compass = this;
    window.addEventListener("deviceorientation", function (e) {
         var heading;

         if (event.webkitCompassHeading != undefined) { 
             heading = (360 - event.webkitCompassHeading);
         } else if (event.alpha != null) {
             heading =  (270 - event.alpha) * -1; 
         } else {
             heading = null;
         } 
        
         $(compass).trigger('headingChanged', [heading]);
    }, false);
}

var _deviceCompass = undefined;
DDCompass.getDeviceCompass = function() {
    if (!window.DeviceOrientationEvent) {
        return null;
    }
    
    if(_deviceCompass === undefined) {
{'fraction_non_alphanumeric': 0.1387726638772664, 'fraction_numerical': 0.015341701534170154, 'mean_word_length': 2.384433962264151, 'pattern_counts': {'":': 0, '<': 5, '<?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': '446115', 'n_tokens_mistral': 457, 'n_tokens_neox': 421, 'n_words': 85}