# Path: wallace/db.py
# def sessions_scope(local_session, commit=False):
# def scoped_session_decorator(func):
#     def wrapper(*args, **kwargs):
# def init_db(drop_all=False):


from datetime import datetime
from .db import Base
from sqlalchemy import ForeignKey, or_, and_
from sqlalchemy import (Column, String, Text, Enum, Integer, Boolean, DateTime,
                        Float)
from sqlalchemy.orm import relationship, validates
        from operator import attrgetter
        from transformations import Replication
        from transformations import Mutation
        from wallace.nodes import Source
import inspect
        :attr:`~wallace.models.SharedMixin.time_of_death` to now.

        """
        if self.failed is True:
            raise AttributeError(
                "Cannot fail {} - it has already failed.".format(self))
        else:
            self.failed = True
            self.time_of_death = timenow()

    def __json__(self):
        """Return json description of a question."""
        return {
            "id": self.id,
            "number": self.number,
            "type": self.type,
            "participant_id": self.participant_id,
            "question": self.question,
            "response": self.response,
            "failed": self.failed,
            "time_of_death": self.time_of_death,
            "creation_time": self.creation_time,
            "property1": self.property1,
            "property2": self.property2,
            "property3": self.property3,
            "property4": self.property4,
            "property5": self.property5
        }



# Path: wallace/db.py
# def sessions_scope(local_session, commit=False):
# def scoped_session_decorator(func):
#     def wrapper(*args, **kwargs):
# def init_db(drop_all=False):


# Path: wallace/models.py
from datetime import datetime
from .db import Base
from sqlalchemy import ForeignKey, or_, and_
from sqlalchemy import (Column, String, Text, Enum, Integer, Boolean, DateTime,
                        Float)
from sqlalchemy.orm import relationship, validates
        from operator import attrgetter
        from transformations import Replication
        from transformations import Mutation
        from wallace.nodes import Source
import inspect

        :attr:`~wallace.models.SharedMixin.time_of_death` to now.

        """
        if self.failed is True:
            raise AttributeError(
                "Cannot fail {} - it has already failed.".format(self))
        else:
            self.failed = True
            self.time_of_death = timenow()

    def __json__(self):
        """Return json description of a question."""
        return {
            "id": self.id,
            "number": self.number,
            "type": self.type,
            "participant_id": self.participant_id,
            "question": self.question,
            "response": self.response,
            "failed": self.failed,
            "time_of_death": self.time_of_death,
            "creation_time": self.creation_time,
            "property1": self.property1,
            "property2": self.property2,
            "property3": self.property3,
            "property4": self.property4,
            "property5": self.property5
        }



class Network(Base, SharedMixin):