<commit_before>'use strict';

(function (angular) {
  angular.module('googleAppsSheetsPluginWidget', ['ui.bootstrap'])
    .controller('WidgetHomeCtrl', ['$scope', 'Buildfire', 'DataStore', 'TAG_NAMES', 'STATUS_CODE',
      function ($scope, Buildfire, DataStore, TAG_NAMES, STATUS_CODE) {
        var WidgetHome = this;

        /*
         * Fetch user's data from datastore
         */
        WidgetHome.init = function () {
          WidgetHome.success = function (result) {
              WidgetHome.data = result.data;
            if(WidgetHome.data.content&& WidgetHome.data.content.url)
            WidgetHome.data.content.url = WidgetHome.data.content.url.replace("/edit", "/htmlview");
            if (!WidgetHome.data.content)
                WidgetHome.data.content = {};
              console.log(">>>>>", WidgetHome.data);
            }
          WidgetHome.error = function (err) {
              if (err && err.code !== STATUS_CODE.NOT_FOUND) {
                console.error('Error while getting data', err);
              }
            };
          DataStore.get(TAG_NAMES.GOOGLE_APPS_SHEETS_DATA).then(WidgetHome.success, WidgetHome.error);
        };

        WidgetHome.onUpdateCallback = function (event) {
          if (event && event.tag === TAG_NAMES.GOOGLE_APPS_SHEETS_DATA) {
            WidgetHome.data = event.data;
            if(WidgetHome.data.content&& WidgetHome.data.content.url)
            WidgetHome.data.content.url = WidgetHome.data.content.url.replace("/edit", "/htmlview");
            if (WidgetHome.data&&!WidgetHome.data.design)
              WidgetHome.data.design = {};
            if (WidgetHome.data&&!WidgetHome.data.content)
              WidgetHome.data.content = {};
          }
        };
        
        DataStore.onUpdate().then(null, null, WidgetHome.onUpdateCallback);

        WidgetHome.init();
<commit_msg>Updated the failed test case.<commit_after>'use strict';

(function (angular) {
  angular.module('googleAppsSheetsPluginWidget', ['ui.bootstrap'])
    .controller('WidgetHomeCtrl', ['$scope', 'Buildfire', 'DataStore', 'TAG_NAMES', 'STATUS_CODE',
      function ($scope, Buildfire, DataStore, TAG_NAMES, STATUS_CODE) {
        var WidgetHome = this;

        /*
         * Fetch user's data from datastore
         */
        WidgetHome.init = function () {
          WidgetHome.success = function (result) {
              WidgetHome.data = result.data;
            if(WidgetHome.data&& WidgetHome.data.content.url)
            WidgetHome.data.content.url = WidgetHome.data.content.url.replace("/edit", "/htmlview");
            if (!WidgetHome.data.content)
                WidgetHome.data.content = {};
              console.log(">>>>>", WidgetHome.data);
            }
          WidgetHome.error = function (err) {
              if (err && err.code !== STATUS_CODE.NOT_FOUND) {
                console.error('Error while getting data', err);
              }
            };
          DataStore.get(TAG_NAMES.GOOGLE_APPS_SHEETS_DATA).then(WidgetHome.success, WidgetHome.error);
        };

        WidgetHome.onUpdateCallback = function (event) {
          if (event && event.tag === TAG_NAMES.GOOGLE_APPS_SHEETS_DATA) {
            WidgetHome.data = event.data;
            if(WidgetHome.data&& WidgetHome.data.content.url)
            WidgetHome.data.content.url = WidgetHome.data.content.url.replace("/edit", "/htmlview");
            if (WidgetHome.data&&!WidgetHome.data.design)
              WidgetHome.data.design = {};
            if (WidgetHome.data&&!WidgetHome.data.content)
              WidgetHome.data.content = {};
          }
        };
        
        DataStore.onUpdate().then(null, null, WidgetHome.onUpdateCallback);

        WidgetHome.init();

{'fraction_non_alphanumeric': 0.13585209003215434, 'fraction_numerical': 0.0, 'mean_word_length': 2.1960616438356166, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '4959390', 'n_tokens_mistral': 1067, 'n_tokens_neox': 1058, 'n_words': 166}