<commit_before>angular.module('myApp', []);

//service style, probably the simplest one
/**
 * Syntax: module.service( 'serviceName', function ); 
 * Result: When declaring serviceName as an injectable argument, 
 * you will be provided with an instance of the function. 
 * In other words new FunctionYouPassedToService().
 */
angular.module('myApp').service('toolboxServiceStyle', function () {
  this.getTime = function () {
    var d = new Date();
    return d.toLocaleString();
  };
});

//factory style, more involved but more sophisticated
/**
 * Syntax: module.factory( 'factoryName', function ); 
 * Result: When declaring factoryName as an injectable argument,
 * you will be provided with the "value" 
 * that is returned by invoking the function reference passed to module.factory.
 */
angular.module('myApp').factory('toolboxFactoryStyle', function () {
  return {
    getTime: function () {
      var d = new Date();
      return d.toLocaleString();
    }
  };
});

//provider style, full blown, configurable version     
/**
 * Syntax: module.provider( 'providerName', function ); 
 * Result: When declaring providerName as an injectable argument,
 * you will be provided with (new ProviderFunction()).$get(). 
 * The constructor function is instantiated before the $get method is called
 * ProviderFunction is the function reference passed to module.provider.
 */
angular.module('myApp').provider('toolboxProviderStyle', function () {

  this.name = 'You';

  this.$get = function () {
    var name = this.name;
    return {
      sayHello: function () {
        return "Hello, " + name + "!";
      },
      getTime: function () {
        var d = new Date();
        return d.toLocaleString();
      }
    };
  };

  this.setName = function (name) {
    this.name = name;
  };
});

//hey, we can configure a provider!            
/**
 * note the use of 'xxxProvider'!
 */
angular.module('myApp').config(function(toolboxProviderStyleProvider){
    toolboxProviderStyleProvider.setName('Wgeeks');
});<commit_msg>add say hello function<commit_after>angular.module('myApp', []);

//service style, probably the simplest one
/**
 * Syntax: module.service( 'serviceName', function ); 
 * Result: When declaring serviceName as an injectable argument, 
 * you will be provided with an instance of the function. 
 * In other words new FunctionYouPassedToService().
 */
angular.module('myApp').service('toolboxServiceStyle', function () {
  this.sayHello = function () {
    var x = "You";
    return "Hello, " + x + "!";
  };
  this.getTime = function () {
    var d = new Date();
    return d.toLocaleString();
  };
});

//factory style, more involved but more sophisticated
/**
 * Syntax: module.factory( 'factoryName', function ); 
 * Result: When declaring factoryName as an injectable argument,
 * you will be provided with the "value" 
 * that is returned by invoking the function reference passed to module.factory.
 */
angular.module('myApp').factory('toolboxFactoryStyle', function () {
  return {
    sayHello: function () {
      var x = "You";
      return "Hello, " + x + "!";
    },
    getTime: function () {
      var d = new Date();
      return d.toLocaleString();
    }
  };
});

//provider style, full blown, configurable version     
/**
 * Syntax: module.provider( 'providerName', function ); 
 * Result: When declaring providerName as an injectable argument,
 * you will be provided with (new ProviderFunction()).$get(). 
 * The constructor function is instantiated before the $get method is called
 * ProviderFunction is the function reference passed to module.provider.
 */
angular.module('myApp').provider('toolboxProviderStyle', function () {

  this.name = 'You';

  this.$get = function () {
    var name = this.name;
    return {
      sayHello: function () {
        var x = name;
        return "Hello, " + x + "!";
      },
      getTime: function () {
        var d = new Date();
        return d.toLocaleString();
      }
    };
  };

  this.setName = function (name) {
    this.name = name;
  };
});

//hey, we can configure a provider!            
/**
 * note the use of 'xxxProvider'!
 */
angular.module('myApp').config(function (toolboxProviderStyleProvider) {
  toolboxProviderStyleProvider.setName('Wgeeks');
});
{'fraction_non_alphanumeric': 0.13544600938967136, 'fraction_numerical': 0.0, 'mean_word_length': 3.2953629032258065, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5050192', 'n_tokens_mistral': 1209, 'n_tokens_neox': 1165, 'n_words': 377}