<commit_before>"""
Workspace Server Database Model
"""

db_file = 'model.sqlite3'

import datetime, os

from sqlalchemy import create_engine
engine = create_engine('sqlite:///%s'%db_file)

from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()

from sqlalchemy import (Boolean, Column, DateTime, Integer, String, ForeignKey)
from sqlalchemy.orm import relation, backref

class Session(Base):
    """
    EXAMPLES::
    
        >>> drop_all(); create()<commit_msg>Added port table to database model.<commit_after>"""
Workspace Server Database Model
"""

db_file = 'model.sqlite3'

import datetime, os

from sqlalchemy import create_engine
engine = create_engine('sqlite:///%s'%db_file)

from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()

from sqlalchemy import (Boolean, Column, DateTime, Integer, String, ForeignKey)
from sqlalchemy.orm import relation, backref

class Port(Base):
    """
    EXAMPLES::

        >>> drop_all(); create()
        >>> S = session()
        >>> p = Port('frontend', 5000)    
        >>> p
        <model.Port object at...>
        >>> S.add(p)
        >>> S.add(Port('subprocess_server', 4999))
        >>> S.commit()
        >>> [(x.server, x.port) for x in S.query(Port).all()]
        [(u'frontend', 5000), (u'subprocess_server', 4999)]        
    """
    __tablename__ = "ports"
    server = Column(String, primary_key=True)
    port = Column(Integer)

    def __init__(self, server, port):
        self.server = str(server)
        self.port = int(port)

class Session(Base):
    """
    EXAMPLES::
    
        >>> drop_all(); create()
{'fraction_non_alphanumeric': 0.14075887392900857, 'fraction_numerical': 0.011015911872705019, 'mean_word_length': 3.3139841688654355, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 34, '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': '4767302', 'n_tokens_mistral': 533, 'n_tokens_neox': 512, 'n_words': 129}