<commit_before>import os
import shutil
import tempfile

import pytest

from osmaxx.conversion.converters.utils import recursive_getsize


@pytest.fixture
def directory_with_subdirectories(request):
    tempdir = tempfile.TemporaryDirectory()

    def rm_tmpdir():
        shutil.rmtree(tempdir.name)
    request.addfinalizer(rm_tmpdir)

    file_sizes = [102, 304, 10, 2000, 10, 678691, 1667, 1254]
    expected_size = sum(file_sizes)
    subdir = tempdir.name<commit_msg>add explanation for directory structures<commit_after>import os
import shutil
import tempfile

import pytest

from osmaxx.conversion.converters.utils import recursive_getsize


@pytest.fixture
def directory_with_subdirectories(request):
    """
    This creates the following file and directory structure
    <tmpdir>
        └── 102
            ├── 1
            │   ├── 10
            │   │   ├── 3
            │   │   │   ├── 10
            │   │   │   │   ├── 5
            │   │   │   │   │   ├── 1667
            │   │   │   │   │   │   ├── 7
            │   │   │   │   │   │   │   └── example_1254.file
            │   │   │   │   │   │   └── example_1667.file
            │   │   │   │   │   └── example_678691.file
            │   │   │   │   └── example_10.file
            │   │   │   └── example_2000.file
            │   │   └── example_10.file
            │   └── example_304.file
            └── example_102.file
    """
    tempdir = tempfile.TemporaryDirectory()

    def rm_tmpdir():
        shutil.rmtree(tempdir.name)
    request.addfinalizer(rm_tmpdir)

    file_sizes = [102, 304, 10, 2000, 10, 678691, 1667, 1254]
    expected_size = sum(file_sizes)
    subdir = tempdir.name
{'fraction_non_alphanumeric': 0.11549970077797726, 'fraction_numerical': 0.059245960502693, 'mean_word_length': 1.9078260869565218, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '947160', 'n_tokens_mistral': 742, 'n_tokens_neox': 589, 'n_words': 161}