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