converts attributes hash to scope-specific event function
@memberof Attr2MapOptions
@param {scope} scope angularjs scope
@param {Hash} attrs tag attributes
@returns {Hash} events converted events
338081
function(scope, attrs) {
      var events = {};
      var toLowercaseFunc = function($1){
        return "_"+$1.toLowerCase();
      };
      var EventFunc = function(attrValue) {
        // funcName(argsStr)
        var matches = attrValue.match(/([^\(]+)\(([^\)]*)\)/);
        var funcName = matches[1];
        var argsStr = matches[2].replace(/event[ ,]*/,'');  //remove string 'event'
        var argsExpr = $parse("["+argsStr+"]"); //for perf when triggering event
        return function(event) {
          var args = argsExpr(scope); //get args here to pass updated model values
          function index(obj,i) {return obj[i];}
          var f = funcName.split('.').reduce(index, scope);
          f && f.apply(this, [event].concat(args));
          $timeout( function() {
            scope.$apply();
          });
        };
      };

      for(var key in attrs) {
        if (attrs[key]) {
          if (!key.match(/^on[A-Z]/)) { //skip if not events
            continue;
          }

          //get event name as underscored. i.e. zoom_changed
          var eventName = key.replace(/^on/,'');
          eventName = eventName.charAt(0).toLowerCase() + eventName.slice(1);
          eventName = eventName.replace(/([A-Z])/g, toLowercaseFunc);

          var attrValue = attrs[key];
          events[eventName] = new EventFunc(attrValue);
        }
      }
      return events;
    }
1340733
function(attrs) {
      // Check for changes of magic fields.
      var model = this;
      var specialFields = ["id", "objectId", "createdAt", "updatedAt"];
      Parse._arrayEach(specialFields, function(attr) {
        if (attrs[attr]) {
          if (attr === "objectId") {
            model.id = attrs[attr];
          } else if ((attr === "createdAt" || attr === "updatedAt") &&
                     !_.isDate(attrs[attr])) {
            model[attr] = Parse._parseDate(attrs[attr]);
          } else {
            model[attr] = attrs[attr];
          }
          delete attrs[attr];
        }
      });
    }
623179
function(attrs, callback) {
      var t = this;

      // Value is the only thing to set
      if (typeof attrs.value === 'undefined') {
        return callback({code:'NO_VALUE'});
      }

      // Set the model elements.  These cause change events to fire
      if (t.isModel) {
        t.value.set(attrs.value);
      }
      else {
        // Set the variable directly
        var jsonValue = JSON.stringify(attrs.value);
        t._evaluate(t.key + ' = ' + jsonValue);
        t.set('value', attrs.value);
      }
      return callback();
    }
37775
function(scope, element, attrs, autoCtrl){
      element.bind('mouseenter', function() {
        autoCtrl.preSelect(attrs.val);
        autoCtrl.setIndex(attrs.index);
      });

      element.bind('mouseleave', function() {
        autoCtrl.preSelectOff();
      });
    }
429043
function (events) {
        "use strict";
    
        var loaded = {};
        this.loaded = loaded;
    
        var items = {};
        var keys = [];
        Object.defineProperty(this, 'items', {
            'get': function () {
                return items;
            }
        });
        Object.defineProperty(this, 'keys', {
            'get': function () {
                return keys;
            }
        });
        Object.defineProperty(this, 'length', {
            'get': function () {
                return keys.length;
            }
        });
    
        // List of modules that are multilanguage
        var multilanguage = new Map();
        Object.defineProperty(this, 'multilanguage', {
            'get': function () {
                return multilanguage;
            }
        });
    
        this.get = function (moduleID, extendedID) {
    
            var done = function () {
    
                events.trigger(moduleID + ':done');
                events.trigger('done', moduleID);
    
                loaded[moduleID] = true;
    
            };
    
            var extended;
            if (extendedID) {
                extended = items[extendedID];
                if (!extended) {
                    extended = new Module(moduleID, events);
                    items[extendedID] = extended;
                    keys.push(extendedID);
                }
            }
    
            var module = items[moduleID];
            if (!module) {
                module = new Module(moduleID, events);
                items[moduleID] = module;
                keys.push(moduleID);
            }
    
    
            if (extended) return [module, extended];
            else return [module, done];
    
        };
    
    }
537911
function(attrs, attrsToRemove) {
    _.forEach(attrs, function(val, key) {
      // shouldRemove is either an object or a boolean
      var shouldRemove = attrsToRemove[key];
      if (_.isUndefined(shouldRemove)) {
        return;
      }

      // Support nested object
      if (_.isPlainObject(val) && !_.isArray(val) && _.isPlainObject(shouldRemove)) {
        return this._removeExpandableAttributes(val, shouldRemove);
      }

      // Make sure attribute is an object
      // Strip all nested properties except for `_id`
      if (_.isPlainObject(attrs[key]) && shouldRemove) {
        attrs[key] = _.pick(attrs[key], ['_id']);
      }
    }.bind(this));
  }
299620
function (attr, attrName) {
            if (_.isObject(attr) && !_.isDate(attr) && !_.isBoolean(attr) && !_.isString(attr) && !_.isNumber(attr) && !_.isFunction(attr) && !_.isRegExp(attr) && !_.isArray(attr)) {
                //attr = _removeAttributes();
                for (var aIndex in attr) {
                    attr[aIndex] = _removeAttributes(attr[aIndex], aIndex);
                }
                return attr;
            }
            else {
                if (_.indexOf(allowedAttributes, attrName) != -1) {
                    if (_.isFunction(attr)) {
                        attr = _functionName(attr);
                    }

                    return attr;
                }
                else {
                    return;
                }
            }
        }
1116294
function parseAttributes(attrStr) {
    var reAttributes = /([^=<>\"\'\s]+)\s*(?:=\s*["']?([^"']*)["']?)?/g;
    var result = {};
    var match;

    if (attrStr) {
        while (match = reAttributes.exec(attrStr)) {
            result[match[1]] = match[2] || true;
        }
    }

    return result;
}
523381
function( attributes ) {
		var result = {},
			$element = this;
		$.each(attributes.split(/\s/), function( index, value ) {
			result[value] = $element.attr(value);
			$element.removeAttr(value);
		});
		return result;
	}
11041
function getAttrMap(attrs)
{
	var i;
	var map = {};
	var numAttrs = attrs.length;
	
	for (i=0; i<numAttrs; i++)
	{
		map[ attrs[i].name ] = attrs[i].value;
	}
	
	return map;
}
828823
function(model, value, attr) {
      var indices, validators,
        validations = model.validation ? _.result(model, 'validation') || {} : {};
      // If the validations hash contains an entry for the attr
      if (_.contains(_.keys(validations), attr)) {
        return validateAttrWithOpenArray(model, attr, value, _.extend({}, model.attributes));
      } else {
        indices = extractIndices(attr);
        attr = stripIndices(attr);
        validators = getValidators(model, attr);
        return invokeValidator(validators, model, value, attr, _.extend({}, model.attributes), indices);
      }
    }
996443
function(attr, val) {
      return val === undefined ? (this.length ? this[0].getAttribute(attr) : null) : this.each(function(index, el) {
        el.setAttribute(attr, val);
      });
    }
781192
function (attributes) {
            var self = this;
            var retVal = {};
            var ctxMappings = {};
             _.each(attributes, function (attribute, k) {
                var isCtxMapping = _.isString(attribute) && !attribute.indexOf('$');
                if (isCtxMapping) {
                    ctxMappings[k] = attribute;
                } else {
                    retVal[k] = attribute;
                }

                return isCtxMapping;
            });

            _.each(ctxMappings, function (val, k) {
                self._resolveCtxVal(retVal, val, k);
            });

            return retVal;
        }
1053340
function setScopeValues(scope, attrs) {

        scope.List = [];
        scope.Hide = false;
        
        scope.page = parseInt(scope.page) || 1;
        scope.total = parseInt(scope.total) || 0;
        scope.adjacent = parseInt(scope.adjacent) || 2;

        scope.pgHref = scope.pgHref || '';
        scope.dots = scope.dots || '...';
        
        scope.ulClass = scope.ulClass || 'pagination';
        scope.activeClass = scope.activeClass || 'active';
        scope.disabledClass = scope.disabledClass || 'disabled';

        scope.textFirst = scope.textFirst || '<<';
        scope.textLast = scope.textLast || '>>';
        scope.textNext = scope.textNext || '>';
        scope.textPrev = scope.textPrev || '<';
        
        scope.textFirstClass = scope.textFirstClass || '';
        scope.textLastClass= scope.textLastClass || '';
        scope.textNextClass = scope.textNextClass || '';
        scope.textPrevClass = scope.textPrevClass || '';

        scope.textTitlePage = scope.textTitlePage || 'Page {page}';
        scope.textTitleFirst = scope.textTitleFirst || 'First Page'; 
        scope.textTitleLast = scope.textTitleLast || 'Last Page'; 
        scope.textTitleNext = scope.textTitleNext || 'Next Page'; 
        scope.textTitlePrev = scope.textTitlePrev || 'Previous Page'; 

        scope.hideIfEmpty = evalBoolAttribute(scope, attrs.hideIfEmpty);
        scope.showPrevNext = evalBoolAttribute(scope, attrs.showPrevNext);
        scope.showFirstLast = evalBoolAttribute(scope, attrs.showFirstLast);
        scope.scrollTop = evalBoolAttribute(scope, attrs.scrollTop);
        scope.isDisabled = evalBoolAttribute(scope, attrs.disabled);
    }
704708
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;
          }
        }
533397
function(attrs, options) {
    if (typeof attrs === 'object') {
      for(var k in attrs) {
        this.set(k, attrs[k], options);
      }
    } else {
      var value = options, name = attrs;
      options = arguments[2];
      if (this[name] && this[name] === value) return this;
      this._previous[name] = this[name];
      this[name] = value;
      this.trigger('change');
    }
    return this;
  }
274970
function(attrs, options) {
        var attr, key, val, eve;
        if (attrs === null) return this;

        if (attrs.eClass) {
            attrs = attrs.get('name');
        }

        // Handle attrs is a hash or attrs is
        // property and options the value to be set.
        if (!_.isObject(attrs)) {
            key = attrs;
            (attrs = {})[key] = options;
        }

        var eResource = this.eResource();

        for (attr in attrs) {
            val = attrs[attr];
            if (typeof val !== 'undefined' && this.has(attr)) {
                if (this.isSet(attr)) {
                    this.unset(attr);
                }

                var feature = getEStructuralFeature(this.eClass, attr),
                    isContainment = feature.get('containment');

                var settingContainmentAttribute = (attr === 'containment') && (typeof(val) === 'string') && (this.eClass.values.name === 'EReference');
                if (settingContainmentAttribute) {
                    // Convert string 'true' to boolean true
                    val = (val.toLowerCase() === 'true');
                }

                this.values[attr] = val;

                if (isContainment) {
                  val.eContainingFeature = feature;
                  val.eContainer = this;
                }
                eve = 'change:' + attr;
                this.trigger('change ' + eve, attr);
                if (eResource) eResource.trigger('change', this);
            }
        }

        return this;
    }