def METHOD_NAME(base_db, batch_db):
    with batch_db:
        batch_db.set(b"key-1", b"value-1")
        batch_db.set(b"key-2", b"value-2")
        assert batch_db.get(b"key-1") == b"value-1"
        assert batch_db.get(b"key-2") == b"value-2"
        # keys should not yet be set in base db.
        assert b"key-1" not in base_db
        assert b"key-2" not in base_db
        diff = batch_db.diff()
    assert base_db.get(b"key-1") == b"value-1"
    assert base_db.get(b"key-2") == b"value-2"
    example_db = {b"key-3": b"unrelated"}
    expected_result = {
        b"key-1": b"value-1",
        b"key-2": b"value-2",
        b"key-3": b"unrelated",
    }
    diff.apply_to(example_db)
    assert example_db == expected_result