def set_snapshot_state(harn, snapshot_state):
    """
        Sets harness state based on a previous snapshot.

        This can be overrided for specific applications.  In this case,
        it is the users responsibility to ensure that this handles all relevant
        items returned by `harn.get_snapshot_state`.

        Args:
            snapshot_state (dict): information corresponding to
        """
    if 'epoch' in snapshot_state:
        harn.epoch = snapshot_state['epoch'] + 1
    if '_prev_iter_idxs' in snapshot_state:
        harn._prev_iter_idxs = snapshot_state['_prev_iter_idxs']
    if 'model_state_dict' in snapshot_state:
        harn.model.load_state_dict(snapshot_state['model_state_dict'])
        harn.debug('loaded model_state_dict')
    if 'monitor_state_dict' in snapshot_state:
        patience = harn.monitor.patience
        max_epoch = harn.monitor.max_epoch
        harn.monitor.load_state_dict(snapshot_state['monitor_state_dict'])
        harn.monitor.patience = patience
        harn.monitor.max_epoch = max_epoch
        harn.debug('loaded monitor_state_dict')
    if 'optimizer_state_dict' in snapshot_state:
        harn.optimizer.load_state_dict(snapshot_state['optimizer_state_dict'])
        harn.optimizer.zero_grad()
        harn.debug('loaded optimizer_state_dict')
    if 'scheduler_state_dict' in snapshot_state:
        harn.scheduler.load_state_dict(snapshot_state['optimizer_state_dict'])
        harn.debug('loaded scheduler_state_dict')
    if harn.scheduler:
        if getattr(harn.scheduler, '__batchaware__', False):
            harn.scheduler.reset_epoch(epoch=harn.epoch)
        elif harn.scheduler.__class__.__name__ == 'ReduceLROnPlateau':
            pass
        elif getattr(harn.scheduler, '__netharn_redesign__', False):
            harn.scheduler.step(epoch=harn.epoch)
        else:
            harn.scheduler.step(epoch=harn.epoch - 1)
