<commit_before>#
# Copyright (c) 2008 <NAME> <<EMAIL>>
# Project homepage: <http://code.google.com/p/blixt/>
#
# License: MIT license <http://www.opensource.org/licenses/mit-license.php>
#

"""Data-related Google App Engine extensions.
"""

from google.appengine.ext import db

import sys

class Error(Exception):
    """Base of all exceptions in the blixt.data module."""
    pass

class PolyModel(db.Model):
    """An extension to Google App Engine models that improves the support for
    inheritance.

    Any models extending a model that extends PolyModel will be stored in the
    datastore as the same kind as the model that extends PolyModel, but with
    their additional properties. When they are retrieved from the datastore,
    they will be loaded as the appropiate model class.

    The difference from the Model class is that queries will include models that
    inherit from the model being queried.
    """
    inheritance_line = db.StringListProperty()

    def __init__(self, parent = None, key_name = None, _app = None, **kwds):
        """Creates a new instance of this polymorphic model.

        Args:
          parent: Parent instance for this instance or None, indicating a top-
            level instance.
          key_name: Name for new model instance.
          _app: Intentionally undocumented.<commit_msg>Add ModelWithFieldAttributes *before* PolyModel, so that everything does not become a "ModelWithFieldAttributes" in the Datastore.<commit_after>#
# Copyright (c) 2008 <NAME> <<EMAIL>>
# Project homepage: <http://code.google.com/p/blixt/>
#
# License: MIT license <http://www.opensource.org/licenses/mit-license.php>
#

"""Data-related Google App Engine extensions.
"""

from google.appengine.ext import db

import sys

# Add ModelWithFieldAttributes *before* PolyModel, so that everything does
# not become a "ModelWithFieldAttributes" in the Datastore.
from soc.models import base

class Error(Exception):
    """Base of all exceptions in the blixt.data module."""
    pass

class PolyModel(base.ModelWithFieldAttributes):
    """An extension to Google App Engine models that improves the support for
    inheritance.

    Any models extending a model that extends PolyModel will be stored in the
    datastore as the same kind as the model that extends PolyModel, but with
    their additional properties. When they are retrieved from the datastore,
    they will be loaded as the appropiate model class.

    The difference from the Model class is that queries will include models that
    inherit from the model being queried.
    """
    inheritance_line = db.StringListProperty()

    def __init__(self, parent = None, key_name = None, _app = None, **kwds):
        """Creates a new instance of this polymorphic model.

        Args:
          parent: Parent instance for this instance or None, indicating a top-
            level instance.
          key_name: Name for new model instance.
          _app: Intentionally undocumented.
{'fraction_non_alphanumeric': 0.07627688172043011, 'fraction_numerical': 0.002688172043010753, 'mean_word_length': 3.416913946587537, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7358496', 'n_tokens_mistral': 801, 'n_tokens_neox': 768, 'n_words': 344}