Using 'new' on this function creates a new instance of a table.
@param {name} input any string as the name of the table.
@param {options} options.
547610
function(tableName, options = {}) {
  
    // Set Name
    if (typeof tableName !== 'string') throw new TypeError('Table name has to be a string. Need Help? Check out: discord.gg/plexidev');
    else if (tableName.includes(' ')) throw new TypeError('Table name cannot include spaces. Need Help? Check out: discord.gg/plexidev');
    this.tableName = tableName;
    
    // Methods
    this.fetch = function(key, ops) {
      if (!key) throw new TypeError('No key specified. Need Help? Check Out: discord.gg/plexidev');
      return arbitrate('fetch', {id: key, ops: ops || {}}, this.tableName);
    }
    
    this.get = function(key, ops) {
      if (!key) throw new TypeError('No key specified. Need Help? Check Out: discord.gg/plexidev');
      return arbitrate('fetch', {id: key, ops: ops || {}}, this.tableName);
    }
    
    this.set = function(key, value, ops) {
      if (!key) throw new TypeError('No key specified. Need Help? Check Out: discord.gg/plexidev');
      if (!value && value != 0) throw new TypeError('No value specified. Need Help? Check Out: discord.gg/plexidev');
      return arbitrate('set', {stringify: true, id: key, data: value, ops: ops || {}}, this.tableName);
    }
    
    this.add = function(key, value, ops) {
      if (!key) throw new TypeError('No key specified. Need Help? Check Out: discord.gg/plexidev');
      if (isNaN(value)) throw new TypeError('Must specify value to add. Need Help? Check Out: discord.gg/plexidev');
      return arbitrate('add', {id: key, data: value, ops: ops || {}}, this.tableName);
    }
    
    this.subtract = function(key, value, ops) {
      if (!key) throw new TypeError('No key specified. Need Help? Check Out: discord.gg/plexidev');
      if (isNaN(value)) throw new TypeError('Must specify value to add. Need Help? Check Out: discord.gg/plexidev');
      return arbitrate('subtract', {id: key, data: value, ops: ops || {}}, this.tableName);
    }
    
    this.push = function(key, value, ops) {
      if (!key) throw new TypeError('No key specified. Need Help? Check Out: discord.gg/plexidev');
      if (!value && value != 0) throw new TypeError('Must specify value to push. Need Help? Check Out: discord.gg/plexidev');
      return arbitrate('push', {stringify: true, id: key, data: value, ops: ops || {}}, this.tableName);
    }
    
    this.delete = function(key, ops) {
      if (!key) throw new TypeError('No key specified. Need Help? Check Out: discord.gg/plexidev');
      return arbitrate('delete', {id: key, ops: ops || {}}, this.tableName);
    }
    
    this.has = function(key, ops) {
      if (!key) throw new TypeError('No key specified. Need Help? Check Out: discord.gg/plexidev');
      return arbitrate('has', {id: key,  ops: ops || {}}, this.tableName);
    }
    
    this.includes = function(key, ops) {
      if (!key) throw new TypeError('No key specified. Need Help? Check Out: discord.gg/plexidev');
      return arbitrate('has', {id: key,  ops: ops || {}}, this.tableName);
    }
    
    this.fetchAll = function(ops) { 
      return arbitrate('all', {ops: ops || {}}, this.tableName);
    }
    
    this.all = function(ops) { 
      return arbitrate('all', {ops: ops || {}}, this.tableName);
    }
    
  }
622620
function Table(name, db, options) {
  this.name = name;
  this.db = db; // the name of the database
  this.options = options || {};
  this.options.primaryKey = this.options.primary_key || "id";
  this.documents = {};
  this.indexes = {}; // String -> FUNC terms
  this.indexes[this.options.primaryKey] = {
    //TODO Make me use TERMS
    //fn: function(doc) { return doc[name] },
    // 69=FUNC, 2=MAKE_ARRAY, 31=GET_FIELD, 10=VAR, 1=ARGUMENT_INDEX
    //TODO Use a uuid to avoid collision
    fn: [ 69, [ [ 2, [ 1 ] ], [ 31, [ [ 10, [ 1 ] ], this.options.primaryKey ] ] ] ],
    function: { /* TODO */ },
    geo: false,
    outdated: false,
    ready: true,
    multi: false
  };
  this.id = util.uuid();
  if (options.meta === true) {
    // meta table
    this.meta = true;
  }
}
902866
function createStrings(input) {
  return new Promise((resolve, reject) => {
    try {
      if (!input) {
        return resolve(null);
      }

      const importsString = input.imports.length ? `${input.imports.join('\n')}\n\n` : '';
      const exportsString = input.exports.length ? `${input.exports.join('\n')}\n` : '';
      const indexString = `${importsString}${exportsString}`.replace('\n\n\n', '\n\n');

      return resolve(indexString.length ? indexString : null);
    } catch (e) {
      return reject(new Error(t('STRINGS_COULD_NOT_BE_CREATED')));
    }
  });
}
143856
function (options)
        {
            var self = this;

            self.options = $.extend({}, defaultOptions, options);
            // When itemValue is set, freeInput should always be false

            if (self.objectItems)
            {
                if (self.options.freeInput === true)
                {
                    self.options.freeInput = true;
                }
                else{
                    self.options.freeInput = false
                }
            }

            makeOptionItemFunction(self.options, 'itemValue');
            makeOptionItemFunction(self.options, 'itemText');
            makeOptionFunction(self.options, 'tagClass');

            // Typeahead.js
            if (self.options.typeaheadjs)
            {
                var typeaheadConfig   = null;
                var typeaheadDatasets = {};

                // Determine if main configurations were passed or simply a dataset
                var typeaheadjs = self.options.typeaheadjs;
                if ($.isArray(typeaheadjs))
                {
                    typeaheadConfig   = typeaheadjs[0];
                    typeaheadDatasets = typeaheadjs[1];
                }
                else
                {
                    typeaheadDatasets = typeaheadjs;
                }

                self.$input.typeahead(typeaheadConfig, typeaheadDatasets).on('typeahead:selected', $.proxy(function (obj, datum)
                {
                    if (typeaheadDatasets.valueKey)
                    {
                        self.add(datum[typeaheadDatasets.valueKey]);
                    }
                    else
                    {
                        self.add(datum);
                    }
                    self.$input.typeahead('val', '');
                }, self));
            }

            self.$container.on('click', $.proxy(function (event)
            {
                if (!self.$element.attr('disabled'))
                {
                    self.$input.removeAttr('disabled');
                }
                self.$input.focus();
            }, self));

            if (self.options.addOnBlur && self.options.freeInput)
            {
                self.$input.on('focusout', $.proxy(function (event)
                {
                    self.add(self.$input.val());
                    self.$input.val('');

                }, self));
            }

            self.$container.on('keydown', 'input', $.proxy(function (event)
            {
                var $input        = $(event.target),
                    $inputWrapper = self.findInputWrapper();

                if (self.$element.attr('disabled'))
                {
                    self.$input.attr('disabled', 'disabled');
                    return;
                }

                switch (event.which)
                {
                    // BACKSPACE
                    case 8:
                        if (self.options.deleteTagsOnBackspace && doGetCaretPosition($input[0]) === 0)
                        {
                            var prev = $inputWrapper.prev();
                            if (prev)
                            {
                                self.remove(prev.data('item'));
                            }
                        }
                        break;

                    // DELETE
                    case 46:
                        if (self.options.deleteTagsOnDeleteKey && doGetCaretPosition($input[0]) === 0)
                        {
                            var next = $inputWrapper.next();
                            if (next)
                            {
                                self.remove(next.data('item'));
                            }
                        }
                        break;

                    // LEFT ARROW
                    case 37:
                        // Try to move the input before the previous tag
                        var $prevTag = $inputWrapper.prev();
                        if (self.options.MoveTagOnLeftArrow && $input.val().length === 0 && $prevTag[0])
                        {
                            $prevTag.before($inputWrapper);
                            $input.focus();
                        }
                        break;
                    // RIGHT ARROW
                    case 39:
                        // Try to move the input after the next tag
                        var $nextTag = $inputWrapper.next();
                        if (self.options.MoveTagOnRightArrow && $input.val().length === 0 && $nextTag[0])
                        {
                            $nextTag.after($inputWrapper);
                            $input.focus();
                        }
                        break;
                    default:
                    // ignore
                }

                // Reset internal input's size
                var textLength = $input.val().length,
                    wordSpace  = Math.ceil(textLength / 5),
                    size       = textLength + wordSpace + 1;
                $input.attr('size', Math.max(this.inputSize, $input.val().length));
            }, self));

            self.$container.on('keydown', 'input', $.proxy(function (event)
            {
                var $input = $(event.target);

                if (self.$element.attr('disabled'))
                {
                    self.$input.attr('disabled', 'disabled');
                    return;
                }

                var text             = $input.val(),
                    maxLengthReached = self.options.maxChars && text.length >= self.options.maxChars;

                // If not text is entered and tab event is fired shouldn't prevent the default behavior
                if (self.options.allowTabOnEmpty && isEmpty(text) && event.which === tabKey) 
                {
                    return;
                }

                if (self.options.freeInput && (keyCombinationInList(event, self.options.confirmKeys) || maxLengthReached))
                {
                    self.add(maxLengthReached ? text.substr(0, self.options.maxChars) : text);
                    $input.val('');
                    (self.$input.typeahead) && self.$input.typeahead("val","");
                    event.preventDefault();
                }

                // Reset internal input's size
                var textLength = $input.val().length,
                    wordSpace  = Math.ceil(textLength / 5),
                    size      = textLength + wordSpace + 1;
                $input.attr('size', Math.max(this.inputSize, $input.val().length));
            }, self));

            // Remove icon clicked
            self.$container.on('click', '[data-role=remove]', $.proxy(function (event)
            {
                if (self.$element.attr('disabled'))
                {
                    return;
                }
                self.remove($(event.target).closest('.chip').data('item'));
            }, self));

            // Only add existing value as tags when using strings as tags
            if (self.options.itemValue === defaultOptions.itemValue)
            {
                if (self.$element[0].tagName === 'INPUT')
                {
                    self.add(self.$element.val());
                }
            }
        }
341445
function Table(options, data) {
        options = options || {};

        // Updates indexes on the fly.
        if (!options.update) options.update = {};

        if ('undefined' === typeof options.update.indexes) {
            options.update.indexes = true;
        }

        NDDB.call(this, options, data);

//         // ### Table.row
//         // NDDB hash containing elements grouped by row index
//         // @see NDDB.hash
//         if (!this.row) {
//             this.hash('row', function(c) {
//                 return c.x;
//             });
//         }
//
//         // ### Table.col
//         // NDDB hash containing elements grouped by column index
//         // @see NDDB.hash
//         if (!this.col) {
//             this.hash('col', function(c) {
//                 return c.y;
//             });
//         }

        // ### Table.rowcol
        // NDDB index to access elements with row.col notation
        // @see NDDB.hash
        if (!this.rowcol) {
            this.index('rowcol', function(c) {
                return c.x + '.' + c.y;
            });
        }

        /**
         * ### Table.pointers
         *
         * References to last inserted cell coordinates
         */
        this.pointers = {
            x: options.pointerX || null,
            y: options.pointerY || null
        };

        /**
         * ### Table.header
         *
         * Array containing the header elements of the table
         */
        this.header = [];

        /**
         * ### Table.footer
         *
         * Array containing the footer elements of the table
         */
        this.footer = [];

        /**
         * ### Table.left
         *
         * Array containing elements to keep on the left border of the table
         */
        this.left = [];

        /**
         * ### Table.table
         *
         * Reference to the HTMLElement Table
         */
        this.table = options.table || document.createElement('table');

        if ('string' === typeof options.id) {
            this.table.id = options.id;
        }
        else if (options.id) {
            throw new TypeError('Table constructor: options.id must be ' +
                                'string or undefined.');
        }

        if ('string' === typeof options.className) {
            this.table.className = options.className;
        }
        else if (J.isArray(options.className)) {
            this.table.className = options.className.join(' ');
        }
        else if (options.className) {
            throw new TypeError('Table constructor: options.className must ' +
                                'be string, array, or undefined.');
        }

        /**
         * ### Table.missingClassName
         *
         * Class name for "missing" cells
         *
         * "Missing" cells are cells that are added automatically to complete
         * the table because one or more cells have been added with higher
         * row and column indexes.
         */
        this.missingClassName = 'missing';

        if ('string' === typeof options.missingClassName) {
            this.missingClassName = options.missingClassName;
        }
        else if (J.isArray(options.missingClassName)) {
            this.missingClassName = options.missingClassName.join(' ');
        }
        else if (options.missingClassName) {
            throw new TypeError('Table constructor: options.className must ' +
                                'be string, array, or undefined.');
        }

        /**
         * ### Table.autoParse
         *
         * If TRUE, whenever a new cell is added the table is updated.
         * Default: FALSE
         */
        this.autoParse = 'undefined' !== typeof options.autoParse ?
            options.autoParse : false;

        /**
         * ### Table.trs
         *
         * List of TR elements indexed by their order in the parsed table
         */
        this.trs = {};

        /**
         * ### Table.trCb
         *
         * Callback function applied to each TR HTML element
         *
         * Callback receives the HTML element, and the row index, or
         * 'thead' and 'tfoot' for header and footer.
         */
        if ('function' === typeof options.tr) {
            this.trCb = options.tr;
        }
        else if ('undefined' === typeof options.tr) {
            this.trCb = null;
        }
        else {
            throw new TypeError('Table constructor: options.tr must be ' +
                                'function or undefined.');
        }

        // Init renderer.
        this.initRenderer(options.render);
    }
950273
@Override
    public Object map(Object input) {
        String str = input.toString();
        if (exceptions.contains(str)) {
            return str;
        } else {
            return newValue;
        }
    }
36553
function(tableName, options, constraints, callback) {
    if (typeof constraints == 'function') {
      var callback = constraints;
      var constraints = {};
    }
    var self = this;
    var cql = [];
    var metaData = [];

    var columns = Object.keys(options);

    cql.push(util.format('CREATE TABLE IF NOT EXISTS %s', tableName));
    cql.push('(');
    columns.forEach(function(column) {
      metaData.push(column + ' ' + options[column]);
    });
    var primaryKey = constraints['primary_key'];
    if (!/^\(.*\)$/.test(primaryKey)) {
      primaryKey = '(' + primaryKey + ')';
    }
    metaData.push('PRIMARY KEY ' + primaryKey);
    cql.push(metaData.join(', '));
    cql.push(')');
    if (constraints.compression) {
      cql.push('WITH compression =');
      cql.push(constraints.compression);
    }
    var cqlString = cql.join(' ');
    return this.runSql(cqlString, callback).nodeify(callback);
  }
1094293
function init(options) {
    if (options === void 0) { options = {}; }
    if ('debug' in options) {
        diag.debug.enabled = options.debug;
        Q.longStackSupport = options.debug;
    }
    if ('serverUrl' in options) {
        var myURL = url.parse(options.serverUrl);
        if (!myURL.protocol && !myURL.host) {
            return Q.reject(new Error(options.serverUrl + " is not an accepted Url, please add a Host and a Protocol."));
        }
    }
    _.assignWith(exports.initOptions, cloneServerInitOptions(options), function (left, right) { return _.isUndefined(right) ? left : right; });
    if ('push' in options) {
        exports.initOptions.push = _.cloneDeep(options.push);
    }
    return device.ready;
}
1094999
function(name, schema, callback){
    var self = this;
    this.db.serialize(function() {
      self.db.run("CREATE TABLE IF NOT EXISTS\"" + name + "\" " + schema, callback);
    });
  }
265218
function(input) {
		var evt;

		if (typeof Event === 'function') {
			evt = new Event('input', {
				bubbles: true
			});
		} else {
			evt = dcmnt.createEvent('Event');
			evt.initEvent('input', true, false);
		}

		input.dispatchEvent(evt);
	}
566626
def td(name, options = {}, &block)
      column_class = options.delete(:using) || Column
      @columns << column_class.new(name, options, &block)
    end
714306
function(options) {
    var self = this
    options = options || {}

    if (typeof options === 'function') throw new Error('then!')
    return self
      .validate()
      .then(function() {
        return self._create_or_update(options)
      })
      .then(function() {
        // eliminate changes -> we just saved it to the database!
        self.changes = {}
      })
      .then(function() {
        return self
      })
  }
1373986
@Override
    public Object map(Object input) {
        if (condition.condition(input))
            return newValue;
        return input;

    }
87461
function(options){
      var name = options.name
        , model = options.model
        , implementation = options.implementation
        , cid = options.cid;

      // save the new things by internal cid
      this._names[cid] = name;
      this._models[cid] = model;
      this._implementations[cid] = implementation;

      this._updateLength();

      return this;
    }
1217031
def create_table(table_name, options = {})
      table_definition = TableDefinition.new
      table_definition.define_primary_keys(options[:primary_keys]) if options[:primary_keys]
      table_definition.define_partition_keys(options[:partition_keys]) if options[:partition_keys]
      table_definition.define_options(options[:options]) if options[:options]

      yield table_definition if block_given?

      announce_operation "create_table(#{table_name})"

      create_cql =  "CREATE TABLE #{table_name} ("
      create_cql << table_definition.to_create_cql
      create_cql << ")"
      create_cql << table_definition.options

      announce_suboperation create_cql

      execute create_cql
    end
358085
function initModelNew (args) {
    var controller = this
    var model = this.model
    // if model/controller does not have form then cannot create new controller
    if (!this.form) {
        return
    }
    // create path if it does not exist
    if (!this.paths['/new']) {
        this.paths['/new'] = {}
    }
    // get accountId column
    var accountIdColumn = model.columnName('accountId') 
    // set role to authenticated if model requires account id
    var role = args.defaultRole || (accountIdColumn && model.columns[accountIdColumn].null === false ? 'authenticated' : 'all')
    // form inputs
    var input = {
        redirect: 'query.redirect',
    }
    // input may include pre-filled form values
    input[model.name] = 'query.'+model.name
    // add handler for GET /new
    this.paths['/new'].get = [
        {
            before: function (args) {
                return newInstance(controller, args)
            },
            input: input,
            method: function (args) {
                return {form: args.form}
            },
            methodName: 'new',
            role: role,
            template: 'instance',
        },
    ]
}
995568
function Parameter(options)
{
  // validate input
  Errors.assertInternal(Util.isObject(options));
  Errors.assertInternal(Util.isString(options.name));
  Errors.assertInternal(Util.exists(options.value));

  var name = options.name;
  var value = options.value;

  /**
   * Returns the name of the parameter.
   *
   * @returns {String}
   */
  this.getName = function ()
  {
    return name;
  };

  /**
   * Returns the value of the parameter.
   *
   * @returns {*}
   */
  this.getValue = function ()
  {
    return value;
  };

  /**
   * Updates the value of the parameter.
   *
   * @param {*} targetValue
   */
  this.setValue = function (targetValue)
  {
    value = targetValue;
  };
}