<commit_before>import argparse
import bz2
import gzip
import os
import re
import sys
import tempfile

from vimball._version import __version__
from vimball.exceptions import NoFilesFound
from vimball.utils import mkdir_p


class Vimball:
    def __init__(self, filepath, extractdir=None, verbose=False):
        self.filepath = filepath
        self.verbose = verbose

        filebase, extension = os.path.splitext(filepath)
        try:
            if extension == ".gz":
                self._file = gzip.open(filepath)
            elif extension == ".bz2":
                self._file = bz2.BZ2File(filepath)
            else:
                self._file = open(filepath)
        except IOError:
            raise SystemExit("That file doesn't exist!")
<commit_msg>add support for lzma compressed archives<commit_after>import argparse
import bz2
import gzip
import lzma
import os
import re
import sys
import tempfile

from vimball._version import __version__
from vimball.exceptions import NoFilesFound
from vimball.utils import mkdir_p


class Vimball:
    def __init__(self, filepath, extractdir=None, verbose=False):
        self.filepath = filepath
        self.verbose = verbose

        filebase, extension = os.path.splitext(filepath)
        try:
            if extension == ".gz":
                self._file = gzip.open(filepath)
            elif extension == ".bz2":
                self._file = bz2.BZ2File(filepath)
            elif extension == ".xz":
                self._file = lzma.open(filepath)
            else:
                self._file = open(filepath)
        except IOError:
            raise SystemExit("That file doesn't exist!")

{'fraction_non_alphanumeric': 0.07896323086196504, 'fraction_numerical': 0.004822182037371911, 'mean_word_length': 2.32, 'pattern_counts': {'":': 5, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1028423', 'n_tokens_mistral': 494, 'n_tokens_neox': 471, 'n_words': 134}