def METHOD_NAME(self, old_block, new_block):
    if self.out_graph is None:
        self.out_graph = self._graph  # we do not make copy here for performance reasons. we can change it if needed
    if old_block not in self.out_graph:
        return
    in_edges = list(self.out_graph.in_edges(old_block, data=True))
    out_edges = list(self.out_graph.out_edges(old_block, data=True))
    self._remove_block(old_block)
    self.out_graph.add_node(new_block)
    self._blocks_by_addr[new_block.addr].add(new_block)
    self._blocks_by_addr_and_idx[(new_block.addr, new_block.idx)] = new_block
    for src, _, data in in_edges:
        if src is old_block:
            src = new_block
        self.out_graph.add_edge(src, new_block, **data)
    for _, dst, data in out_edges:
        if dst is old_block:
            dst = new_block
        self.out_graph.add_edge(new_block, dst, **data)