<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def comic_archive_uncompress(filename, image_format):
 """ Uncompress comic archives. Return the name of the working directory we uncompressed into. """

    if not Settings.comics:
        report = ['Skipping archive file: {}'.format(filename)]
        return None, ReportStats(filename, report=report)

    if Settings.verbose:
        truncated_filename = stats.truncate_cwd(filename)
        print("Extracting {}...".format(truncated_filename), end='')

    # create the tmpdir
    tmp_dir = _get_archive_tmp_dir(filename)
    if os.path.isdir(tmp_dir):
        shutil.rmtree(tmp_dir)
    os.mkdir(tmp_dir)

    # extract archvie into the tmpdir
    if image_format == _CBZ_FORMAT:
        with zipfile.ZipFile(filename, 'r') as zfile:
            zfile.extractall(tmp_dir)
    elif image_format == _CBR_FORMAT:
        with rarfile.RarFile(filename, 'r') as rfile:
            rfile.extractall(tmp_dir)
    else:
        report = '{} {} is not a good format'.format(filename, image_format)
        return None, ReportStats(filename, report=report)

    if Settings.verbose:
        print('done')

    return tmp_dir, None