<commit_before>"""Generate CSS according to settings."""
from django.core.management.base import BaseCommand
from happening.appearance import generate_css
from django.core.files.storage import default_storage
from django.core.files import File


class Command(BaseCommand):

    """Generate CSS according to settings."""

    help = 'Generate CSS according to settings.'

    def handle(self, *args, **options):
        """Generate CSS according to settings."""
        # if not c.
        if not default_storage.exists("css/generated.css"):
            # We'll create the file with rubbish in it
            # - to create the structure
            default_storage.save("css/generated.css",
                                 File(open("README.md")),
                                 content_type="text/css")
        with default_storage.open("css/generated.css", "w+") as o:
            o.write(generate_css())<commit_msg>generate css with correct mimetype<commit_after>"""Generate CSS according to settings."""
from django.core.management.base import BaseCommand
from happening.appearance import generate_css
from django.core.files.storage import default_storage
from django.core.files import File


class Command(BaseCommand):

    """Generate CSS according to settings."""

    help = 'Generate CSS according to settings.'

    def handle(self, *args, **options):
        """Generate CSS according to settings."""
        # if not c.
        if not default_storage.exists("css/generated.css"):
            # We'll create the file with rubbish in it
            # - to create the structure
            default_storage.save(
                "css/generated.css",
                # Ensure that we load a css file for mimetype
                File(open("static/lib/datatables.foundation/" +
                          "datatables.foundation.css")))
        with default_storage.open("css/generated.css", "w+") as o:
            o.write(generate_css())
{'fraction_non_alphanumeric': 0.10374935798664613, 'fraction_numerical': 0.0, 'mean_word_length': 2.497307001795332, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6029359', 'n_tokens_mistral': 493, 'n_tokens_neox': 476, 'n_words': 153}