Creates a new `DisplayOTron` object.
Note: this class is used internally only. You should not instantiate or call it directly.
@constructor
@param {String} model The Display-O-Tron model (should be either '3k' or 'HAT').
358377
function DisplayOTron(model) {
    if (!(this instanceof DisplayOTron)) {
        return new DisplayOTron(model);
    }
    
    this.model = model;
    
    this.pythonProcess = null;
    
    this.reset();
    
    events.EventEmitter.call(this);
}
172572
function DOTHAT() {
    if (!(this instanceof DOTHAT)) {
        return new DOTHAT();
    }
    
    this.displayOTron = new DisplayOTron('HAT');
    this.lcd = new LCD(this.displayOTron);
    this.backlight = new Backlight(this.displayOTron);
    this.barGraph = new BarGraph(this.displayOTron);
    this.touch = new Touch(this.displayOTron);
}
207710
function refreshModel(o) {
  if (!(o instanceof Model)) {throw new TypeError('Model expected')}
  _.forEach(o.elements(), refreshElement)
}
138629
function model (doc, fields) {
    if (!(this instanceof model))
      return new model(doc, fields);
    Model.call(this, doc, fields);
  }
259616
public static <T> SNAXParser<T> createParser(XMLInputFactory factory, NodeModel<T> model) {
        return new SNAXParser<T>(factory, model);
    }
616247
function Touch(displayOTron) {
    if (!(this instanceof Touch)) {
        return new Touch(displayOTron);
    }
    
    this.displayOTron = displayOTron;
    
    var self = this;
    
    this.displayOTron.on('event', function(event) {
        if (event.component === 'Touch') {
            self.emit(event.event);
        }
    });
    
    events.EventEmitter.call(this);
}
31112
function Transformer(primus) {
  this.fuse();

  this.ultron = new Ultron(primus.server);  // Handles listeners with ease.
  this.Spark = primus.Spark;                // Reference to the Spark constructor.
  this.primus = primus;                     // Reference to the Primus instance.
  this.service = null;                      // Stores the real-time service.

  this.initialise();
}
1197038
function modelItem(data, model) {
    var res = {};

    utils.defineProperties(res, {
        _isModelItem: { value: true },

        model: { value: model.value },

        update: { value: function(data, sync) {
            if (sync == null) sync = true;

            return update(res, model, data).then(function() {
                if (!sync) return;
                return res.save();
            });
        } },

        save: { value: function() {
            if (_.has(res, 'id')) {
                var props = serverProperties(res, model);
                return utils.socketPost(model.io, model.url + '/update/' + res.id, props.properties).then(function() {
                    return Promise.all(_.map(props.refresh, function(item) {
                        return item.refresh();
                    }));
                });
            }
            return create(res, model);
        } },

        refresh: { value: function() {
            if (!_.has(res, 'id')) return create(res, model);

            return utils.socketGet(model.io, model.url + '/' + res.id).then(function(data) {
                return update(res, model, data, { noRefresh: true });
            });
        } },

        delete: { value: function() {
            model._removeItem(res);
            return utils.socketDelete(model.io, model.url, { id: res.id });
        } },

        matches: { value: function(query) {
            return utils.socketGet(model.io, model.url, query).then(function(r) {
                for (var i = 0; i < r.length; i++) {
                    if (r[i].id === res.id) return true;
                }
                return false;
            });
        } },

        then: { value: function() {
            return res.ready.then.apply(res.ready, arguments);
        } },

        catch: { value: function() {
            return res.ready.catch.apply(res.ready, arguments);
        } }
    });

    res.ready = Promise.resolve();

    update(res, model, data || {});

    return res;
}
354053
def build_model(self):
        """"""
        with tf.variable_scope(
                "model", reuse=None, initializer=self.initializer):
            self._create_placeholders()
            self._create_rnn_cells()
            self._create_initstate_and_embeddings()
            self._create_rnn_architecture()
            self._create_optimizer_node()
760417
function(model, options) {
            var item, tag;

            // Define options
            options = _.defaults(options || {}, {
                silent: false,
                render: true,
                at: _.size(this.items),
            });

            if (this.items[model.id] != null) {
                this.removeModel(model);
            }

            item = new this.Item({
                "model": model,
                "list": this,
                "collection": this.collection
            }, this);
            this.listenTo(model, "set", function() {
                item.update();
                this.applyFilter(item);
            });
            this.listenTo(model, "id", function(newId, oldId) {
                this.items[newId] = this.items[oldId];
                delete this.items[oldId];
            });

            item.update();
            tag = this.Item.prototype.tagName;
            if (this.Item.prototype.className) tag = tag+"."+this.Item.prototype.className.split(" ")[0];

            if (options.at > 0) {
                this.$("> "+tag).eq(options.at-1).after(item.$el);
            } else {
                this.$el.prepend(item.$el);
            }
            this.items[model.id] = item;

            this.applyFilter(item);

            if (!options.silent) this.trigger("add", model);
            if (options.render) this.update();

            return this;
        }
690558
function createModelObject() {
  var key, method,
      self = this,
      generator = this;
  
  /**
    Model Object Class. Generated by the Model.
  
    @private
    @class ModelObject
    @constructor
   */
  
  function ModelObject() {
    this.className = generator.className + 'Object';
  }
  
  /**
    Model Generator
   */

  ModelObject.prototype.generator = this;
  
  var gen = this;
  
  
  /**
    Get Changed Values

    @returns {object} Object with the fields updated
   */
 
  ModelObject.prototype.getUpdatedFields = function() {
    var diff = 0,
        update = {},
        currentState = gen.createCurrentState(this),
        origState = this.__currentState;
    for (var key in currentState) {
      if (currentState[key] !== origState[key]) {
        update[key] = currentState[key];
        diff++;
      }
    }
    return (diff > 0) ? update : null;
  }
  
  /**
    Save model data
  
    Provides [err]
  
    @param {function} callback
   */
  
  ModelObject.prototype.save = function(callback) {
    
    var self = this;
    
    // Emit before_save event
    generator.emit('before_save', self);
    
    // Get updated fields after the before_save event
    var update = this.getUpdatedFields();
    
    // No changes
    if (update == null) { 
      callback.call(self, null); 
      return; 
    }
    
    update.id = this.id;
    
    // Perform driver save.
    // NOTE: data is validated by the model
    generator.save(update, function(err) {
      generator.emit('after_save', err, self);
      callback.call(self, err);
    });
  }
  
  /**
    Alias of `ModelObject::save`
  
    @method update
   */
  
  ModelObject.prototype.update = ModelObject.prototype.save; // alias
  
  /**
    Alias of `ModelObject::save`
   */

  ModelObject.prototype.sync = ModelObject.prototype.save; // alias
  
  /**
    Delete model data
  
    Provides: [err]
  
    @param {function} callback
   */
  
  ModelObject.prototype.delete = function(callback) {
    var self = this;
    var generator = this.generator;
    generator.delete(this.id, function(err) {
      generator.emit('delete', err, self);
      callback.call(self, err);
    });
  }
  
  /**
    Alias of `ModelObject::delete`
   */
  
  ModelObject.prototype.remove = ModelObject.prototype.delete; // alias
  
  /**
    Alias of `ModelObject::delete`
   */
 
  ModelObject.prototype.destroy = ModelObject.prototype.delete; // alias

  /**
    Creates a Multi object
  
    @private
    @param {object} options Multi Configuration
   */
  
  ModelObject.prototype.createMulti = function(options) {
    return new Multi(this, options);
  }
  
  /**
    Provides caching capabilities. Alias of `Driver::queryCached`
   */
 
  ModelObject.prototype.queryCached = function(cdata) {
    var args = slice.call(arguments, 0),
        driver = this.generator.driver;
    cdata.storage = driver.storage;
    driver.queryCached.apply(this, args);
  }
  
  return ModelObject;
  
}
451383
function generate(model, count) {
  count = count || 1;
  var registry = {};
  var models = [];

  if (model) {
    models = typeof model === 'string' ? [model] : model;
  } else {
    models = Object.keys(schemas);
  }

  function build(model) {
    var instance = jsf(schemas[model]);
    var invalid = validate(instance);
    if (invalid) {
      var errors = JSON.stringify(invalid, null, 2);
      throw new Error('Invalid "' + model + '" instance:\n' + errors);
    }
    return instance;
  }

  function factory(model) {
    var instances = [];
    for (var i = 0, len = count; i < len; i++) {
      var instance = build(model);
      instances.push(instance);
    }
    registry[model] = instances;
  }

  models.forEach(factory);
  return registry;
}
716783
function(mongoModel) {
  var mongoModelObject = {};
  mongoModel.forEach(function(f) {
    mongoModelObject[f.displayName] = f;
  });
  return mongoModelObject;
}
1058960
function (model) {
            this._super(arguments);
            var ctiKey = this.__ctiKey = model.__ctiKey;
            this.__ctiTables = model.__ctiTables.slice();
            this.__ctiModels = model.__ctiModels.slice();
            this.__ctiModels.push(this);
            this.__ctiTables.push(this.tableName);
            this.__ctiColumns = comb.merge({}, model.__ctiColumns);
            this.__ctiColumns[this.tableName] = this.columns;
            this.__ctiBaseModel = model.__ctiBaseModel;
            //copy over our schema
            var newSchema = comb.merge({}, this.__schema);
            var schemas = model.__ctiModels.map(
                function (m) {
                    return m.schema;
                }).reverse();
            schemas.forEach(function (s) {
                for (var i in s) {
                    newSchema[i] = s[i];
                }
            }, this);
            this._setSchema(newSchema);
            this._setDataset(model.dataset.join(this.tableName, this.primaryKey));
            this._setPrimaryKey(this.__ctiBaseModel.primaryKey);
            this.pre("save", function (next) {
                if (ctiKey) {
                    this[ctiKey] = this.tableName.toString();
                }
                next();
            });
        }
157227
protected NavigationPanel<WizardModelStateMachine<T>> newNavigationPanel(
		Model<WizardModelStateMachine<T>> model)
	{
		final NavigationPanel<WizardModelStateMachine<T>> navigationPanel = new NavigationPanel<WizardModelStateMachine<T>>()
		{

			/** The Constant serialVersionUID. */
			private static final long serialVersionUID = 1L;

			/**
			 * {@inheritDoc}
			 */
			@Override
			protected void onCancel()
			{
				AbstractWizardPanel.this.onCancel();
			}

			/**
			 * {@inheritDoc}
			 */
			@Override
			protected void onFinish()
			{
				AbstractWizardPanel.this.onFinish();
			}

			/**
			 * {@inheritDoc}
			 */
			@Override
			protected void onNext()
			{
				AbstractWizardPanel.this.onNext();
			}

			/**
			 * {@inheritDoc}
			 */
			@Override
			protected void onPrevious()
			{
				AbstractWizardPanel.this.onPrevious();
			}
		};
		return navigationPanel;
	}
540951
function(data) {
      var that = this;
      var model = new Tabletop.Model( { data: data, 
                                        parseNumbers: this.parseNumbers,
                                        postProcess: this.postProcess,
                                        tabletop: this,
                                        prettyColumnNames: this.prettyColumnNames,
                                        onReady: function() {
                                          that.sheetReady(this);
                                        } } );
    }
1189909
function constructor(models, options) {
      if (!Array.isArray(models)) {
        options = models;
        models = [];
      }

      options = options || {};

      //
      // Set the database name if it was provided in the options.
      //
      if (options.url) this.url = options.url;
      if (options.database) this.database = options.database;

      //
      // Define restricted non-enumerated properties.
      //
      predefine(this, fossa);

      //
      // Call original Backbone Model constructor.
      //
      backbone.Collection.call(this, models, options);
    }