Convert the old style WIC slot to a new style WIC slot and add the WIC
        to the node properties

        :param str old_wic: Old WIC slot
        :param str wic: WIC name
519389
def add_wic(self, old_wic, wic):
        
        new_wic = 'wic' + old_wic[-1]
        self.node['properties'][new_wic] = wic
17848
protected void moveExtraProperties( String oldNodeId,
                                        String newNodeId ) {
        ExtraPropertiesStore extraPropertiesStore = extraPropertiesStore();
        if (extraPropertiesStore == null || !extraPropertiesStore.contains(oldNodeId)) {
            return;
        }
        Map<Name, Property> existingExtraProps = extraPropertiesStore.getProperties(oldNodeId);
        extraPropertiesStore.removeProperties(oldNodeId);
        extraPropertiesStore.storeProperties(newNodeId, existingExtraProps);
    }
1170936
def update_node_attributes(self, attributes_flags=int(Qt.ItemIsSelectable | Qt.ItemIsEnabled)):
        

        self.traced.value = foundations.trace.is_traced(self.__module)
        self.traced.roles[Qt.DisplayRole] = foundations.strings.to_string(self.traced.value).title()
103066
public void addReplace(int oldLength, int newLength) {
        if(oldLength == newLength && 0 < oldLength && oldLength <= MAX_SHORT_WIDTH) {
            // Replacement of short oldLength text units by same-length new text.
            // Merge into previous short-replacement record, if any.
            int last = lastUnit();
            if(MAX_UNCHANGED < last && last < MAX_SHORT_CHANGE &&
                    (last >> 12) == oldLength && (last & 0xfff) < MAX_SHORT_CHANGE_LENGTH) {
                setLastUnit(last + 1);
                return;
            }
            append(oldLength << 12);
            return;
        }

        if(oldLength < 0 || newLength < 0) {
            throw new IllegalArgumentException(
                    "addReplace(" + oldLength + ", " + newLength +
                    "): both lengths must be non-negative");
        }
        if (oldLength == 0 && newLength == 0) {
            return;
        }
        int newDelta = newLength - oldLength;
        if (newDelta != 0) {
            if ((newDelta > 0 && delta >= 0 && newDelta > (Integer.MAX_VALUE - delta)) ||
                    (newDelta < 0 && delta < 0 && newDelta < (Integer.MIN_VALUE - delta))) {
                // Integer overflow or underflow.
                throw new IndexOutOfBoundsException();
            }
            delta += newDelta;
        }

        int head = 0x7000;
        if (oldLength < LENGTH_IN_1TRAIL && newLength < LENGTH_IN_1TRAIL) {
            head |= oldLength << 6;
            head |= newLength;
            append(head);
        } else if ((array.length - length) >= 5 || growArray()) {
            int limit = length + 1;
            if(oldLength < LENGTH_IN_1TRAIL) {
                head |= oldLength << 6;
            } else if(oldLength <= 0x7fff) {
                head |= LENGTH_IN_1TRAIL << 6;
                array[limit++] = (char)(0x8000 | oldLength);
            } else {
                head |= (LENGTH_IN_2TRAIL + (oldLength >> 30)) << 6;
                array[limit++] = (char)(0x8000 | (oldLength >> 15));
                array[limit++] = (char)(0x8000 | oldLength);
            }
            if(newLength < LENGTH_IN_1TRAIL) {
                head |= newLength;
            } else if(newLength <= 0x7fff) {
                head |= LENGTH_IN_1TRAIL;
                array[limit++] = (char)(0x8000 | newLength);
            } else {
                head |= LENGTH_IN_2TRAIL + (newLength >> 30);
                array[limit++] = (char)(0x8000 | (newLength >> 15));
                array[limit++] = (char)(0x8000 | newLength);
            }
            array[length] = (char)head;
            length = limit;
        }
    }
236136
public void replaceItem(@NonNull final T oldObject, @NonNull final T newObject) {
        synchronized (mLock) {
            final int position = getPosition(oldObject);
            if (position == -1) {
                // not found, don't replace
                return;
            }

            mObjects.remove(position);
            mObjects.add(position, newObject);

            if (isItemTheSame(oldObject, newObject)) {
                if (isContentTheSame(oldObject, newObject)) {
                    // visible content hasn't changed, don't notify
                    return;
                }

                // item with same stable id has changed
                notifyItemChanged(position, newObject);
            } else {
                // item replaced with another one with a different id
                notifyItemRemoved(position);
                notifyItemInserted(position);
            }
        }
    }
53134
public void replace(XElement oldChild, XElement newChild) {
        int idx = children.indexOf(oldChild);
        if (idx >= 0) {
            children.get(idx).parent = null;
            children.set(idx, newChild);
            newChild.parent = this;
        }
    }
1194346
public void replace(Card oldOne, Card newOne) {
        VirtualLayoutManager layoutManager = getLayoutManager();
        if (oldOne != null && newOne != null && mGroupBasicAdapter != null && layoutManager != null) {
            List<LayoutHelper> layoutHelpers = layoutManager.getLayoutHelpers();
            int cardIdx = mGroupBasicAdapter.findCardIdxForCard(oldOne);
            if (layoutHelpers != null && cardIdx >= 0 && cardIdx < layoutHelpers.size()) {
                final List<LayoutHelper> newLayoutHelpers = new LinkedList<>();
                for (int i = 0, size = layoutHelpers.size(); i < size; i++) {
                    LayoutHelper layoutHelper = layoutHelpers.get(i);
                    if (i == cardIdx) {
                        layoutHelper = newOne.getLayoutHelper();
                    }
                    newLayoutHelpers.add(layoutHelper);
                }
                layoutManager.setLayoutHelpers(newLayoutHelpers);
                mGroupBasicAdapter.replaceComponent(oldOne, newOne);
            }
        }
    }
930449
def _attach_new(self, records, current, touch=True):
        
        changes = {
            'attached': [],
            'updated': []
        }

        for id, attributes in records.items():
            if id not in current:
                self.attach(id, attributes, touch)

                changes['attached'].append(id)
            elif len(attributes) > 0 and self.update_existing_pivot(id, attributes, touch):
                changes['updated'].append(id)

        return changes
1307775
def cwd(self, new_path):
        ''''''
        old_cwd = self._cwd
        self._cwd = new_path
        return old_cwd
654351
def _convert_qemu_node(node, old_node):
    

    # In 2.0 the internet VM is replaced by the NAT node
    if old_node.get("properties", {}).get("hda_disk_image_md5sum") == "8ebc5a6ec53a1c05b7aa101b5ceefe31":
        node["console"] = None
        node["console_type"] = None
        node["node_type"] = "nat"
        del old_node["properties"]
        node["properties"] = {
            "ports": [
                {
                    "interface": "eth1",
                    "name": "nat0",
                    "port_number": 0,
                    "type": "ethernet"
                }
            ]
        }
        if node["symbol"] is None:
            node["symbol"] = ":/symbols/cloud.svg"
        return node

    node["node_type"] = "qemu"
    if node["symbol"] is None:
        node["symbol"] = ":/symbols/qemu_guest.svg"
    return node
1067591
def modify(name, old_value, new_value)
      @attributes[name] = new_value
      if @modifications && (old_value != new_value)
        original = @modifications[name].first if @modifications[name]
        @modifications[name] = [ (original || old_value), new_value ]
      end
    end
638874
private static void replaceDestructuringAssignment(Node pattern, Node newLvalue, Node newRvalue) {
    Node parent = pattern.getParent();
    if (parent.isAssign()) {
      Node newAssign = IR.assign(newLvalue, newRvalue).srcref(parent);
      parent.replaceWith(newAssign);
    } else if (newLvalue.isName()) {
      checkState(parent.isDestructuringLhs());
      parent.replaceWith(newLvalue);
      newLvalue.addChildToBack(newRvalue);
    } else {
      pattern.getNext().detach();
      pattern.detach();
      parent.addChildToBack(newLvalue);
      parent.addChildToBack(newRvalue);
    }
  }
8429
function replace(oldNode, newNode){
    return oldNode[PARENT_NODE] ? oldNode[PARENT_NODE].replaceChild(newNode, oldNode) : oldNode;
  }
1110800
public function addMoved(ElementtypeStructureNode $oldNode, ElementtypeStructureNode $newNode)
    {
        $this->moved[] = ['oldNode' => $oldNode, 'newNode' => $newNode];

        return $this;
    }
1158824
public static NodeList<Element> copyNodeList(NodeList<Element> oldNodes,
      NodeList<Element> newNodes, boolean create) {
    NodeList<Element> ret = oldNodes == null || create ? JsNodeArray.create()
        : oldNodes;
    JsCache idlist = JsCache.create();
    for (int i = 0; oldNodes != null && i < oldNodes.getLength(); i++) {
      Element e = oldNodes.getItem(i);
      idlist.put(e.hashCode(), 1);
      if (create) {
        ret.<JsNodeArray> cast().addNode(e, i);
      }
    }
    for (int i = 0, l = newNodes.getLength(), j = ret.getLength(); i < l; i++) {
      Element e = newNodes.getItem(i);
      if (!idlist.exists(e.hashCode())) {
        ret.<JsNodeArray> cast().addNode(newNodes.getItem(i), j++);
      }
    }
    return ret;
  }
1104639
function changeConfig(oldConfig, newConfig) {
  invariant(isObject(oldConfig), 'Old config is not valid');
  invariant(isObject(newConfig), 'Config is not valid');

  if (newConfig.host) {
    var host = newConfig.host;
    var prefix = '';

    if (host.indexOf('http://') < 0 && host.indexOf('https://') < 0) {
      prefix += 'http://';
    }

    oldConfig.host = prefix + newConfig.host;
  }

  if (newConfig.port) {
    oldConfig.port = newConfig.port;
  }
}
630584
def replace(oldEl, newEl):
        # type: (Union[Rule, _RuleConnectable], Union[Rule, _RuleConnectable]) -> Union[Rule, _RuleConnectable]
        
        if isinstance(oldEl, Rule):
            return Manipulations.replaceRule(oldEl, newEl)
        if isinstance(oldEl, (Nonterminal, Terminal)):
            return Manipulations.replaceNode(oldEl, newEl)