def apply_entries(checkpoint, entries):
    """Recursively modifies `checkpoint` with `entries` values."""
    for field, value in entries.items():
        # Access the last dict (if nested) and modify it.
        to_edit = checkpoint
        bits = field.split('.')
        for bit in bits[:-1]:
            to_edit = to_edit[bit]
        to_edit[bits[-1]] = value

    return checkpoint