<commit_before># coding: utf-8
# vim: set ts=4 sw=4 expandtab sts=4:

import os
import datetime
from datetime import timedelta

import pytest
from click.testing import CliRunner

from khal.compat import to_bytes
from khal.cli import main_khal

from aux import _get_text


class CustomCliRunner(CliRunner):
    def __init__(self, config, db=None, calendars=None, **kwargs):
        self.config = config
        self.db = db
        self.calendars = calendars
        super(CustomCliRunner, self).__init__(**kwargs)

    def invoke(self, cli, args=None, *a, **kw):
        args = ['-c', str(self.config)] + (args or [])
        return super(CustomCliRunner, self).invoke(cli, args, *a, **kw)


@pytest.fixture
def runner(tmpdir):
    config = tmpdir.join('config.ini')
    db = tmpdir.join('khal.db')<commit_msg>relative import<commit_after># coding: utf-8
# vim: set ts=4 sw=4 expandtab sts=4:

import os
import datetime
from datetime import timedelta

import pytest
from click.testing import CliRunner

from khal.compat import to_bytes
from khal.cli import main_khal

from .aux import _get_text


class CustomCliRunner(CliRunner):
    def __init__(self, config, db=None, calendars=None, **kwargs):
        self.config = config
        self.db = db
        self.calendars = calendars
        super(CustomCliRunner, self).__init__(**kwargs)

    def invoke(self, cli, args=None, *a, **kw):
        args = ['-c', str(self.config)] + (args or [])
        return super(CustomCliRunner, self).invoke(cli, args, *a, **kw)


@pytest.fixture
def runner(tmpdir):
    config = tmpdir.join('config.ini')
    db = tmpdir.join('khal.db')
{'fraction_non_alphanumeric': 0.12384473197781885, 'fraction_numerical': 0.004929143561306223, 'mean_word_length': 3.680115273775216, 'pattern_counts': {'":': 0, '<': 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': '4287977', 'n_tokens_mistral': 559, 'n_tokens_neox': 544, 'n_words': 150}