<commit_before>from zope.interface import Interface
from zope import schema

class IQuery(Interface):
    """A database query"""
    query = schema.Text(
            title=_(u"A query to find events"),
            description=(u"Identifies the network address of the impacted host"),
            required = True
            )<commit_msg>add db query, result, and value interfaces<commit_after>from zope.interface import Interface
from zope import schema

#DB Query
class IQuery(Interface):
    """A database query"""
    query = schema.Text(
            title=_(u"A query to find events"),
            description=(u"Identifies the network address of the impacted host"),
            required = True
            )

#DB Query Results
class IQueryResultSet(IQuery):
    """A database query with results"""
    def __iter__():
        """Iterator of IResult objects"""

class IResult(Interface):
    """A single database query result (i.e. a row)"""

class ITableResult(IResult):
    """A single database query result represented as a Python dictionary whose
    key values are instances of ITableResultMultiValue or ITableResultValue

    Sample implementation:
        >>> from zope.interface import implements
        >>> class MyColumnarResult(dict):
        ...     implements(IColumnarResult)
    """

#DB Query Result Values
class ITableResultValue(Interface):
    """A value from a database query result (i.e. a table cell)"""
    def __unicode__():
        """Return unicode string representation of value"""

class ITableResultMultiValue(Interface):
    """A value for a ITableResult key that allows for multi-value fields"""
    def __iter__():
        """Iterator of unicode capable values"""
{'fraction_non_alphanumeric': 0.09523809523809523, 'fraction_numerical': 0.0, 'mean_word_length': 3.1818181818181817, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '5358768', 'n_tokens_mistral': 431, 'n_tokens_neox': 421, 'n_words': 169}