<commit_before>from sqlalchemy import (
    Column,
    Index,
    Integer,
    Text,
    Boolean,
    DateTime,
    Binary,
    ForeignKey
    )

from sqlalchemy.ext.declarative import declarative_base

from sqlalchemy.orm import (
    scoped_session,
    sessionmaker,
    relationship
    )

from zope.sqlalchemy import ZopeTransactionExtension

DBSession = scoped_session(sessionmaker(extension=ZopeTransactionExtension()))
Base = declarative_base()


class RasPi(Base):
    __tablename__ = 'PiUrl'
    uuid = Column(Text, primary_key=True)
    url = Column(Text)
    landscape = Column(Boolean)
    description = Column(Text)
    lastseen = Column(DateTime)
    ip = Column(Text)
    requested_commands = Column(Text)
    tags = relationship("Tags")


class Tags(Base):
    __tablename__ = 'Tags'
    id = Column(Integer, primary_key=True)
    tag = Column(Text)
    uuid = Column(Text, ForeignKey('PiUrl.uuid'))
    __table_args__ = (Index('idx_taglist', "tag", "uuid", unique=True), )


class Screenshot(Base):<commit_msg>add get_dict method to RasPi model<commit_after>from sqlalchemy import (
    Column,
    Index,
    Integer,
    Text,
    Boolean,
    DateTime,
    Binary,
    ForeignKey
    )

from sqlalchemy.ext.declarative import declarative_base

from sqlalchemy.orm import (
    scoped_session,
    sessionmaker,
    relationship
    )

from zope.sqlalchemy import ZopeTransactionExtension

DBSession = scoped_session(sessionmaker(extension=ZopeTransactionExtension()))
Base = declarative_base()


class RasPi(Base):
    __tablename__ = 'PiUrl'
    uuid = Column(Text, primary_key=True)
    url = Column(Text)
    landscape = Column(Boolean)
    description = Column(Text)
    lastseen = Column(DateTime)
    ip = Column(Text)
    requested_commands = Column(Text)
    tags = relationship("Tags")

    def get_dict(self):
        dict_ = {}
        for key in self.__mapper__.c.keys():
            dict_[key] = getattr(self, key)

        dict_['lastseen'] = str(self.lastseen)
        return dict_

class Tags(Base):
    __tablename__ = 'Tags'
    id = Column(Integer, primary_key=True)
    tag = Column(Text)
    uuid = Column(Text, ForeignKey('PiUrl.uuid'))
    __table_args__ = (Index('idx_taglist', "tag", "uuid", unique=True), )


class Screenshot(Base):
{'fraction_non_alphanumeric': 0.10526315789473684, 'fraction_numerical': 0.0, 'mean_word_length': 3.5528942115768465, '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': '1978493', 'n_tokens_mistral': 737, 'n_tokens_neox': 722, 'n_words': 156}