<commit_before>from flask import Flask
from feedgen.feed import FeedGenerator
from lxml import etree
import urllib2
import hashlib


def error_xml(e):
    error = etree.Element("error")
    error.text = str(e)
    return etree.tostring(error, pretty_print=True, xml_declaration=True, encoding="utf-8")


class AtomGeneratorBase:

    # Redefine FeedGenerator.atom_str to return utf-8 string
    class _FeedGenerator(FeedGenerator):
        def atom_str(self, pretty=False, extensions=True):
            feed, doc = self._create_atom(extensions=extensions)
            return etree.tostring(feed, pretty_print=pretty, xml_declaration=True, encoding="utf-8")

    def _hash(self, str):
        return hashlib.sha256(str).hexdigest()

    def _src_key(self):
        return self.__module__ + ":source:" + self.src<commit_msg>Use new-style class<commit_after>from flask import Flask
from feedgen.feed import FeedGenerator
from lxml import etree
import urllib2
import hashlib


def error_xml(e):
    error = etree.Element("error")
    error.text = str(e)
    return etree.tostring(error, pretty_print=True, xml_declaration=True, encoding="utf-8")


class AtomGeneratorBase(object):

    # Redefine FeedGenerator.atom_str to return utf-8 string
    class _FeedGenerator(FeedGenerator):
        def atom_str(self, pretty=False, extensions=True):
            feed, doc = self._create_atom(extensions=extensions)
            return etree.tostring(feed, pretty_print=pretty, xml_declaration=True, encoding="utf-8")

    def _hash(self, str):
        return hashlib.sha256(str).hexdigest()

    def _src_key(self):
        return self.__module__ + ":source:" + self.src
{'fraction_non_alphanumeric': 0.10072376357056695, 'fraction_numerical': 0.008443908323281062, 'mean_word_length': 4.057926829268292, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '892624', 'n_tokens_mistral': 529, 'n_tokens_neox': 504, 'n_words': 121}