def METHOD_NAME(ext: str, source: IO[bytes], dest_path: str):
    """Unpack the archive |source| to |dest_path|.
    Args:
        ext (str): Extension of the archive.
        source (IO[bytes]): File handle to the source.
        dest_path ([type]): Destination path to unpack to.
    """
    try:
        if ext == '.tar.gz' or ext == '.tgz':
            un_tar_directory(source, dest_path, 'gz')
        elif ext == '.tar.bz2':
            un_tar_directory(source, dest_path, 'bz2')
        elif ext == '.bz2':
            un_bz2_file(source, dest_path)
        elif ext == '.gz':
            with open(dest_path, 'wb') as f:
                shutil.copyfileobj(un_gzip_stream(source), f)
        elif ext == '.zip':
            unzip_directory(source, dest_path)
        else:
            raise UsageError('Not an archive.')
    except (tarfile.TarError, IOError) as e:
        logging.error("Invalid archive upload: failed to unpack archive: %s", e)
        raise UsageError('Invalid archive upload: failed to unpack archive.')