<commit_before>#  This Source Code Form is subject to the terms of the Mozilla Public
#  License, v. 2.0. If a copy of the MPL was not distributed with this
#  file, You can obtain one at http://mozilla.org/MPL/2.0/.

from django.db import models


class GenericSensor(models.Model):
    """Represents a sensor abstracting away the specifics of what it measures.

    A sensor measures one kind of thing. A physical device might have
    multiple logical sensors.
    """

    name = models.CharField(max_length=256)
    model = models.CharField(max_length=128)

    class Meta:
        unique_together = [('name', 'model')]


class Sensor(models.Model):
    """Base class for specific sensor types."""

    generic_sensor = models.OneToOneField(GenericSensor)

    class Meta:
        abstract = True<commit_msg>Add core.models.GenericEvent<commit_after>#  This Source Code Form is subject to the terms of the Mozilla Public
#  License, v. 2.0. If a copy of the MPL was not distributed with this
#  file, You can obtain one at http://mozilla.org/MPL/2.0/.

from django.db import models


class GenericSensor(models.Model):
    """Represents a sensor abstracting away the specifics of what it measures.

    A sensor measures one kind of thing. A physical device might have
    multiple logical sensors.
    """

    name = models.CharField(max_length=256)
    model = models.CharField(max_length=128)

    class Meta:
        unique_together = [('name', 'model')]


class Sensor(models.Model):
    """Base class for specific sensor types."""

    generic_sensor = models.OneToOneField(GenericSensor)

    class Meta:
        abstract = True


class GenericEvent(models.Model):
    """Represents a measurement event abstracting away what exactly is
    measured.
    """

    sensor = models.ForeignKey(GenericSensor)
    datetime = models.DateTimeField()
    value = models.CharField(max_length=128)
{'fraction_non_alphanumeric': 0.08947368421052632, 'fraction_numerical': 0.012105263157894737, 'mean_word_length': 3.400462962962963, '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': '2319796', 'n_tokens_mistral': 556, 'n_tokens_neox': 522, 'n_words': 198}