<commit_before># -*- coding: utf-8 -*-

from base import GhostBase
from sqlalchemy import Column, ForeignKey
from sqlalchemy import Integer, Numeric, String, DateTime, Boolean
from sqlalchemy.orm import relationship, backref
from sqlalchemy_utils import UUIDType


__all__ = ['Report', 'AltitudeReport', 'AudioReport',
           'LocationReport', 'PlacemarkReport', 'WeatherReport']


class Report(GhostBase):

    __tablename__ = 'reports'

    id = Column(UUIDType, primary_key=True)
    background = Column(Numeric)
    battery = Column(Numeric)
    connection = Column(Numeric)
    created_at = Column(DateTime(timezone=True))
    draft = Column(Boolean)
    report_impetus = Column(Integer)
    section_identifier = Column(String)
    steps = Column(Integer)

    responses = relationship(
        'Response', backref=backref('Report', order_by=id), passive_deletes=True)
    altitude_report = relationship(
        'AltitudeReport', backref=backref('Report'), passive_deletes=True)
    audio_report = relationship(
        'AudioReport', backref=backref('Report'), passive_deletes=True)
    location_report = relationship(
        'LocationReport', backref=backref('Report'), passive_deletes=True)
    weather_report = relationship(
        'WeatherReport', backref=backref('Report'), passive_deletes=True)

    def __str__(self):
        attrs = ['id', 'created_at', 'report_impetus', 'battery', 'steps',
            'section_identifier', 'background', 'connection', 'draft']
        super(report, self).__str__(attrs)

class AltitudeReport(GhostBase):

    __tablename__ = 'altitude_reports'

    id = Column(UUIDType, primary_key=True)
    floors_ascended = Column(Numeric)
    floors_descended = Column(Numeric)
    gps_altitude_from_location = Column(Numeric)
    gps_altitude_raw = Column(Numeric)
    pressure = Column(Numeric)
    pressure_adjusted = Column(Numeric)
    report_id = Column(
        UUIDType, ForeignKey('reports.id', ondelete='CASCADE'), nullable=False)

    def __str__(self):
        attrs = ['id', 'report_id', 'average', 'peak']
        super(AltitudeReport, self).__str__(attrs)
        

class AudioReport(GhostBase):

    __tablename__ = 'audio_reports'

    id = Column(UUIDType, primary_key=True)
    average = Column(Numeric)
    peak = Column(Numeric)
    report_id = Column(
        UUIDType, ForeignKey('reports.id', ondelete='CASCADE'), nullable=False)

    def __str__(self):
        attrs = ['id', 'report_id', 'average', 'peak']
        super(AudioReport, self).__str__(attrs)


class LocationReport(GhostBase):

    __tablename__ = 'location_reports'

    id = Column(UUIDType, primary_key=True)
    altitude = Column(Numeric)
    course = Column(Numeric)
    created_at = Column(DateTime(timezone=True))
    horizontal_accuracy = Column(Numeric)
    latitude = Column(Numeric)
    longitude = Column(Numeric)
    report_id = Column(
        UUIDType, ForeignKey('reports.id', ondelete='CASCADE'), nullable=False)
    speed = Column(Numeric)
    vertical_accuracy = Column(Numeric)

    placemark = relationship('PlacemarkReport', backref=backref(
        'location_reports', order_by=id), passive_deletes=True)

    def __str__(self):
        attrs = ['id', 'report_id', 'created_at', 'latitude',
            'longitudue', 'altitude', 'speed', 'course',
            'vertical_accuracy', 'horizontal_accuracy']
        super(LocationReport, self).__str__(attrs)


class PlacemarkReport(GhostBase):

    __tablename__ = 'placemark_reports'

    id = Column(UUIDType, primary_key=True)
    address = Column(String)
    city = Column(String)
    country = Column(String)<commit_msg>WIP fixing can't compare aware and naive datetimes.<commit_after># -*- coding: utf-8 -*-

from base import GhostBase
from sqlalchemy import Column, ForeignKey
from sqlalchemy import Integer, Numeric, String, DateTime, Boolean
from sqlalchemy.orm import relationship, backref
from sqlalchemy_utils import UUIDType


__all__ = ['Report', 'AltitudeReport', 'AudioReport',
           'LocationReport', 'PlacemarkReport', 'WeatherReport']


class Report(GhostBase):

    __tablename__ = 'reports'

    id = Column(UUIDType, primary_key=True)
    background = Column(Numeric)
    battery = Column(Numeric)
    connection = Column(Numeric)
    created_at = Column(DateTime(timezone=False))
    draft = Column(Boolean)
    report_impetus = Column(Integer)
    section_identifier = Column(String)
    steps = Column(Integer)

    responses = relationship(
        'Response', backref=backref('Report', order_by=id), passive_deletes=True)
    altitude_report = relationship(
        'AltitudeReport', backref=backref('Report'), passive_deletes=True)
    audio_report = relationship(
        'AudioReport', backref=backref('Report'), passive_deletes=True)
    location_report = relationship(
        'LocationReport', backref=backref('Report'), passive_deletes=True)
    weather_report = relationship(
        'WeatherReport', backref=backref('Report'), passive_deletes=True)

    def __str__(self):
        attrs = ['id', 'created_at', 'report_impetus', 'battery', 'steps',
            'section_identifier', 'background', 'connection', 'draft']
        super(report, self).__str__(attrs)

class AltitudeReport(GhostBase):

    __tablename__ = 'altitude_reports'

    id = Column(UUIDType, primary_key=True)
    floors_ascended = Column(Numeric)
    floors_descended = Column(Numeric)
    gps_altitude_from_location = Column(Numeric)
    gps_altitude_raw = Column(Numeric)
    pressure = Column(Numeric)
    pressure_adjusted = Column(Numeric)
    report_id = Column(
        UUIDType, ForeignKey('reports.id', ondelete='CASCADE'), nullable=False)

    def __str__(self):
        attrs = ['id', 'report_id', 'average', 'peak']
        super(AltitudeReport, self).__str__(attrs)
        

class AudioReport(GhostBase):

    __tablename__ = 'audio_reports'

    id = Column(UUIDType, primary_key=True)
    average = Column(Numeric)
    peak = Column(Numeric)
    report_id = Column(
        UUIDType, ForeignKey('reports.id', ondelete='CASCADE'), nullable=False)

    def __str__(self):
        attrs = ['id', 'report_id', 'average', 'peak']
        super(AudioReport, self).__str__(attrs)


class LocationReport(GhostBase):

    __tablename__ = 'location_reports'

    id = Column(UUIDType, primary_key=True)
    altitude = Column(Numeric)
    course = Column(Numeric)
    created_at = Column(DateTime(timezone=False))
    horizontal_accuracy = Column(Numeric)
    latitude = Column(Numeric)
    longitude = Column(Numeric)
    report_id = Column(
        UUIDType, ForeignKey('reports.id', ondelete='CASCADE'), nullable=False)
    speed = Column(Numeric)
    vertical_accuracy = Column(Numeric)

    placemark = relationship('PlacemarkReport', backref=backref(
        'location_reports', order_by=id), passive_deletes=True)

    def __str__(self):
        attrs = ['id', 'report_id', 'created_at', 'latitude',
            'longitudue', 'altitude', 'speed', 'course',
            'vertical_accuracy', 'horizontal_accuracy']
        super(LocationReport, self).__str__(attrs)


class PlacemarkReport(GhostBase):

    __tablename__ = 'placemark_reports'

    id = Column(UUIDType, primary_key=True)
    address = Column(String)
    city = Column(String)
    country = Column(String)
{'fraction_non_alphanumeric': 0.11893669498492737, 'fraction_numerical': 0.0002740476842970677, 'mean_word_length': 4.13652357494722, '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': '2609235', 'n_tokens_mistral': 2292, 'n_tokens_neox': 2223, 'n_words': 450}