Updates attributes in code_array
970032
def _xls2attributes(self, worksheet, tab):
        """"""

        # Merged cells
        for top, bottom, left, right in worksheet.merged_cells:
            attrs = {"merge_area": (top, left, bottom - 1, right - 1)}
            selection = Selection([(top, left)], [(bottom - 1, right - 1)],
                                  [], [], [])
            self.code_array.cell_attributes.append((selection, tab, attrs))

        # Which cell comprise which format ids
        xf2cell = dict((xfid, []) for xfid in xrange(self.workbook.xfcount))
        rows, cols = worksheet.nrows, worksheet.ncols
        for row, col in product(xrange(rows), xrange(cols)):
            xfid = worksheet.cell_xf_index(row, col)
            xf2cell[xfid].append((row, col))

        for xfid, xf in enumerate(self.workbook.xf_list):
            selection = Selection([], [], [], [], xf2cell[xfid])
            selection_above = selection.shifted(-1, 0)
            selection_left = selection.shifted(0, -1)

            attributes = {}

            # Alignment

            xfalign2justification = {
                0: "left",
                1: "left",
                2: "center",
                3: "right",
                4: "left",
                5: "left",
                6: "center",
                7: "left",
            }

            xfalign2vertical_align = {
                0: "top",
                1: "middle",
                2: "bottom",
                3: "middle",
                4: "middle",
            }

            def xfrotation2angle(xfrotation):
                """Returns angle from xlrotatation"""

                # angle is counterclockwise
                if 0 <= xfrotation <= 90:
                    return xfrotation

                elif 90 < xfrotation <= 180:
                    return - (xfrotation - 90)

                return 0

            try:
                attributes["justification"] = \
                    xfalign2justification[xf.alignment.hor_align]

                attributes["vertical_align"] = \
                    xfalign2vertical_align[xf.alignment.vert_align]

                attributes["angle"] = \
                    xfrotation2angle(xf.alignment.rotation)

            except AttributeError:
                pass

            # Background
            if xf.background.fill_pattern == 1:
                color_idx = xf.background.pattern_colour_index
                color = self.idx2colour(color_idx)
                attributes["bgcolor"] = color.GetRGB()

            # Border
            __border_line_style2width = {
                0: 1,
                1: 1,
                2: 4,
                5: 7,
            }

            def constant_factory(value):
                return repeat(value).next

            border_line_style2width = defaultdict(constant_factory(1))
            border_line_style2width.update(__border_line_style2width)

            bottom_color_idx = xf.border.bottom_colour_index

            if bottom_color_idx in self.workbook.colour_map and \
               self.workbook.colour_map[bottom_color_idx] is not None:
                bottom_color = self.idx2colour(bottom_color_idx)
                attributes["bordercolor_bottom"] = bottom_color.GetRGB()

            right_color_idx = xf.border.right_colour_index
            if right_color_idx in self.workbook.colour_map and \
               self.workbook.colour_map[right_color_idx] is not None:
                right_color = self.idx2colour(right_color_idx)
                attributes["bordercolor_right"] = right_color.GetRGB()

            bottom_width = border_line_style2width[xf.border.bottom_line_style]
            attributes["borderwidth_bottom"] = bottom_width

            right_width = border_line_style2width[xf.border.right_line_style]
            attributes["borderwidth_right"] = right_width

            # Font

            font = self.workbook.font_list[xf.font_index]

            attributes["textfont"] = font.name
            attributes["pointsize"] = font.height / 20.0

            fontweight = wx.BOLD if font.weight == 700 else wx.NORMAL
            attributes["fontweight"] = fontweight

            if font.italic:
                attributes["fontstyle"] = wx.ITALIC

            if font.colour_index in self.workbook.colour_map and \
               self.workbook.colour_map[font.colour_index] is not None:
                attributes["textcolor"] = \
                    self.idx2colour(font.colour_index).GetRGB()

            if font.underline_type:
                attributes["underline"] = True

            if font.struck_out:
                attributes["strikethrough"] = True

            # Handle top cells' top borders

            attributes_above = {}
            top_width = border_line_style2width[xf.border.top_line_style]
            if top_width != 1:
                attributes_above["borderwidth_bottom"] = top_width
            top_color_idx = xf.border.top_colour_index
            if top_color_idx in self.workbook.colour_map and \
               self.workbook.colour_map[top_color_idx] is not None:
                top_color = self.idx2colour(top_color_idx)
                attributes_above["bordercolor_bottom"] = top_color.GetRGB()

            # Handle leftmost cells' left borders

            attributes_left = {}
            left_width = border_line_style2width[xf.border.left_line_style]
            if left_width != 1:
                attributes_left["borderwidth_right"] = left_width
            left_color_idx = xf.border.left_colour_index
            if left_color_idx in self.workbook.colour_map and \
               self.workbook.colour_map[left_color_idx] is not None:
                left_color = self.idx2colour(left_color_idx)
                attributes_above["bordercolor_right"] = left_color.GetRGB()

            if attributes_above:
                self._cell_attribute_append(selection_above, tab,
                                            attributes_above)
            if attributes_left:
                self._cell_attribute_append(selection_left, tab,
                                            attributes_left)
            if attributes:
                self._cell_attribute_append(selection, tab, attributes)
1118541
def update_attributes(properties_hash)
      self.class.get_class_properties.each do |property|
        key = property[:name].to_sym
        if properties_hash.has_key? key
          self.setValue(properties_hash[key], forKey:key)
        end
      end
    end
758315
protected function prepareAttributes()
    {

        // initialize the values that has to be updated
        $updatedAt = date('Y-m-d H:i:s');
        $path = $this->getValue(ColumnKeys::PATH);

        // prepare and return the array with the updated values
        return array(
            MemberNames::PATH           => $path,
            MemberNames::UPDATED_AT     => $updatedAt
        );
    }
143639
def reinit_with(coder)
      @attributes_cache = {}
      dirty      = @changed_attributes.keys
      attributes = self.class.initialize_attributes(coder['attributes'].except(*dirty))
      @attributes.update(attributes)
      @changed_attributes.update(coder['attributes'].slice(*dirty))
      @changed_attributes.delete_if{|k,v| v.eql? @attributes[k]}

      run_callbacks :find

      self
    end
502779
def update_attr(self, attr):
        
        changed_attr = []
        for key, value in attr.items():
            if value is None:
                continue
            if getattr(self, "_{0}".format(key), None) != value:
                changed_attr.append(key)
                self.__setattr__("_{0}".format(key), value)
                _LOGGER.debug('%s: update %s with %s', self.name, key, value)
        return changed_attr
1157251
function changes($attr_name = null)
    {
        if (isset($attr_name)){
            return $this->_changes[$attr_name];
        }
        return $this->_changes;
    }
480182
def _combine_attr_fast_update(self, attr, typ):
        '''

        '''
        values = dict(getattr(self, attr, {}))
        
        for base in self._class_data.bases:
            vals = dict(getattr(base, attr, {}))
            preserve_attr_data(vals, values)
            values = combine(vals, values)
            
        setattr(self, attr, typ(values))
625172
def _update(self, api_obj):
    """"""
    if not isinstance(self, api_obj.__class__):
      raise ValueError(
          "Class %s does not derive from %s; cannot update attributes." %
          (self.__class__, api_obj.__class__))

    for name in self._get_attributes().keys():
      try:
        val = getattr(api_obj, name)
        setattr(self, name, val)
      except AttributeError, ignored:
        pass
1134816
def update(attributes)
      load_attributes(
          Core::RestApi.instance.put(path, attributes, if_match_header))
    end
698782
function processAttributeArray(attrArray) {
  let attrs = {
    'static': {},
    'dynamic': []
  };
  let name = [];
  let value = [];
  let item;
  let pushingTo = name;
  for (let i = 0; i < attrArray.length; i++) {
    item = attrArray[i];
    if (item.type === 'attributenameend') {
      pushingTo = value;
    } else if (item.type === 'attributeend') {
      // Ensure there are no tokens in a non-dynamic attribute name
      for (let j = 0; j < name.length; j++) {
        if (typeof name[j] !== 'string') {
          compilerErrors.mustacheTokenCannotBeInAttributeNames(name[j]);
        }
      }

      if (name.length === 1) {
        if (value.length) {
          if (value.length === 1 && typeof value[0] === 'string') {
            value = value[0];
          }
        } else {
          value = true;
        }
        attrs.static[name[0]] = flattenAttributeValues(value);
      } else {
        attrs.dynamic = attrs.dynamic.concat(_.map(name, flattenAttributeValues));
        if (value.length) {
          attrs.dynamic.push('="');
          attrs.dynamic = attrs.dynamic.concat(_.map(value, flattenAttributeValues));
          attrs.dynamic.push('"');
        }
      }
      name = [];
      value = [];
      pushingTo = name;
    } else if (item.type === 'attributename' || item.type === 'attributevalue') {
      pushingTo.push(item.value);
    } else if (pushingTo === name) {
      if (name.length === 0) {
        if (item.type === types.INTERPOLATOR) {
          compilerErrors.doubleCurlyInterpolatorsCannotBeInAttributes(item.value);
        } else if (item.type === types.SECTION) {
          attrs.dynamic.push(templateStack.processObject(item));
          continue;
        }
      }
      pushingTo.push(item);
    } else {
      pushingTo.push(item);
    }
  }

  attrs.dynamic = attrs.dynamic.concat(_.map(name, flattenAttributeValues));
  attrs.dynamic = attrs.dynamic.concat(_.map(value, flattenAttributeValues));
  mergeStrings(attrs.dynamic);

  return attrs;
}
385460
def update(self, data_=None, **kwargs):
    
    if data_ is None:
      data_ = dict()
    else:
      data_ = dict(data_)
    data_.update(**kwargs)
    changes = set()
    for attr_name in data_:
      if hasattr(self, attr_name):
        if getattr(self, attr_name) != data_[attr_name]:
          changes.add(attr_name)
          setattr(self, attr_name, data_[attr_name])
      else:
        if self.strict_attrs:
          raise Exception("Unknown attribute for {}: {}".format(self.__class__.__name__, attr_name))
    return changes
591841
def update(self, **kwargs):
        
        self.validate(**kwargs)
        for attr, value in kwargs.items():
            setattr(self, attr, value)
        return self
1087480
def update_attribute_toolbar(self, key=None):
        

        if key is None:
            key = self.actions.cursor

        post_command_event(self, self.ToolbarUpdateMsg, key=key,
                           attr=self.code_array.cell_attributes[key])
20219
def update_attributes(atts)
      atts.delete('_type')
      atts.each { |att, val| send(:"#{att}=", val) }
    end
222901
def perform_partial_update(self, data, instance):
        

        for key, val in data.items():
            setattr(instance, key, val)
1004536
function update(instance, array, tx, callback) {
    var
        model = instance.__model,
        beforeUpdate = model.__beforeUpdate,
        updates,
        params,
        sql;
    if (beforeUpdate) {
        beforeUpdate(instance);
    }
    if (!array) {
        array = model.__updateAttributesArray;
    }
    updates = _.map(array, function (attr) {
        return '`' + attr + '`=?';
    });
    params = _.map(array, function (attr) {
        return instance[attr];
    });
    params.push(instance[model.__primaryKey]);
    sql = utils.format('update `%s` set %s where `%s`=?', model.__table, updates.join(', '), model.__primaryKey);
    smartRunSQL(model.__pool, sql, params, tx, function (err, result) {
        if (err) {
            return callback(err);
        }
        callback(null, instance);
    });
}
558633
def update(self, attrs):
        """"""
        self._validateAttrs(attrs)
        for k,v in attrs.items():
            typecast = type( getattr(self, k) )
            if typecast==bool and v=="False":   newval = False # "False" evalued as boolean is True because its length > 0
            else:                               newval = typecast(v.lower())
            setattr(self, k, newval)