def reset_directory(directory):
    """
    Remove `directory` if it exists, then create it if it doesn't exist.
    """
    if os.path.isdir(directory): shutil.rmtree(directory)
    if not os.path.isdir(directory): os.makedirs(directory)
Remove `directory` if it exists, then create it if it doesn't exist.