Restores itself, as well as objects that might have been deleted along with it if cascade is the deletion strategy
346824
def full_restore(self, using=None):
        using = using or router.db_for_write(self.__class__, instance=self)
        restore_counter = Counter()
        if self.deleted:
            time = self.deleted_at
        else:
            return restore_counter
        self.collector = models.deletion.Collector(using=using)
        self.collector.collect([self])
        

        for model, instances in self.collector.data.items():
            instances_to_delete = sorted(instances, key=attrgetter("pk"))

        self.sort()

        for qs in self.collector.fast_deletes:
            # TODO make sure the queryset delete has been made a soft delete
            for qs_instance in qs:
                restore_counter.update([qs_instance._meta.model_name])
                qs_instance.restore(time=time)

        for model, instances in self.collector.data.items():
            for instance in instances:
                restore_counter.update([instance._meta.model_name])
                instance.restore(time=time)

        return sum(restore_counter.values()), dict(restore_counter)

        
        self.collector = models.deletion.Collector(using=using) 
        self.collector.collect([self], keep_parents=keep_parents)
1170770
def ndeleted(self):
        """"""
        if not self._counters_calculated:
            self._counters_calculated = True
            self._extract_counters()

        return self._ndeleted
489917
public function restore()
    {
        if ($this->backup instanceof NotSet) {
            if (is_file($this->name)) {
                unlink($this->name);
            }
        } else {
            file_put_contents($this->name, $this->backup);
        }
    }
37138
def restore(self, game):
        
        self.observers = game.observers
        # self.undo_manager = game.undo_manager
        self.options = game.options
        self.players = game.players
        self.board.restore(game.board)
        self.robber = game.robber
        self.catanlog = game.catanlog

        self.state = game.state
        self.state.game = self

        self.dev_card_state = game.dev_card_state

        self._cur_player = game._cur_player
        self.last_roll = game.last_roll
        self.last_player_to_roll = game.last_player_to_roll
        self._cur_turn = game._cur_turn
        self.robber_tile = game.robber_tile

        self.notify_observers()
1324629
def restore(self):
        
        for expectation in self.exp_list:
            try:
                expectation.restore()
            except ReferenceError:
                pass #ignore removed expectation
        self._queue.remove(self)
117020
public function restore()
    {
        $this->offsetRef = $this->offset;
        $this->lineRef = $this->line;
        $this->rowRef = $this->row;
    }
523837
public function restore()
    {
        if ($this->backup instanceof NotSet) {
            unset($_SERVER[$this->name]);
        } else {
            $_SERVER[$this->name] = $this->backup;
        }
    }
110707
def restore_from_object(self, obj):
        

        info = pickle.loads(obj)
        data = info["data"]
        tmpdir = tempfile.mkdtemp("restore_from_object", dir=self.logdir)
        checkpoint_path = os.path.join(tmpdir, info["checkpoint_name"])

        for file_name, file_contents in data.items():
            with open(os.path.join(tmpdir, file_name), "wb") as f:
                f.write(file_contents)

        self.restore(checkpoint_path)
        shutil.rmtree(tmpdir)
1142877
function restore() {
    if (isPrevented) {
        const { body } = document;
        if (previousStyles) {
            body.setAttribute('style', previousStyles);
        } else {
            body.removeAttribute('style');
        }

        window.scrollTo(...previousPosition);
        resizeUtil.removeEventListener('', recalculate);
        isPrevented = false;
    }
}
1138188
def restore(self):
        
        try:
            for modname, mod in self._saved.items():
                if mod is not None:
                    sys.modules[modname] = mod
                else:
                    try:
                        del sys.modules[modname]
                    except KeyError:
                        pass
        finally:
            imp.release_lock()
297898
def restore
      restore_class = self.trashable_type.constantize
    
      sti_type = self.trashable_attributes[restore_class.inheritance_column]
      if sti_type
        begin
          if !restore_class.store_full_sti_class && !sti_type.start_with?("::")
            sti_type = "#{restore_class.parent.name}::#{sti_type}"
          end
          restore_class = sti_type.constantize
        rescue NameError => e
          raise e
          # Seems our assumption was wrong and we have no STI
        end
      end
    
      attrs, association_attrs = attributes_and_associations(restore_class, self.trashable_attributes)
    
      record = restore_class.new
      attrs.each_pair do |key, value|
        record.send("#{key}=", value)
      end
    
      association_attrs.each_pair do |association, attribute_values|
        restore_association(record, association, attribute_values)
      end
    
      return record
    end
538468
function safeRestoreStub(obj) {
    if (obj && 'restore' in obj && _.isFunction(obj.restore)) {
        obj.restore();
    }
}
1181331
public function restore()
    {
        // Restore settings before last override and delete override from stash
        if ($this->overrides) {
            $old = array_pop($this->overrides);
            $this->apply($old, $purge = true);

            return true;
        }

        return false;
    }
858650
def restore(self):
        
        if self._fire_model_event("restoring") is False:
            return False

        setattr(self, self.get_deleted_at_column(), None)

        self.set_exists(True)

        result = self.save()

        self._fire_model_event("restored")

        return result
55340
def do(self):
        
        self.restore_point = self.obj.copy()
        return self.do_method(self.obj, *self.args)
1354970
def reset(self):
        
        self.stack.append(Frame(src=None, src_path=None))
        return Close(functools.partial(self.restore))
919628
private function restore() {
        if (!HTTPCookie::exists($this->name)) return (object)[];
        
        return json_decode(Text::unlock(HTTPCookie::get($this->name)));
    }