<commit_before>from __future__ import unicode_literals, with_statement
import re
import os
import subprocess
from tempfile import NamedTemporaryFile

from django.utils.encoding import smart_str

from sorl.thumbnail.base import EXTENSIONS
from sorl.thumbnail.compat import b
from sorl.thumbnail.conf import settings
from sorl.thumbnail.engines.base import EngineBase
from sorl.thumbnail.compat import OrderedDict


size_re = re.compile(r'^(?:.+) (?:[A-Z]+) (?P<x>\d+)x(?P<y>\d+)')


class Engine(EngineBase):
    """
    Image object is a dict with source path, options and size
    """<commit_msg>Uses the NamedTemporaryFile class provided by Django<commit_after>from __future__ import unicode_literals, with_statement
import re
import os
import subprocess

from django.utils.encoding import smart_str
from django.core.files.temp import NamedTemporaryFile

from sorl.thumbnail.base import EXTENSIONS
from sorl.thumbnail.compat import b
from sorl.thumbnail.conf import settings
from sorl.thumbnail.engines.base import EngineBase
from sorl.thumbnail.compat import OrderedDict


size_re = re.compile(r'^(?:.+) (?:[A-Z]+) (?P<x>\d+)x(?P<y>\d+)')


class Engine(EngineBase):
    """
    Image object is a dict with source path, options and size
    """
{'fraction_non_alphanumeric': 0.10184442662389735, 'fraction_numerical': 0.0, 'mean_word_length': 5.303030303030303, 'pattern_counts': {'":': 0, '<': 7, '<?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': '4998831', 'n_tokens_mistral': 408, 'n_tokens_neox': 390, 'n_words': 118}