import time


def task_storage(storage):
    """
    Demonstrates a periodic task accessing and modifying storage.
    """
    # Values in storage persist from call to call. Local variables do not

    # In case storage values haven't been passed in, set defaults
    storage.setdefault("a", 1)
    storage.setdefault("b", "A")

    # Do work
    print(storage)

    # Operate on storage
    storage["a"] += 1

    # Fetch from storage, operate
    tmp = storage["b"]
    tmp = chr((ord(tmp) - ord("A") + 1) % 26 + ord("A"))

    # Update storage
    # Note: for value to persist, it must be assigned back to storage
    storage["b"] = tmp

    # Sleep allows other threads to run
    time.sleep(1)

    return True