attribute inteplation
485765
function(nvalue){
      if(!!nvalue){
        if(alternate) combine.destroy(alternate)
        if(ast.consequent) consequent = self.$compile(ast.consequent, {
          record: true,
          element: options.element ,
          extra:extra
        });
      }else{
        if( consequent ) combine.destroy(consequent)
        if( ast.alternate ) alternate = self.$compile(ast.alternate, {record: true, element: options.element, extra: extra});
      }
    }
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;
}
383029
def fetch_attribute(locale, name)
      translation = record.translation_for(locale)
      return translation && translation.send(name)
    end
1168908
def transpose(attrs, inputs, proto_obj):
    """"""
    new_attrs = translation_utils._fix_attribute_names(attrs,
                                                       {'perm' : 'axes'})
    return 'transpose', new_attrs, inputs
1103169
def attributes_strToDict(astr_attributes, astr_separator=" "):
  
  adict = {}
  alist = str2lst(astr_attributes, astr_separator)
  for str_pair in alist:
    alistTuple = str2lst(str_pair, "=")
    adict.setdefault(alistTuple[0], alistTuple[1].strip(chr(0x22) + chr(0x27)))
  return adict
756663
function(translateAttr, translationId, scope, interpolateParams, defaultTranslationText) {
          if (translationId) {
            $translate(translationId, interpolateParams, translateInterpolation, defaultTranslationText)
              .then(function (translation) {
                applyTranslation(translation, scope, true, translateAttr);
              }, function (translationId) {
                applyTranslation(translationId, scope, false, translateAttr);
              });
          } else {
            // as an empty string cannot be translated, we can solve this using successful=false
            applyTranslation(translationId, scope, false, translateAttr);
          }
        }
661817
def write_attribute(name, value, options = {})
      if translated?(name)
        options = {:locale => nil}.merge(options)
        access = name.to_s
        unless attributes[access] == value || attribute_changed?(access)
          attribute_will_change! access
        end
        @translated_attributes[access] = value
        the_locale = options[:locale] || Mongoid::Globalize.locale
        self.translations.reject!{ |t| t.new_record? && t.locale != the_locale } if self.class.fallbacks_for_empty_translations
        globalize.write(the_locale, name, value)
      else
        super(name, value)
      end
    end
28419
function handleSimpleAttribute() {
    SIMPLEATTR.lastIndex = nextchar-1;
    var matched = SIMPLEATTR.exec(chars);
    if (!matched) throw new Error("should never happen");
    var name = matched[1];
    if (!name) return false;
    var value = matched[2];
    var len = value.length;
    switch(value[0]) {
    case '"':
    case "'":
      value = value.substring(1, len-1);
      nextchar += (matched[0].length-1);
      tokenizer = after_attribute_value_quoted_state;
      break;
    default:
      tokenizer = before_attribute_name_state;
      nextchar += (matched[0].length-1);
      value = value.substring(0, len-1);
      break;
    }

    // Make sure there isn't already an attribute with this name
    // If there is, ignore this one.
    for(var i = 0; i < attributes.length; i++) {
      if (attributes[i][0] === name) return true;
    }

    attributes.push([name, value]);
    return true;
  }
902376
private String translateType(String type, Map<String,String> attrs) {
        String translated = type.toLowerCase();
        if ("select".equals(type))
            translated = "radio";
        else if ("boolean".equals(type))
            translated = "checkbox";
        else if ("list".equals(type)) {
            translated = "picklist";
            String lbl = attrs.get("label");
            if (lbl == null)
                lbl = attrs.get("name");
            if ("Output Documents".equals(lbl)) {
                attrs.put("label", "Documents");
                attrs.put("unselectedLabel", "Read-Only");
                attrs.put("selectedLabel", "Writable");
            }
        }
        else if ("hyperlink".equals(type)) {
            if (attrs.containsKey("url"))
                translated = "link";
            else
                translated = "text";
        }
        else if ("rule".equals(type)) {
            if ("EXPRESSION".equals(attrs.get("type"))) {
                translated = "expression";
            }
            else if ("TRANSFORM".equals(attrs.get("type"))) {
                translated = "edit";
                attrs.put("label", "Transform");
            }
            else  {
                translated = "edit";
                attrs.put("label", "Script");
            }
            attrs.remove("type");
        }
        else if ("Java".equals(attrs.get("name"))) {
            translated = "edit";
        }
        else {
            // asset-driven
            String source = attrs.get("source");
            if ("Process".equals(source)) {
                translated = "asset";
                attrs.put("source", "proc");
            }
            else if ("TaskTemplates".equals(source)) {
                translated = "asset";
                attrs.put("source", "task");
            }
            else if ("RuleSets".equals(source)) {
                String format = attrs.get("type");
                if (format != null) {
                    String exts = "";
                    String[] formats = format.split(",");
                    for (int i = 0; i < formats.length; i++) {
                        String ext = Asset.getFileExtension(formats[i]);
                        if (ext != null) {
                            if (exts.length() > 0)
                                exts += ",";
                            exts += ext.substring(1);
                        }
                    }
                    if (exts.length() > 0) {
                        translated = "asset";
                        attrs.put("source", exts);
                    }
                }
            }
        }
        return translated;
    }
517012
function joinAttributes() {
  for (var index = 0, length = arguments.length; index < length; index++){
    if (shouldIncludeAllAttributes(arguments[index])) {
      return([ ]);
    }
  }
  return(_.union.apply(this, arguments));
}
407110
def flatatt(attrs):
    
    return _flatatt({k.replace('_', '-'): v for k, v in attrs.items()})
60622
@SuppressWarnings("unchecked")
    public <T> T getAttribute( String attrName, Class<T> adaptee ) {
        if (attrName == null) {
            return null;
        }
        if (adaptee == null) {
            adaptee = (Class<T>) String.class;
        }

        Object attribute = feature.getAttribute(attrName);
        if (attribute == null) {
            return null;
        }
        if (attribute instanceof Number) {
            Number num = (Number) attribute;
            if (adaptee.isAssignableFrom(Double.class)) {
                return adaptee.cast(num.doubleValue());
            } else if (adaptee.isAssignableFrom(Float.class)) {
                return adaptee.cast(num.floatValue());
            } else if (adaptee.isAssignableFrom(Integer.class)) {
                return adaptee.cast(num.intValue());
            } else if (adaptee.isAssignableFrom(Long.class)) {
                return adaptee.cast(num.longValue());
            } else if (adaptee.isAssignableFrom(String.class)) {
                return adaptee.cast(num.toString());
            } else {
                throw new IllegalArgumentException();
            }
        } else if (attribute instanceof String) {
            if (adaptee.isAssignableFrom(Double.class)) {
                try {
                    Double parsed = Double.parseDouble((String) attribute);
                    return adaptee.cast(parsed);
                } catch (Exception e) {
                    return null;
                }
            } else if (adaptee.isAssignableFrom(Float.class)) {
                try {
                    Float parsed = Float.parseFloat((String) attribute);
                    return adaptee.cast(parsed);
                } catch (Exception e) {
                    return null;
                }
            } else if (adaptee.isAssignableFrom(Integer.class)) {
                try {
                    Integer parsed = Integer.parseInt((String) attribute);
                    return adaptee.cast(parsed);
                } catch (Exception e) {
                    return null;
                }
            } else if (adaptee.isAssignableFrom(String.class)) {
                return adaptee.cast(attribute);
            } else {
                throw new IllegalArgumentException();
            }
        } else if (attribute instanceof Geometry) {
            return null;
        } else {
            throw new IllegalArgumentException("Can't adapt attribute of type: " + attribute.getClass().getCanonicalName());
        }
    }
643958
function(key, args, fallbackString) {
            var index = key.lastIndexOf(".");
            var prop = gTextProp;
            if (index > 0) {
                // An attribute has been specified
                prop = key.substr(index + 1);
                key = key.substring(0, index);
            }
            var fallback;
            if (fallbackString) {
                fallback = {};
                fallback[prop] = fallbackString;
            }
            var data = getL10nData(key, args, fallback);
            if (data && prop in data) {
                return data[prop];
            }
            return "{{" + key + "}}";
        }
1122179
function(name) {
    var attr = this.definition.attributes[name]

    if (attr) {
      // set undefined values to null
      if (this.attributes[name] === undefined) {
        this.attributes[name] = null
      }

      return this.definition.cast(name, this.attributes[name], 'output', this)
    }

    return null
  }
655041
private float[] restoreAttribs(float precision, int[] intAttribs) {
        int ae = CTM_ATTR_ELEMENT_COUNT;
        int vc = intAttribs.length / ae;
        float[] values = new float[intAttribs.length];
        int[] prev = new int[ae];
        for (int i = 0; i < vc; ++i) {
            // Calculate inverse delta, and convert to floating point
            for (int j = 0; j < ae; ++j) {
                int value = intAttribs[i * ae + j] + prev[j];
                values[i * ae + j] = value * precision;
                prev[j] = value;
            }
        }
        return values;
    }
1169170
function Attribute(args, arg2) {
  var splitTypes; // For String(30) type
  if (false === (this instanceof Attribute)) throw new Error('new operator required');
  if (typeof args == 'string') {
    var quickName = args;
    args = {};
    args.name = quickName;
    if (typeof arg2 == 'string') {
      args.type = arg2;
    }
  }
  args = args || {};
  this.name = args.name || null;
  this.label = args.label || args.name;
  if (this.label)
    this.label = this.label.charAt(0).toUpperCase() + this.label.slice(1);
  this.type = args.type || 'String';
  splitTypes = function (str) { // for String(30) remove right of (
    var tmpSplit = str.split('(');
    tmpSplit[1] = parseInt(tmpSplit[1]);
    return tmpSplit;
  }(this.type);
  this.type = splitTypes[0];
  this.hint = args.hint || {};
  if (args.hidden !== undefined)
    this.hidden = args.hidden;
  this.validationRule = args.validationRule || {};
  var unusedProperties = [];
  var standardProperties = ['name', 'type', 'label', 'hint', 'hidden', 'value', 'validationRule'];
  switch (this.type) {
    case 'ID':
      unusedProperties = getInvalidProperties(args, standardProperties);
      this.value = args.value || null;
      break;
    case 'String':
      unusedProperties = getInvalidProperties(args, standardProperties.concat(['placeHolder', 'quickPick', 'size']));
      this.size = splitTypes[1] ? splitTypes[1] : typeof args.size == 'number' ? args.size : args.size || 50;
      this.value = args.value || null;
      if (args.quickPick)
        this.quickPick = args.quickPick;
      this.placeHolder = args.placeHolder || null;
      break;
    case 'Date':
      unusedProperties = getInvalidProperties(args, standardProperties.concat('placeHolder'));
      this.value = args.value || null;
      this.placeHolder = args.placeHolder || null;
      break;
    case 'Boolean':
      unusedProperties = getInvalidProperties(args, standardProperties);
      if (args.value === false)
        this.value = false;
      else
        this.value = args.value || null;
      break;
    case 'Number':
      unusedProperties = getInvalidProperties(args, standardProperties.concat('placeHolder'));
      if (args.value === 0)
        this.value = 0;
      else
        this.value = args.value || null;
      this.placeHolder = args.placeHolder || null;
      break;
    case 'Model':
      unusedProperties = getInvalidProperties(args, standardProperties);
      this.value = args.value || null;
      if (this.value instanceof Attribute.ModelID)
        this.modelType = this.value.modelType;
      break;
    case 'Group':
      unusedProperties = getInvalidProperties(args, standardProperties);
      this.value = args.value || null;
      break;
    case 'Table':
      unusedProperties = getInvalidProperties(args, standardProperties.concat('group'));
      this.value = args.value || null;
      this.group = args.group || null;
      break;
    case 'Object':
      unusedProperties = getInvalidProperties(args, standardProperties);
      this.value = args.value || null;
      break;
    default:
      break;
  }
  var errorList = this.getObjectStateErrors(); // before leaving make sure valid Attribute
  for (var i = 0; i < unusedProperties.length; i++) errorList.push('invalid property: ' + unusedProperties[i]);
  if (errorList.length > 1) throw new Error('error creating Attribute: multiple errors');
  if (errorList.length) throw new Error('error creating Attribute: ' + errorList[0]);

  // Validations done
  this._eventListeners = [];
  this._errorConditions = {};
}
593988
def attributes(atts = {}, for_definition = false)
      wrapped_attributes atts, for_definition
      attributes_assignments atts, false, for_definition
      atts
    end