<commit_before>/**
 * @file
 * Observer design pattern.
 *
 * This object will provide an observer design pattern. Observers may
 * subscribe to specific message types. Observables may broadcast
 * messages specific to a type.
 *
 * @author <NAME> <<EMAIL>>
 * @version 1.0
 *
 * @see http://www.joezimjs.com/javascript/javascript-design-patterns-observer/
 */
 
/**
 * The Observable class.
 *
 * Instantiate this to objects that wish to be observed.
 *
 * Example:
 * @code
 *   // Create the observer object. It is simply a function.
 *   var Observer = function(message, messageType) {
 *       console.log(message);
 *   }
 *   // Create the observable object.
 *   observable = new Observable();
 *   // Create a default message type for observers to subscribe to.
 *   observable.messageTypeAdd('generic');
 *   // Subscribe the Observer previously declared to any 'generic' messages
 *   // published.
 *   observable.messageSubscribe(Observer, 'generic');
 *   // Publish a message.
 *   observable.messagePublish('generic', 'I published this data!', observable, response = []);
 *   // Optionally examination the response of any observers.
 * @endcode
 */
var Observable = function() {
    this.subscribers = [];
}
Observable.prototype = {
    typeAdd: function(messageType) {
        this.subscribers[messageType] = [];
    },
    typeRemove: function (messageType) {
        var i = 0,<commit_msg>Fixing syntax issues. Adding more documentation.<commit_after>/**
 * @file
 * Observer design pattern.
 *
 * This object will provide an observer design pattern. Observers may
 * subscribe to specific message types. Observables may broadcast
 * messages specific to a type.
 *
 * @author <NAME> <<EMAIL>>
 * @version 0.1
 *
 * @see http://www.joezimjs.com/javascript/javascript-design-patterns-observer/
 */

/**
 * The Observable class.
 *
 * Instantiate this to objects that wish to be observed.
 *
 * Example using Observable:
 * @code
 *   // Create the observer object. It is simply a function.
 *   var Observer = function(message, messageType) {
 *       console.log(message);
 *   }
 *   // Create the observable object.
 *   observable = new Observable();
 *   // Create a default message type for observers to subscribe to.
 *   observable.messageTypeAdd('generic');
 *   // Subscribe previously declared Observer all 'generic' messages.
 *   observable.messageSubscribe(Observer, 'generic');
 *   // Publish a message.
 *   observable.messagePublish('generic', 'I published this data!', observable);
 *   // Optionally examination the response of any observers.
 * @endcode
 *
 * Example extending Observable:
 * @code
 *   // Declare the subclass.
 *   var SubObserverableClass = function() {
 *       // Call our super class constructor.
 *       Observable.call(this)
 *       // Register a message type.
 *       this.typeAdd('generic');
 *   };
 *   // Cause our subclass to inherit methods of Observable superclass.
 *   SubObservableClass.prototype = Observable.prototype;
 *   // Add a new method to our new subclass.
 *   SubObservableClass.prototype.myCustomMethod = function() {
 *       alert('My new custom method added to existing Observable methods!');
 *   };
 * @endcode
 */
var Observable = function() {
    this.subscribers = [];
};
Observable.prototype = {
    typeAdd: function(messageType) {
        this.subscribers[messageType] = [];
    },
    typeRemove: function (messageType) {
        var i = 0,
{'fraction_non_alphanumeric': 0.11904761904761904, 'fraction_numerical': 0.0017421602787456446, 'mean_word_length': 3.155609167671894, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1045102', 'n_tokens_mistral': 964, 'n_tokens_neox': 934, 'n_words': 304}