code: def reset_downloads_folder():
      ''' Clears the downloads folder.
          If settings.ARCHIVE_EXISTING_DOWNLOADS is set to True, archives it. '''
      if os.path.exists(downloads_path) and not os.listdir(downloads_path) == []:
          archived_downloads_folder = os.path.join(downloads_path, '..',
                                                   ARCHIVE_DIR)
          if not "".join(sys.argv) == "-c":
              # Only move files if the test run is not multi-threaded.
              # (Running tests with "-n NUM" will create threads that only
              # have "-c" in the sys.argv list. Easy to catch.)
              reset_downloads_folder_assistant(archived_downloads_folderf reset_downloads_folder():
      ''' Clears the downloads folder.
          If settings.ARCHIVE_EXISTING_DOWNLOADS is set to True, archives it. '''
      if os.path.exists(downloads_path) and not os.listdir(downloads_path) == []:
          archived_downloads_folder = os.path.join(downloads_path, '..',
                                                   ARCHIVE_DIR)
          if not "".join(sys.argv) == "-c":
              # Only move files if the test run is not multi-threaded.
              # (Running tests with "-n NUM" will create threads that only
              # have "-c" in the sys.argv list. Easy to catch.)
              reset_downloads_folder_assistant(archived_downloads_folder)
docs: Clears the downloads folder.
          If settings.ARCHIVE_EXISTING_DOWNLOADS is set to True, archives it.