Convert data-options attribute into an object of key/value pairs Private method Returns an {object}
771773
function ( options ) {

		if ( options === null || options === undefined  ) {
			return {};
		} else {
			var settings = {}; // Create settings object
			options = options.split(';'); // Split into array of options

			// Create a key/value pair for each setting
			options.forEach( function(option) {
				option = option.trim();
				if ( option !== '' ) {
					option = option.split(':');
					settings[option[0]] = option[1].trim();
				}
			});

			return settings;
		}

	}
243927
function(options) {
      return {

        /**
         * Check whether an attribute or a set of attributes are valid. It will default to use the model's current values but
         * you can pass in different values to use in the validation process instead.
         * @param attr {String or Object or Array} Either the name of the attribute, an array containing many attribute names, or
         * on object with attribute name to values
         * @param [value] {Any} a value to use for the attribute value instead of using the model's value.
         * @return undefined if no errors, a validation exception if a single attribute, or an object with attribute name as key
         * and the error as the value
         * @method preValidate
         */
        preValidate: function(attr, value) {
          var self = this,
              result = {},
              error;
          if (_.isArray(attr)) {
            _.each(attr, function(attr) {
              error = self.preValidate(attr);
              if (error) {
                result[attr] = error;
              }
            });
            return _.isEmpty(result) ? undefined : result;
          } else if (_.isObject(attr)) {
            _.each(attr, function(value, key) {
              error = self.preValidate(key, value);
              if (error) {
                result[key] = error;
              }
            });
            return _.isEmpty(result) ? undefined : result;
          } else {
            if (_.isUndefined(value) && isNestedModel(this)) {
              value = this.get(attr);
            }
            return validateAttr(this, value, attr);
          }
        },

        // Check to see if an attribute, an array of attributes or the
        // entire model is valid. Passing true will force a validation
        // of the model.
        isValid: function(option) {
          var flattened, attrs, error, invalidAttrs;

          option = option || getOptionsAttrs(options);

          if(_.isString(option)){
            attrs = [option];
          } else if(_.isArray(option)) {
            attrs = option;
          }
          if (attrs) {
            // Loop through all attributes
            _.each(attrs, function (attr) {
              var value;
              if (isNestedModel(this)) {
                value = this.get(attr);
              } else {
                value = flatten(this.attributes)[attr];
              }
              error = validateAttr(this, value, attr);
              if (error) {
                invalidAttrs = invalidAttrs || {};
                invalidAttrs[attr] = error;
              }
            }, this);
          }

          if (option === true) {
            invalidAttrs = this.validate();
          }
          if (invalidAttrs) {
            this.trigger('invalid', this, invalidAttrs, {validationError: invalidAttrs});
          }
          return attrs ? !invalidAttrs : this.validation ? this._isValid : true;
        },

        // This is called by Backbone when it needs to perform validation.
        // You can call it manually without any parameters to validate the
        // entire model.
        validate: function(attrs, setOptions){
          var model = this;
          var opt = _.extend({}, options, setOptions);
          var validatedAttrs = getValidatedAttrs(model, getOptionsAttrs(options));
          var allAttrs = _.extend({}, validatedAttrs, model.attributes, attrs);
          var flattened = _.extend(flatten(allAttrs), attrs); // allow people to pass in nested attributes
          var changedAttrs = attrs ? flatten(attrs) : flattened;
          var result = validateModel(model, allAttrs, _.pick(flattened, _.keys(validatedAttrs)));
          model._isValid = result.isValid;

          // Trigger validated events.
          // Need to defer this so the model is actually updated before
          // the event is triggered.
          _.defer(function() {
            model.trigger('validated', model._isValid, model, result.invalidAttrs);
            model.trigger('validated:' + (model._isValid ? 'valid' : 'invalid'), model, result.invalidAttrs);
          });

          // Return any error messages to Backbone, unless the forceUpdate flag is set.
          // Then we do not return anything and fools Backbone to believe the validation was
          // a success. That way Backbone will update the model regardless.
          if (!opt.forceUpdate && _.intersection(_.keys(result.invalidAttrs), _.keys(changedAttrs)).length > 0) {
            return result.invalidAttrs;
          }
        }
      };
    }
138522
function convertPropertyKeyToDataAttributeKey(propertyKey) {
    if (propertyKey.substr(0, 1) === "_") {
        propertyKey = propertyKey.substr(1);
    }
    if (propertyKey.substr(0, 4) !== "data") {
        throw new Error(propertyKey + "\" has an invalid format please use @data dataSomeProp (data-some-prop) for valid bindings.");
    }
    return propertyKey.replace(/([a-zA-Z])(?=[A-Z])/g, "$1-").toLowerCase();
}
86193
function __serializeArray(data, options=DEFAULT_OPTIONS) {
	let dataBuffers = [];
	// ignore undefined value
	for (let key in data) {
		let subData = data[key];
		let subType = __getType(subData, options);
		let subTypeBuffer = __serializeType(subType);
		let subDataBuffers = __serializeData(subType, subData, options);
		dataBuffers.push(subTypeBuffer, ...subDataBuffers);
	}
	let length = __getLengthByArrayBuffers(dataBuffers);
	let lengthData = new Uint32Array([length]);
	return [lengthData.buffer, ...dataBuffers];
}
642872
function (items, options) {

            debug('Extracting keys...');

            let pairs = items.map(item => {

                if (typeof item === typeof '') {

                    // split items on equality character (default is: '=')
                    const parts = item.split(options.equality);

                    if (typeof parts[0] === typeof '' && parts[0].length > 0) {

                        if (parts.length === 1) {

                            debug('No value provided. Using boolean as existence');

                            parts.push('true'); // set existence to true
                        }

                        const output = {
                            key: parts[0],
                            value: options.decodeURIComponent(parts[1])
                        };

                        debug('Key/Value pair: %o', output);

                        return output;

                    } else {

                        debug('Key cannot be empty');
                    }

                } else {

                    debug('item must be a valid string');
                }

                return undefined;
            });

            debug('Removing null and undefined values...');

            // remove undefined/null/empty string keys
            pairs = _.without(pairs, null, undefined);

            debug('Pairs: %o', pairs);

            return pairs;
        }
883134
function(fieldData) {
    const { type, values, name } = fieldData
    let fieldValues
    const optionActions = [m('a', mi18n.get('addOption'), { className: 'add add-opt' })]
    const fieldOptions = [m('label', mi18n.get('selectOptions'), { className: 'false-label' })]
    const isMultiple = fieldData.multiple || type === 'checkbox-group'
    const optionDataTemplate = label => {
      const optionData = {
        label,
        value: hyphenCase(label),
      }

      if (type !== 'autocomplete') {
        optionData.selected = false
      }

      return optionData
    }

    if (!values || !values.length) {
      let defaultOptCount = [1, 2, 3]
      if (['checkbox-group', 'checkbox'].includes(type)) {
        defaultOptCount = [1]
      }
      fieldValues = defaultOptCount.map(index => optionDataTemplate(`${mi18n.get('optionCount', index)}`))

      const firstOption = fieldValues[0]
      if (firstOption.hasOwnProperty('selected') && type !== 'radio-group') {
        firstOption.selected = true
      }
    } else {
      // ensure option data is has all required keys
      fieldValues = values.map(option => Object.assign({}, { selected: false }, option))
    }

    const optionActionsWrap = m('div', optionActions, { className: 'option-actions' })
    const options = m('ol', fieldValues.map(option => selectFieldOptions(name, option, isMultiple)), {
      className: 'sortable-options',
    })
    const optionsWrap = m('div', [options, optionActionsWrap], { className: 'sortable-options-wrap' })

    fieldOptions.push(optionsWrap)

    return m('div', fieldOptions, { className: 'form-group field-options' }).outerHTML
  }
1253602
function ( data ) {
	    	if ( !data ) return data;
	    	if ( typeof data !== 'object' ) return data;
	    	if ( 'entrySet' in data && typeof data.entrySet === 'function' ) {
	    		//var allowed_long_keys = ['utc_timestamp', 'duration', 'type', 'token'];
	    		var set = data.entrySet();
	    		if ( !set ) return data;
	    		var obj = {};
	    		var iter = set.iterator();
	    		while ( iter.hasNext() ) {
					var entry = iter.next();
					var val = entry.getValue();
					if ( val && typeof val === 'object' && 
						 'entrySet' in val && 
						 typeof val.entrySet === 'function' ) val = convertData(val);
					var key = entry.getKey();
					if ( !key ) {
						throw( "Field key is not valid: " + key );
					}
					obj[entry.getKey()] = val;
				}
				return obj;
	    	} else {
	    		if ( 'utc_timestamp' in data ) data.utc_timestamp = jsDateToTs(data.utc_timestamp);
	    		if ( 'created_at' in data )    data.created_at 	  = jsDateToTs(data.created_at);
	    	}
	    	return data;
	    }
403774
function( option, value ) {
            var curr = this.data( dataName ).options || {},
                prev = $.extend( {}, curr );

            if ( typeof option === "string" && option[ 0 ] !== "_" ) {
                if ( value === undefined ) {
                    return curr[ option ];
                } else {
                    curr[ option ] = value;
                    updateOptions( this, prev, curr );

                    return this;
                }
            } else if ( $.isPlainObject( option ) ) {
                $.extend( curr, option );
                updateOptions( this, prev, curr );

                this.data( dataName ).options = curr;
            }

            return curr;
        }
1023914
function __serializeObjectStreaming(data, options=DEFAULT_OPTIONS) {
	let dataBuffers = [];
	let allKeys = (options.sort_key === true) ? Object.keys(data).sort() : Object.keys(data);
	// ignore undefined value
	for (let key of allKeys) {
		let subData = data[key];
		if (subData === undefined) continue;

		let subType = __getType(subData, options);
		let subTypeBuffer = __serializeType(subType);
		let keyBuffers = __serializeShortString(key);
		let subDataBuffers = __serializeData(subType, subData, options);
		dataBuffers.push(subTypeBuffer, ...keyBuffers, ...subDataBuffers);
	}
	return [...dataBuffers, TYPE_HEADER.OBJECT_END];
}
1305499
def get_deep_attr(obj, keys):
    
    cur = obj
    for k in keys:
        if isinstance(cur, Mapping) and k in cur:
            cur = cur[k]
            continue
        else:
            try:
                cur = getattr(cur, k)
                continue
            except AttributeError:
                pass
        raise DataError(error='Unexistent key')
    return cur
1270087
function attrsToString(attrs) {
  return Object.keys(attrs)
    .map(key => `${key}="${attrs[key]}"`)
    .join(' ');
}
332714
function convertObject (schema, self) {
  var keys = Object.keys(schema);
  var ret = {};

  for (var i = 0; i < keys.length; ++i) {
    var key = keys[i];
    ret[key] = convertElement(schema[key], self);
  }

  return ret;
}
1044478
function keyOptions (key, options) {
  const _key = options._key == null
    ? key
    : options._key + '.' + key
  return Object.assign({}, options, { _key: _key })
}
790914
function _objectToRDF(item) {
  var object = {};

  // convert value object to RDF
  if(_isValue(item)) {
    object.type = 'literal';
    var value = item['@value'];
    var datatype = item['@type'] || null;

    // convert to XSD datatypes as appropriate
    if(_isBoolean(value)) {
      object.value = value.toString();
      object.datatype = datatype || XSD_BOOLEAN;
    }
    else if(_isDouble(value) || datatype === XSD_DOUBLE) {
      // canonical double representation
      object.value = value.toExponential(15).replace(/(\d)0*e\+?/, '$1E');
      object.datatype = datatype || XSD_DOUBLE;
    }
    else if(_isNumber(value)) {
      object.value = value.toFixed(0);
      object.datatype = datatype || XSD_INTEGER;
    }
    else if('@language' in item) {
      object.value = value;
      object.datatype = datatype || RDF_LANGSTRING;
      object.language = item['@language'];
    }
    else {
      object.value = value;
      object.datatype = datatype || XSD_STRING;
    }
  }
  // convert string/node object to RDF
  else {
    var id = _isObject(item) ? item['@id'] : item;
    object.type = (id.indexOf('_:') === 0) ? 'blank node' : 'IRI';
    object.value = id;
  }

  return object;
}
717116
function readParameters(obj, scope) {
    var result = {},
      attrs = obj.$attr,
      option, value;

    for (var key in attrs) {
      option = lcfirst(key.substr(attrName.length));
      value = obj[key];
      // Check if the given key is a valid string type, not empty and starts with the attribute name
      if ((option.length > 0) && (key.substring(0, attrName.length) === attrName)) {
        result[option] = value;
        if (typeof scope[value] === 'function') {
          result[option] = scope[value];
        }
      }
    }

    return result;
  }
1018583
function formatsToJSON(attrs, options) {
        var defaultFormats = ['html'],
            formatsToKeep = options.formats || defaultFormats;

        // Iterate over all known formats, and if they are not in the keep list, remove them
        _.each(Post.allowedFormats, function (format) {
            if (formatsToKeep.indexOf(format) === -1) {
                delete attrs[format];
            }
        });

        return attrs;
    }
833335
function toValueFromAttributeValue(attributeValue) {
  if (!attributeValue || typeof attributeValue !== 'object') {
    return attributeValue;
  }
  const values = Object.getOwnPropertyNames(attributeValue).map(type => {
    return toValueFromAttributeTypeAndValue(type, attributeValue[type])
  });
  if (values.length !== 1) {
    throw new Error(`Found ${values.length} values on DynamoDB AttributeValue (${stringify(attributeValue)}), but expected only one!`);
  }
  return values[0];
}