@param options [Haml::Options]
 Returns Temple expression to render attributes.

 @param attributes [Hash]
 @param object_ref [String,:nil]
 @param dynamic_attributes [DynamicAttributes]
 @return [Array] Temple expression
768620
def compile(attributes, object_ref, dynamic_attributes)
      if object_ref != :nil || !AttributeParser.available?
        return [:dynamic, AttributeCompiler.runtime_build(attributes, object_ref, dynamic_attributes)]
      end

      parsed_hashes = [dynamic_attributes.new, dynamic_attributes.old].compact.map do |attribute_hash|
        unless (hash = AttributeParser.parse(attribute_hash))
          return [:dynamic, AttributeCompiler.runtime_build(attributes, object_ref, dynamic_attributes)]
        end
        hash
      end
      attribute_values = build_attribute_values(attributes, parsed_hashes)
      AttributeBuilder.verify_attribute_names!(attribute_values.map(&:key))

      [:multi, *group_values_for_sort(attribute_values).map { |value_group|
        compile_attribute_values(value_group)
      }]
    end
1080890
def attributes=(attrs = {})
      attrs.each do |attr_name, value|
        setter = "#{attr_name}="
        send(setter, value)
      end
    end
154621
function(model, options) {
      if (!(model instanceof Parse.Object)) {
        var attrs = model;
        options.collection = this;
        model = new this.model(attrs, options);
        if (!model._validate(model.attributes, options)) {
          model = false;
        }
      } else if (!model.collection) {
        model.collection = this;
      }
      return model;
    }
764952
def relatable_categories_for_object_template(name, related_attribute, params = {})
      api_call(:get, "/object_templates/#{name}/relatable_categories", params.merge!(:related_attribute => related_attribute)) do |response|
         Calculated::Models::ObjectTemplate.new(response["object_template"])
      end
    end
373612
function compileAttrs(attrs, options) {
  assert(Array.isArray(attrs), 'Attrs should be an array');
  assert(attrs.every(function (attr) {
    return attr &&
      typeof attr === 'object' &&
      typeof attr.name === 'string' &&
      (typeof attr.val === 'string' || typeof attr.val === 'boolean') &&
      typeof attr.mustEscape === 'boolean';
  }), 'All attributes should be supplied as an object of the form {name, val, mustEscape}');
  assert(options && typeof options === 'object', 'Options should be an object');
  assert(typeof options.terse === 'boolean', 'Options.terse should be a boolean');
  assert(
    typeof options.runtime === 'function',
    'Options.runtime should be a function that takes a runtime function name and returns the source code that will evaluate to that function at runtime'
  );
  assert(
    options.format === 'html' || options.format === 'object',
    'Options.format should be "html" or "object"'
  );

  var buf = [];
  var classes = [];
  var classEscaping = [];

  function addAttribute(key, val, mustEscape, buf) {
    if (isConstant(val)) {
      if (options.format === 'html') {
        var str = stringify(runtime.attr(key, toConstant(val), mustEscape, options.terse));
        var last = buf[buf.length - 1];
        if (last && last[last.length - 1] === str[0]) {
          buf[buf.length - 1] = last.substr(0, last.length - 1) + str.substr(1);
        } else {
          buf.push(str);
        }
      } else {
        val = toConstant(val);
        if (mustEscape) {
          val = runtime.escape(val);
        }
        buf.push(stringify(key) + ': ' + stringify(val));
      }
    } else {
      if (options.format === 'html') {
        buf.push(options.runtime('attr') + '("' + key + '", ' + val + ', ' + stringify(mustEscape) + ', ' + stringify(options.terse) + ')');
      } else {
        if (mustEscape) {
          val = options.runtime('escape') + '(' + val + ')';
        }
        buf.push(stringify(key) + ': ' + val);
      }
    }
  }

  attrs.forEach(function(attr){
    var key = attr.name;
    var val = attr.val;
    var mustEscape = attr.mustEscape;

    if (key === 'class') {
      classes.push(val);
      classEscaping.push(mustEscape);
    } else {
      if (key === 'style') {
        if (isConstant(val)) {
          val = stringify(runtime.style(toConstant(val)));
        } else {
          val = options.runtime('style') + '(' + val + ')';
        }
      }
      addAttribute(key, val, mustEscape, buf);
    }
  });
  var classesBuf = [];
  if (classes.length) {
    if (classes.every(isConstant)) {
      addAttribute(
        'class',
        stringify(runtime.classes(classes.map(toConstant), classEscaping)),
        false,
        classesBuf
      );
    } else {
      classes = classes.map(function (cls, i) {
        if (isConstant(cls)) {
          cls = stringify(classEscaping[i] ? runtime.escape(toConstant(cls)) : toConstant(cls));
          classEscaping[i] = false;
        }
        return cls;
      });
      addAttribute(
        'class',
        options.runtime('classes') + '([' + classes.join(',') + '], ' + stringify(classEscaping) + ')',
        false,
        classesBuf
      );
    }
  }
  buf = classesBuf.concat(buf);
  if (options.format === 'html') return buf.length ? buf.join('+') : '""';
  else return '{' + buf.join(',') + '}';
}
998023
def renderer_options
      options = {
        # script_name: "", # unfortunately doesnt seem to effect relative_url_root like desired
        # input: ""
      }

      origin = headers["origin"]
      if origin
        uri = URI.parse(origin)
        options[:https] = uri.scheme == "https"
      end

      # Important to not use rack_headers as local variable instead of headers.
      # headers is a method that gets deleted to controller.headers and using it
      # seems to cause issues.
      rack_headers = rackify_headers(headers)
      options.merge!(rack_headers)

      # Note @options[:method] uses @options vs options on purpose
      @options[:method] = event["httpMethod"].downcase if event["httpMethod"]
      options
    end
1215056
public SelectBuilder attributeset(final String _attribute,
                                      final String _where)
    {
        addPoint();
        this.bldr.append("attributeset[").append(_attribute);
        if (_where != null) {
            this.bldr.append("|").append(_where);
        }
        this.bldr.append("]");
        return this;
    }
374285
def assign_attributes(new_attributes = {}, options = {})
      return if new_attributes.blank?

      attributes = new_attributes.stringify_keys
      multi_parameter_attributes = []
      nested_parameter_attributes = []

      attributes.each do |k, v|
        if k.include?("(")
          multi_parameter_attributes << [ k, v ]
        elsif respond_to?("#{k}=")
          if v.is_a?(Hash)
            nested_parameter_attributes << [ k, v ]
          else
            send("#{k}=", v)
          end
        else
          raise UnknownAttributeError, "unknown attribute: #{k}"
        end
      end

      # assign any deferred nested attributes after the base attributes have been set
      nested_parameter_attributes.each do |k,v|
        send("#{k}=", v)
      end

      assign_multiparameter_attributes(multi_parameter_attributes)
    end
793296
def method_missing(meth, *args)
      m = meth.id2name
      if m =~ /=$/
        @attributes[m.chop.to_sym] = (args.length < 2 ? args[0] : args)
      else
        @attributes[m.to_sym]
      end
    end
192813
function(options) {
      var attrs = {};
      for (var key in this.attributes) attrs[key] = void 0;
      return this.set(attrs, _.extend({}, options, {unset: true}));
    }
174329
def build_from_hash(attributes)
      return nil unless attributes.is_a?(Hash)
      self.class.swagger_types.each_pair do |key, type|
        if type =~ /^Array<(.*)>/i
          if attributes[self.class.attribute_map[key]].is_a?(Array)
            self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
          else
            #TODO show warning in debug mode
          end
        elsif !attributes[self.class.attribute_map[key]].nil?
          self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
        else
          # data not found in attributes(hash), not an issue as the data can be optional
        end
      end

      self
    end
1158366
def attributes(*fields_name, **options, &block)
      if options.include? :except
        @fields = resolve_model_reflections.reject do |field|
          options[:except].include? field.to_sym
        end
      elsif options.include? :append
         @fields += options[:append]
      else
        # set new value for fields
        @fields = fields_name.map(&:to_s) unless fields_name.empty?
      end

      @fields.concat(block.call.map(&:to_s)) if block_given?
    end
660979
function (params) {

            var attrs;
            if ('object' == typeof params) {
                attrs = params;
            }
            if ('string' == typeof params) {
                if (arguments.length > 1) {
                    attrs = {};
                    attrs[params] = arguments[1];
                }else{
                    return getElAttributes(this[0],params);
                }
            }
            if (attrs) {
                this.each(function (inx, ele) {
                    setAttributes(ele, attrs);
                });
            }
        }
1130645
def attributes_hash
      attributes = @scope.attributes.collect do |attr|
        value = fetch_property(attr)

        if value.kind_of?(BigDecimal)
          value = value.to_f
        end

        [attr, value]
      end

      Hash[attributes]
    end
86153
def get_xml_attributes obj, parent=true
      attribs = obj.reject { |k, _| @@ignored_attributes.include? k }
      if parent
        attribs = attribs.reject { |k, _| @@parent_ignored_attributes.include? k }
      end
      attribs = attribs.reject { |_, v| v.kind_of?(Hash) || v.kind_of?(Array) }
      attribs.each_pair do |k, v|
        if @@numeric_attributes.include?(k) || k.to_s =~ /.+_score/
          attribs[k] = v.round(@render_options[:round])
        end
      end
      attribs
    end
464045
def attribute(*args)
      node = Nodes::Attribute.new

      if args.first.is_a?(Hash)
        args.first.each_pair { |k, v| node[v] = k }
      else
        options = args.extract_options!
        args.each { |name|
          key = options[:as] || name
          node[key] = name
        }
        node.condition = options[:if]
      end

      @template.add_node node
    end
175270
def selected_scopes(attribute)
      selected = object.send(attribute) || []
      selected = selected.values if selected.is_a?(Hash)
      selected = [selected] unless selected.is_a?(Array)
      selected = Decidim::Scope.where(id: selected.map(&:to_i)) unless selected.first.is_a?(Decidim::Scope)
      selected
    end