<commit_before>'use strict';

angular.module("mopify.account.services", [
    'LocalStorageModule',
    'mopify.widgets.directive.service',
])

.config(function($routeProvider) {
    $routeProvider.when("/account/services", {
        templateUrl: "account/services/services.tmpl.html",
        controller: "AccountServicesController"
    });
})


.controller("AccountServicesController", function AccountServicesController($rootScope, $scope, localStorageService){

    // bind connectedServices with the $scope
    localStorageService.bind($scope, 'connectedServices');

    // Define the default connectedServices object and extend it with the connectedServices object from storage
    $scope.availableServices = [
        {
            name: "Spotify",
            description: "Search and manage playlists and get the latests charts",
            image: "http://icons.iconarchive.com/icons/danleech/simple/256/spotify-icon.png",
            connected: ($scope.connectedServices !== undefined) ? $scope.connectedServices.spotify : false
        },
        {
            name: "Facebook",
            description: "Get more music based on your Facebook likes.",
            image: "http://www.ednfoundation.org/wp-content/uploads/facebook-logo-square.png",
            connected: ($scope.connectedServices !== undefined) ? $scope.connectedServices.facebook : false
        }
    ];

    if($scope.connectedServices === null){
        $scope.connectedServices = {};

        for(var x = 0; x < $scope.availableServices.length; x++){
            var service = $scope.availableServices[x];
            $scope.connectedServices[service.name.toLowerCase()] = false;
        }
    }
});<commit_msg>check against null instead of undefined<commit_after>'use strict';

angular.module("mopify.account.services", [
    'LocalStorageModule',
    'mopify.widgets.directive.service',
])

.config(function($routeProvider) {
    $routeProvider.when("/account/services", {
        templateUrl: "account/services/services.tmpl.html",
        controller: "AccountServicesController"
    });
})


.controller("AccountServicesController", function AccountServicesController($rootScope, $scope, localStorageService){

    // bind connectedServices with the $scope
    localStorageService.bind($scope, 'connectedServices');

    // Define the default connectedServices object and extend it with the connectedServices object from storage
    $scope.availableServices = [
        {
            name: "Spotify",
            description: "Search and manage playlists and get the latests charts",
            image: "http://icons.iconarchive.com/icons/danleech/simple/256/spotify-icon.png",
            connected: ($scope.connectedServices !== null) ? $scope.connectedServices.spotify : false
        },
        {
            name: "Facebook",
            description: "Get more music based on your Facebook likes.",
            image: "http://www.ednfoundation.org/wp-content/uploads/facebook-logo-square.png",
            connected: ($scope.connectedServices !== null) ? $scope.connectedServices.facebook : false
        }
    ];

    if($scope.connectedServices === null){
        $scope.connectedServices = {};

        for(var x = 0; x < $scope.availableServices.length; x++){
            var service = $scope.availableServices[x];
            $scope.connectedServices[service.name.toLowerCase()] = false;
        }
    }
});
{'fraction_non_alphanumeric': 0.12573443008225618, 'fraction_numerical': 0.0023501762632197414, 'mean_word_length': 3.015330188679245, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5993260', 'n_tokens_mistral': 882, 'n_tokens_neox': 861, 'n_words': 183}