'Reinitializes this RingBuilder instance from data obtained from the
builder dict given. Code example::
b = RingBuilder(1, 1, 1)  # Dummy values
b.copy_from(builder)
This is to restore a RingBuilder that has had its b.to_dict()
previously saved.'

def copy_from(self, builder):

    if hasattr(builder, 'devs'):
        self.part_power = builder.part_power
        self.next_part_power = builder.next_part_power
        self.replicas = builder.replicas
        self.min_part_hours = builder.min_part_hours
        self.parts = builder.parts
        self.devs = builder.devs
        self.devs_changed = builder.devs_changed
        self.overload = builder.overload
        self.version = builder.version
        self._replica2part2dev = builder._replica2part2dev
        self._last_part_moves_epoch = builder._last_part_moves_epoch
        self._last_part_moves = builder._last_part_moves
        self._last_part_gather_start = builder._last_part_gather_start
        self._remove_devs = builder._remove_devs
        self._id = getattr(builder, '_id', None)
    else:
        self.part_power = builder['part_power']
        self.next_part_power = builder.get('next_part_power')
        self.replicas = builder['replicas']
        self.min_part_hours = builder['min_part_hours']
        self.parts = builder['parts']
        self.devs = builder['devs']
        self.devs_changed = builder['devs_changed']
        self.overload = builder.get('overload', 0.0)
        self.version = builder['version']
        self._replica2part2dev = builder['_replica2part2dev']
        self._last_part_moves_epoch = builder['_last_part_moves_epoch']
        self._last_part_moves = builder['_last_part_moves']
        self._last_part_gather_start = builder['_last_part_gather_start']
        self._dispersion_graph = builder.get('_dispersion_graph', {})
        self.dispersion = builder.get('dispersion')
        self._remove_devs = builder['_remove_devs']
        self._id = builder.get('id')
    self._ring = None
    for dev in self._iter_devs():
        dev.setdefault('region', 1)
    if (not self._last_part_moves_epoch):
        self._last_part_moves_epoch = 0
