<commit_before>#!/usr/bin/env python
# -*- coding:utf-8 -*-

from edit import edit
import re

class TPHAttributes(object):
    """Class helping the edition of ticket attributes
    """

    def __init__(self, fields):
        """

        Arguments:
        - `fields`: The fields of the attributes to take into account. Not all
        the fields are relevant for edition. For instance, _ts or datetime are
        not meant to be edited.
        """
        self.fields = fields
        self.filter_exception = ["_ts",]

    def dump(self, attributes, ignore_empty=False):
        """From a dictionary of attributes, return a string to be edited.<commit_msg>Added basic logging facility<commit_after>#!/usr/bin/env python
# -*- coding:utf-8 -*-

from edit import edit
import re
import logging
logging.basicConfig()
logger = logging.getLogger(__file__)

class TPHAttributes(object):
    """Class helping the edition of ticket attributes
    """

    def __init__(self, fields):
        """

        Arguments:
        - `fields`: The fields of the attributes to take into account. Not all
        the fields are relevant for edition. For instance, _ts or datetime are
        not meant to be edited.
        """
        self.fields = fields
        self.filter_exception = ["_ts",]

    def dump(self, attributes, ignore_empty=False):
        """From a dictionary of attributes, return a string to be edited.
{'fraction_non_alphanumeric': 0.09723207948899928, 'fraction_numerical': 0.0014194464158978, 'mean_word_length': 2.671875, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1631482', 'n_tokens_mistral': 374, 'n_tokens_neox': 361, 'n_words': 147}