def _extract_archive(file, target_dir):
if file.endswith('<STR_LIT>') or file.endswith('<STR_LIT>') or file.endswith('<STR_LIT>'):<EOL><INDENT>archive = tarfile.open(file, '<STR_LIT:r>')<EOL><DEDENT>elif file.endswith('<STR_LIT>'):<EOL><INDENT>archive = zipfile.ZipFile(file, '<STR_LIT:r>')<EOL><DEDENT>else:<EOL><INDENT>raise Exception('<STR_LIT>' + file)<EOL><DEDENT>archive.extractall(path=target_dir)<EOL>archive.close()<EOL>
Extract archive file

    Parameters
    ----------
    file : str
        Absolute path of the archive file.
    target_dir : str
        Target directory of the archive to be uncompressed