<commit_before>"""Nox sessions."""
import contextlib
import shutil
import tempfile
from pathlib import Path
from typing import cast
from typing import Iterator

import nox
from nox.sessions import Session

package = "django_sorting_bootstrap"
python_versions = ["3.8", "3.7"]
nox.options.sessions = "lint", "safety", "mypy"
locations = "src", "noxfile.py"


class Poetry:
    """Helper class for invoking Poetry inside a Nox session.

    Attributes:
        session: The Session object.
    """

    def __init__(self, session: Session) -> None:
        """Constructor."""
        self.session = session

    @contextlib.contextmanager
    def export(self, *args: str) -> Iterator[Path]:
        """Export the lock file to requirements format.

        Args:
            args: Command-line arguments for ``poetry export``.

        Yields:
            The path to the requirements file.
        """
        with tempfile.TemporaryDirectory() as directory:
            requirements = Path(directory) / "requirements.txt"
            self.session.run(
                "poetry",
                "export",
                *args,<commit_msg>Fix session names<commit_after>"""Nox sessions."""
import contextlib
import shutil
import tempfile
from pathlib import Path
from typing import cast
from typing import Iterator

import nox
from nox.sessions import Session

package = "django_sorting_bootstrap"
python_versions = ["3.8", "3.7"]
nox.options.sessions = "pre-commit", "safety", "mypy", "tests"
locations = "src", "tests", "noxfile.py"


class Poetry:
    """Helper class for invoking Poetry inside a Nox session.

    Attributes:
        session: The Session object.
    """

    def __init__(self, session: Session) -> None:
        """Constructor."""
        self.session = session

    @contextlib.contextmanager
    def export(self, *args: str) -> Iterator[Path]:
        """Export the lock file to requirements format.

        Args:
            args: Command-line arguments for ``poetry export``.

        Yields:
            The path to the requirements file.
        """
        with tempfile.TemporaryDirectory() as directory:
            requirements = Path(directory) / "requirements.txt"
            self.session.run(
                "poetry",
                "export",
                *args,
{'fraction_non_alphanumeric': 0.10729800173761946, 'fraction_numerical': 0.0034752389226759338, 'mean_word_length': 2.5, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2695653', 'n_tokens_mistral': 649, 'n_tokens_neox': 614, 'n_words': 203}