Remaps a given changed field from tag to tag_id.
423898
def _remap_tag_to_tag_id(cls, tag, new_data):
        ''''''
        try:
            value = new_data[tag]
        except:
            # If tag wasn't changed, just return
            return

        tag_id = tag + '_id'
        try:
            # Remap the ID change to the required field
            new_data[tag_id] = value['id']
        except:
            try:
                # Try and grab the id of the object
                new_data[tag_id] = value.id
            except AttributeError:
                # If the changes field is not a dict or object, just use whatever value was given
                new_data[tag_id] = value

        # Remove the tag from the changed data
        del new_data[tag]
623470
def tag_update(self, tag_id, category):
        
        param = {'tag[category]': category}
        return self._get('pools/{0}.json'.format(tag_id), param, method='PUT',
                         auth=True)
755736
private function replaceAttributesWithChange()
    {
        if (($change = static::lookupRequestedChange())
            && $change->key == $this->getKey()) {
            $this->attributes = array_merge(
                $this->attributes,
                $this->attributesAtChange($change)
            );
        }
    }
131128
def attribute_change(attr)
      attr = database_field_name(attr)
      [changed_attributes[attr], attributes[attr]] if attribute_changed?(attr)
    end
736664
def rename_fields(input, **params):
    
    PARAM_RENAME_LIST = 'rename'
    RENAME_SRC_FIELD = 'src.field'
    RENAME_DEST_FIELD = 'dest.field'

    rename_list = params.get(PARAM_RENAME_LIST)
    for row in input:
        for rename in rename_list:
            row[rename[RENAME_DEST_FIELD]] = row[rename[RENAME_SRC_FIELD]]
            row.pop(rename[RENAME_SRC_FIELD])
    return input
1242541
def to_element(change):
    
    return tags.Change(
        tags.Action(
            change.action,
        ),
        tags.ResourceRecordSet(
            tags.Name(
                unicode(change.rrset.label),
            ),
            tags.Type(
                change.rrset.type,
            ),
            tags.TTL(
                u"{}".format(change.rrset.ttl),
            ),
            tags.ResourceRecords(list(
                tags.ResourceRecord(tags.Value(rr.to_text()))
                for rr
                in sorted(change.rrset.records)
            ))
        ),
    )
940701
protected void remapRows() {
        rowMap = new HashMap<>();
        final FacesContext context = FacesContext.getCurrentInstance();
        final Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
        final Collection<?> values = (Collection<?>) getValue();
        final String var = getVar();
        for (final Object obj : values) {
            requestMap.put(var, obj);
            try {
                final String key = getRowKeyValueAsString(context);
                rowMap.put(key, obj);
            }
            finally {
                requestMap.remove(var);
            }
        }
    }
114239
def post_revert_tags(self, post_id, history_id):
        
        params = {'id': post_id, 'history_id': history_id}
        return self._get('post/revert_tags', params, 'PUT')
330121
def reindex
      @tags = {}
      self.each_with_index do |field, i|
        @tags[field.tag] ||= []
        @tags[field.tag] << i
      end
      @clean = true
    end
1203056
def is_changed(self, field, from_db=False):
        
        return field in self.changed_fields(from_db=from_db)
176400
private List<Tag> mergeS3TagSet(List<Tag> initialTags, Tag changeTag) {
        Map<String, String> mergedTags = initialTags.stream().collect(Collectors.toMap(Tag::getKey, Tag::getValue));
        mergedTags.put(changeTag.getKey(), changeTag.getValue());
        return mergedTags.entrySet().stream().map(
                entry -> new Tag(entry.getKey(), entry.getValue())).collect(Collectors.toList());
    }
747602
public static <T extends AbstractJaxb> boolean replaceById(String id,
            T target, T replace) throws TagTypeUnmatchException {
        return execute(id, target, replace.copy(replace.getClass()));
    }
1247764
def _revert_tag_in_init(self):
        
        for line in fileinput.input(self.init_file, inplace=1):
            if line.strip().startswith("__version__"):
                line = "__version__ = \"" + self.init_version + "\""
            print(line.strip("\n"))
        
        print("reverted __init__.__version__ back to {}"
              .format(self.init_version))
870818
def tag_to_version(tag, config=None):
    
    trace("tag", tag)

    if not config:
        config = Configuration()

    tagdict = _parse_version_tag(tag, config)
    if not isinstance(tagdict, dict) or not tagdict.get("version", None):
        warnings.warn("tag %r no version found" % (tag,))
        return None

    version = tagdict["version"]
    trace("version pre parse", version)

    if tagdict.get("suffix", ""):
        warnings.warn(
            "tag %r will be stripped of its suffix '%s'" % (tag, tagdict["suffix"])
        )

    if VERSION_CLASS is not None:
        version = pkg_parse_version(version)
        trace("version", repr(version))

    return version
1240523
def renamenodes(idf, fieldtype):
    """"""
    renameds = []
    for key in idf.model.dtls:
        for idfobject in idf.idfobjects[key]:
            for fieldvalue in idfobject.obj:
                if type(fieldvalue) is list:
                    if fieldvalue not in renameds:
                        cpvalue = copy.copy(fieldvalue)
                        renameds.append(cpvalue)

    # do the renaming
    for key in idf.model.dtls:
        for idfobject in idf.idfobjects[key]:
            for i, fieldvalue in enumerate(idfobject.obj):
                itsidd = idfobject.objidd[i]
                if 'type' in itsidd:
                    if itsidd['type'][0] == fieldtype:
                        tempdct = dict(renameds)
                        if type(fieldvalue) is list:
                            fieldvalue = fieldvalue[-1]
                            idfobject.obj[i] = fieldvalue
                        else:
                            if fieldvalue in tempdct:
                                fieldvalue = tempdct[fieldvalue]
                                idfobject.obj[i] = fieldvalue
336770
def convert(self, string):
        
        (string, tags) = self.detag_string(string)
        string = self.inner_convert_string(string)
        string = self.retag_string(string, tags)
        return string
396708
def rename(old, new)
      parameters = Specification.new(
        old: Types::Tags,
        new: Types::Tags
      ).parameters(old: old, new: new)
      @client.action('/tags/rename', parameters)
      self
    end