Esempio n. 1
0
class Lane_connector(elixir.Entity, Road_item_with_polyline,
                     Road_item_with_obstacle_points):
    elixir.using_options(tablename="lane_connectors")
    lanes = elixir.ManyToMany("Lane")
    database_polyline = elixir.Field(elixir.Binary)
    obstacle_points = elixir.Field(elixir.Binary)
    turning_radius = elixir.Field(elixir.Float)
Esempio n. 2
0
class File(elixir.Entity):
    #parent = elixir.ManyToOne('File')
    #children = elixir.OneToMany('File')
    evidence = elixir.ManyToOne('Evidence')
    filesystem = elixir.ManyToOne('Filesystem')
    state = elixir.ManyToOne('FileState')
    filename = elixir.Field(elixir.Unicode(300), index=True)
    filesize = elixir.Field(elixir.Integer)
    fullpath = elixir.ManyToOne('FullPath')
    extension = elixir.ManyToOne('Extension')
    mimetype = elixir.ManyToOne('MimeType')
    md5 = elixir.ManyToOne('Md5')
    sha1 = elixir.ManyToOne('Sha1')
    sha256 = elixir.ManyToOne('Sha256')
    ssdeep = elixir.ManyToOne('Ssdeep')

    def fullFileSpec(self, hashtype='md5'):
        fp = os.path.join(self.fullpath.fullpath, self.filename)
        fsize = fritutils.humanize(self.filesize)
        hashes = {
            'md5': self.md5.md5,
            'sha1': self.sha1.sha1,
            'sha256': self.sha256.sha256,
            'ssdeep': self.ssdeep.ssdeep
        }
        fhash = 'NO_HASH_COMPUTED'
        if hashes[hashtype]:
            fhash = hashes[hashtype]
        specs = '%s,%s,%s: "%s" ,%s/%s,"%s"' % (
            self.state.state, fsize, hashtype, fhash, self.evidence.configName,
            self.filesystem.configName, fp)
        return specs

    def __repr__(self):
        return os.path.join(self.fullpath.fullpath, self.filename)
Esempio n. 3
0
class Order(el.Entity):
    name = el.Field(el.String(100))
    status = el.ManyToOne(Status)
    customer = el.ManyToOne(People)
    assignee = el.ManyToOne(People)
    delivery = el.Field(el.Boolean)
    address = el.Field(el.String(200))
    items = el.OneToMany('Item')
Esempio n. 4
0
class Platform(elixir.Entity):
    """ 
        The Platform model. Contains the platform name and a download link.
        Allows for querying the platforms of a game, and all games of a
        platform. Many games can have many platforms.
    """

    name = elixir.Field(elixir.String(40))
    download = elixir.Field(elixir.String(512))
    games = elixir.ManyToMany("Game")

    def __repr__(self):
        return "<Platform '%s' (%s)>" % (self.name, self.download)
Esempio n. 5
0
class User(elixir.Entity):
    """ 
        The User model. Contains all information about a user
        and allows querying. One user can have many games
    """

    name = elixir.Field(elixir.String(40), unique=True)
    password = elixir.Field(elixir.String(512))
    email = elixir.Field(elixir.String(50))

    participated = elixir.ManyToMany("Event")
    games = elixir.OneToMany("Game")
    ratings = elixir.OneToMany("Rating")

    def __repr__(self):
        return "<User '%s' (%s)>" % (self.name, self.email)
Esempio n. 6
0
class Game(elixir.Entity):
    """ 
        The Game model. Contains all information about a game
        and allows querying. Many games can have one user.
    """

    name = elixir.Field(elixir.String(40), unique=True)
    description = elixir.Field(elixir.String(512))
    image = elixir.Field(elixir.String(512))

    author = elixir.ManyToOne("User")
    platforms = elixir.ManyToMany("Platform")
    ratings = elixir.ManyToMany("Rating")
    event = elixir.ManyToOne("Event")

    def __repr__(self):
        return "<Game '%s' by %s>" % (self.name, self.author.name)
Esempio n. 7
0
class Compatibility(elixir.Entity):
    compatibility = elixir.Field(types.Integer)
    user1 = elixir.ManyToOne('popserver.model.users.User', 
                             colname='user1_id', ondelete='cascade',
                             primary_key=True)
    user2 = elixir.ManyToOne('popserver.model.users.User',
                             colname='user2_id', ondelete='cascade',
                             primary_key=True)
    elixir.using_options(tablename='compatibility')
Esempio n. 8
0
class Lane(elixir.Entity, Road_item_with_polyline,
           Road_item_with_obstacle_points):
    """A lane represents a lane, in particularly the polyline field represents the lane's center-
    line; vehicles should be travelling along this polyline unless the driver intends to change
    lanes."""
    elixir.using_options(tablename="lanes")
    # "max_traffic_rules" is just a placeholder, it is not a valid rule.  The traffic_rules is
    # a string of '0' and '1', one for each of the rules above, not including "max_traffic_rules".
    traffic_rules = elixir.Field(elixir.Text,
                                 required=True,
                                 default='0' * (len(traffic_flags) - 1))
    database_polyline = elixir.Field(elixir.Binary)
    database_obstacle_points = elixir.Field(elixir.Binary)
    # A road segment has one or more lanes.  In each road-segment the lanes are numbered from right
    # to left when we are facing in the forward traffic flow.  The lane_index is the 0-based number.
    road_segment = elixir.ManyToOne("Road_segment")
    lane_index = elixir.Field(elixir.SmallInteger)
    width = elixir.Field(elixir.Float)
    lane_connectors = elixir.ManyToMany("Lane_connector")
Esempio n. 9
0
class Event(elixir.Entity):
    """
        The Event model. Contains all information regarding an event.
        This includes from when to when it's happening, the submitted games,
        and which users participated. Includes the theme.

        Many events can have many users and many games.
    """

    start = elixir.Field(elixir.DateTime(512))
    end = elixir.Field(elixir.DateTime(512))

    name = elixir.Field(elixir.String(512))
    theme = elixir.Field(elixir.String(256))
    voting = elixir.Field(elixir.Boolean())

    games = elixir.OneToMany("Game")
    participants = elixir.ManyToMany("User")

    def __repr__(self):
        return "<Event '%s' (%s - %s)>" % (self.name, self.start, self.end)
Esempio n. 10
0
class BotMovesMapped(elixir.Entity):
  """ Stores a flag for each state where all valid moves have been played
  through """
  
  state = elixir.Field(elixir.String(), primary_key=True)
  
  @staticmethod
  def has(state):
    """ returns True if state string found in valid moves mapped table,
    else False """
    
    from botmoves import BotMoves
    return bool(BotMoves.find_state(state, my=BotMovesMapped))
Esempio n. 11
0
class Rating(elixir.Entity):
    """ 
        The Rating model. Contains the a rating value.
		This value can be applied to a game and a user.
		Allows for checking game ratings and ratings a user has given.
    """

    value = elixir.Field(elixir.Float(4))
    games = elixir.ManyToMany("Game")
    user = elixir.ManyToOne("User")

    def __repr__(self):
        return "<Rating %s>" % (self.value)
Esempio n. 12
0
class Lane_edge(elixir.Entity, Road_item_with_polyline):
    """A lane-edge is one of the 2 lines that mark out the boundary of a lane.  It can also be
    a polyline that "connects" a pedestrian crossing to the adjacent pedestrian crossing so that
    the road-network looks "pretty" in the visualizer.  A lane-edge can also be a yellow-box or
    a bus zone.
    Lane-edges should only be useful to the visualizer and not the simulator unless the driver
    needs to know the outer edges of each lane."""
    elixir.using_options(tablename="lane_edges")
    marking_type = elixir.Field(elixir.Text)
    database_polyline = elixir.Field(elixir.Binary)

    def __repr__(self):
        return "lane-edge type='%s'" % (self.marking_type)

    def road_info(self):
        info =   "lane-edge={\n" \
               + "    marking-type='%s' (%s)\n" % (self.marking_type,
                                                   Road_network.lane_edge_types[self.marking_type]) \
               + "    polyline={\n"
        for i, point in enumerate(self.polyline):
            info = info + "        %4d   %s\n" % (i, point)
        info = info + "    }\n}\n"
        return info
Esempio n. 13
0
class InterestClusterNS(Tree, elixir.Entity):
    elixir.using_options(tablename='interest_cluster_nested_set')
    id = elixir.Field(types.Integer, primary_key=True)
    lft = elixir.Field(types.Integer, colname='lft')
    rgt = elixir.Field(types.Integer, colname='rgt')
    _interests = elixir.ManyToMany('Tag', tablename='node_interests')
    centralInterests = elixir.ManyToMany('Tag',
                                         tablename='node_central_interests')

    def __init__(self, *args, **kwargs):
        elixir.Entity.__init__(self, *args, **kwargs)
        Tree.__init__(self)

    def interests(self):
        if len(self.children) > 0:
            return reduce(lambda acc, child: acc + child.interests(),
                          self.children, [])
        else:
            return self._interests

    def subtree(self):
        nodes = InterestClusterNS.query.from_statement(TREE_QUERY)\
            .params(parentId=self.id).all()
        return preorder2Tree([self] + nodes)
Esempio n. 14
0
class Cast(elixir.Entity):
    movie = elixir.ManyToOne(Movie)
    character = elixir.Field(elixir.String)
    actor = elixir.Field(elixir.String)
Esempio n. 15
0
class Movie(elixir.Entity):
    title = elixir.Field(elixir.String)
    director = elixir.Field(elixir.String)
    genre = elixir.ManyToMany('Genre')
    cast = elixir.OneToMany('Cast')
Esempio n. 16
0
class FileState(elixir.Entity):
    state = elixir.Field(elixir.Unicode(20))
Esempio n. 17
0
class Genre(elixir.Entity):
    name = elixir.Field(elixir.String)

    def __unicode__(self):
        return self.name
Esempio n. 18
0
class Road(elixir.Entity):
    elixir.using_options(tablename="roads")
    links = elixir.OneToMany("Link")
    name = elixir.Field(elixir.Text)
Esempio n. 19
0
class Extension(elixir.Entity):
    extension = elixir.Field(elixir.Unicode(50), index=True)
    files = elixir.OneToMany('File')
Esempio n. 20
0
class FullPath(elixir.Entity):
    fullpath = elixir.Field(elixir.Unicode(900), index=True)
    files = elixir.OneToMany('File')
Esempio n. 21
0
class Sha256(elixir.Entity):
    sha256 = elixir.Field(elixir.Unicode(64), index=True)
    files = elixir.OneToMany('File')
Esempio n. 22
0
 class Movie(e.Entity):
     title = e.Field(e.Unicode(30), primary_key=True)
     year = e.Field(e.Integer, primary_key=True)
     description = e.Field(e.UnicodeText, deferred=True)
     director = e.ManyToOne('Director')
     genres = e.ManyToMany('Genre')
Esempio n. 23
0
 class Person(e.Entity):
     name = e.Field(e.Unicode(60), primary_key=True)
Esempio n. 24
0
    class Genre(e.Entity):
        name = e.Field(e.Unicode(15), primary_key=True)
        movies = e.ManyToMany('Movie')

        def __repr__(self):
            return '<Genre "%s">' % self.name
Esempio n. 25
0
class MimeType(elixir.Entity):
    mimetype = elixir.Field(elixir.Unicode(150))
    files = elixir.OneToMany('File')
Esempio n. 26
0
class Md5(elixir.Entity):
    md5 = elixir.Field(elixir.Unicode(32), index=True)
    files = elixir.OneToMany('File')
Esempio n. 27
0
class BotMoves(elixir.Entity):
    """ Interface for database of bot moves """

    # State of the game before the bot's move is made in standard notation
    state = elixir.Field(elixir.String(), primary_key=True)

    # Bot's move in standard notation
    move = elixir.Field(elixir.String())

    # Number of games the move has been played in
    played = elixir.Field(elixir.Integer(), default=1, index=True)

    # Number of games won using this move
    wins = elixir.Field(elixir.Integer(), default=0)

    # Number of games lost using this move
    losses = elixir.Field(elixir.Integer(), default=0)

    # Number of games drawn using this move
    draws = elixir.Field(elixir.Integer(), default=0)

    # Number of times in-a-row this move has been played
    played_in_sequence = elixir.Field(elixir.Integer(), default=1)

    # Probability of win
    winp = elixir.Field(elixir.Float(), default=0.0, index=True)

    # Probabilty of loss
    lossp = elixir.Field(elixir.Float(), default=0.0, index=True)

    # Probability of draw
    drawp = elixir.Field(elixir.Float(), default=0.0, index=True)

    # Square number translation tables
    _rot90 = [7, 4, 1, 8, 5, 2, 9, 6, 3]
    _rot180 = [9, 8, 7, 6, 5, 4, 3, 2, 1]
    _rot270 = [3, 6, 9, 2, 5, 8, 1, 4, 7]
    _fliph = [3, 2, 1, 6, 5, 4, 9, 8, 7]
    _flipv = [7, 8, 9, 4, 5, 6, 1, 2, 3]
    _table = {
        '0': [_rot90],
        '-0': [_rot270],
        '1': [_rot180],
        '-1': [_rot180],
        '2': [_rot270],
        '-2': [_rot90],
        'v': [_flipv],
        '-v': [_flipv],
        'h': [_fliph],
        '-h': [_fliph],
        '0h': [_rot90, _fliph],
        '-0h': [_fliph, _rot270],
        '0v': [_rot90, _flipv],
        '-0v': [_flipv, _rot270]
    }
    _valid_keys = [None, '0', '1', '2', 'v', 'h', '0v', '0h']

    @staticmethod
    def update_state(state, move, outcome):
        """ Update (or create) outcome probabilities for a game state
    and move combo
    
    Arguments:
      state and move: standard notation game strings
      outcome: array of player scores [ player, bot ]
    """

        from bot import Bot
        game = BotMoves.find_state(state, move)
        outcome = BotMoves.outcome(outcome)
        if game:
            if game[0].count() > 1:  # Dup!
                # Use the most played move
                dups = []
                for game in game[0]:
                    dups.append(game)
                dups.sort(key=lambda g: g.played, reverse=True)
                for i in range(1, len(dups)):
                    dups[i].delete()
                game = dups[0]
            else:
                game = game[0].one()
            game.played += 1
            if outcome == 1: game.wins += 1
            elif outcome == 0: game.draws += 1
            else: game.losses += 1
            game.winp = float(game.wins) / float(game.played)
            game.lossp = float(game.losses) / float(game.played)
            game.drawp = float(game.draws) / float(game.played)
            if game.played_in_sequence >= Bot.noise_factor():
                game.played_in_sequence = 0
            else:
                game.played_in_sequence += 1
            elixir.session.commit()
            # Add mapped flag if all valid moves have been played
            from botmovesmapped import BotMovesMapped
            if not BotMovesMapped.has(game.state):
                from state import State
                state = State(game.state)
                if not Bot.get_missing_move(state):
                    BotMovesMapped(state=game.state)
                    elixir.session.commit()
        else:
            # Create new record
            w = d = l = 0
            if outcome == 1: w = 1
            elif outcome == 0: d = 1
            else: l = 1
            BotMoves(state=state,
                     move=move,
                     wins=w,
                     draws=d,
                     losses=l,
                     winp=float(w),
                     drawp=float(d),
                     lossp=float(l))
            elixir.session.commit()

    @staticmethod
    def translate(moves, key):
        """ Translates a pliable move list based on the key """

        if not key: return moves
        tables = BotMoves._table[key]
        out = []
        for move in moves:
            out.append(move)
        for table in tables:
            for i in range(len(out)):
                sq1 = table[out[i][0] - 1] if out[i][0] > 0 else 0
                sq2 = table[out[i][1] - 1] if out[i][1] > 0 else 0
                if sq1 > sq2: sq1, sq2 = sq2, sq1
                out[i] = (sq1, sq2)
        return out

    @staticmethod
    def find_states(state):
        """ Finds all game states of any orientation that equal state. """

        states = [state]
        my = BotMoves

        def t(state, k):
            return my.translate(state, k)

        a = BotMoves.pliable(state)
        t = BotMoves.translate
        s = BotMoves.searchable
        # Look for game rotated 90 degrees
        a90 = t(a, '0')
        states.append(s(a90))
        # Look for game rotated 180 degrees
        a180 = t(a90, '0')
        states.append(s(a180))
        # Look for game rotated 270 degrees
        states.append(s(t(a180, '0')))
        # Look for game flipped vertically
        states.append(s(t(a, 'v')))
        # Look for game flipped horizontally
        states.append(s(t(a, 'h')))
        # Look for game flipped vertically and rotated 90 degrees
        states.append(s(t(a90, 'v')))
        # Look for game flipped horizontally and rotated 90 degrees
        states.append(s(t(a90, 'h')))
        return my.query.filter(my.state.in_(states))

    @staticmethod
    def find_state(state, move=None, outcome=None, key=None, my=None):
        """ Finds a game state in the DB or returns None.
    state is a game state in standard notation.
    Looks for games of the supplied state in different variations
    and optionally with the same move and outcome.
    
    Arguments:
      state: game string in standard notation
      move: one or two game moves in standard notation (two moves in the
            case that the the first move is a collapse)
      outcome: an integer where -1 = bot loss, 0 = draw, 1 = bot win
    
    Returns an array
    [ 0: the game records in the DB,
      1: the key used to transform the supplied state into the
         variation found in the DB ]
    
    If key is None, then the game was stored in the database in the same
    format supplied Key is a string consisting of any of these (although
    some combinations are not supported because they are redundant)
      0: The state was rotated 90 degrees
      1: The state was rotated 180 degrees
      2: The state was rotated 270 degrees
      v: The state was flipped vertically
      h: The state was flipped horizontally
    Supported keys: 0, 1, 2, h, v, 0h, 0v
    """

        if not my: my = BotMoves

        def get(state, move=None, outcome=None):
            # Get helper: return query object for oriented state string
            q = my.query.filter_by(state=BotMoves.searchable(state))
            if move: q.filter_by(move=BotMoves.searchable(move))
            if outcome:
                if outcome == 1: q.filter_by(wins=1)
                elif outcome == 0: q.filter_by(draws=1)
                else: q.filter_by(losses=1)
            return q

        def t(state, k):
            return my.translate(state, k)

        a = BotMoves.pliable(state)
        m = BotMoves.pliable(move) if move else None
        # key provided?
        if key: return get(t(a, key), t(m, key), outcome)
        t = BotMoves.translate
        # Look for game
        k = None
        games = get(a, m, outcome)
        if not games.count():
            # Look for game rotated 90 degrees
            k = '0'
            a90 = t(a, k)
            m90 = t(m, k) if m else None
            games = get(a90, m90, outcome)
            if not games.count():
                # Look for game rotated 180 degrees
                k = '1'
                a180 = t(a90, '0')
                m180 = t(m90, '0') if m else None
                games = get(a180, m180, outcome)
                if not games.count():
                    # Look for game rotated 270 degrees
                    k = '2'
                    games = get(t(a180, '0'),
                                t(m180, '0') if m else None, outcome)
                    if not games.count():
                        # Look for game flipped vertically
                        k = 'v'
                        games = get(t(a, k), t(m, k) if m else None, outcome)
                        if not games.count():
                            # Look for game flipped horizontally
                            k = 'h'
                            games = get(t(a, k),
                                        t(m, k) if m else None, outcome)
                            if not games.count():
                                # Look for game flipped vertically and rotated 90 degrees
                                k = '0v'
                                games = get(t(a90, 'v'),
                                            t(m90, 'v') if m else None,
                                            outcome)
                                if not games.count():
                                    # Look for game flipped horizontally and rotated 90 degrees
                                    k = '0h'
                                    games = get(t(a90, 'h'),
                                                t(m90, 'h') if m else None,
                                                outcome)
                                    if not games.count(): return None
        return [games, k]

    @staticmethod
    def transform(state, key):
        """ Perform quick re-orientation on a movelist """

        if key == None: return state
        return BotMoves.searchable( \
          BotMoves.translate( \
            BotMoves.pliable(state), key))

    @staticmethod
    def fix(state, key):
        """ Perform quick un-re-orientation on a movelist """

        if key == None: return state
        return BotMoves.searchable( \
          BotMoves.translate( \
            BotMoves.pliable(state), '-%s'%key if key[0] != '-' else key[1:]))

    @staticmethod
    def pliable(state):
        """ Returns an array of tuples of the supplied game string
    [ (sq1, sq2), ... ]
    
    Opposite of searchable(moves)
    
    state is a game state string in standard notation
    """

        out = []
        for move in state.split('/'):
            out.append((int(move[0]), int(move[1])))
        return out

    @staticmethod
    def searchable(moves):
        """ Returns a standard notation string based on the supplied array of
    move tuples
    
    Opposite of pliable
    """

        out = []
        for move in moves:
            out.append('%d%d' % (move[0], move[1]))
        return '/'.join(out)

    @staticmethod
    def outcome(scores):
        """ Returns integer describing the game outcome:
    -1 for player win, 0 for draw, 1 for bot win """

        if scores[0] == scores[1]: return 0
        elif scores[0] > scores[1]: return -1
        return 1
Esempio n. 28
0
class Road_segment(elixir.Entity):
    elixir.using_options(tablename="road_segments")
    lanes = elixir.OneToMany("Lane")
    link = elixir.ManyToOne("Link")
    segment_index = elixir.Field(elixir.SmallInteger)
    is_forward = elixir.Field(elixir.Boolean)
Esempio n. 29
0
class Blackboard(elixir.Entity):
    elixir.using_options(tablename='blackboard')

    MyType = elixir.Field(elixir.Unicode(255))
    TargetType = elixir.Field(elixir.Unicode(255))
    GlobalJobId = elixir.Field(elixir.Unicode(255), primary_key=True)
    ProcId = elixir.Field(elixir.Integer)
    AutoClusterId = elixir.Field(elixir.Integer)
    AutoClusterAttrs = elixir.Field(elixir.Unicode(255))
    WantMatchDiagnostics = elixir.Field(elixir.Boolean)
    LastMatchTime = elixir.Field(elixir.DateTime)
    LastRejMatchTime = elixir.Field(elixir.DateTime)
    NumJobMatches = elixir.Field(elixir.Integer)
    OrigMaxHosts = elixir.Field(elixir.Integer)
    LastJobStatus = elixir.Field(elixir.Integer)
    JobStatus = elixir.Field(elixir.Integer)
    EnteredCurrentStatus = elixir.Field(elixir.DateTime)
    LastSuspensionTime = elixir.Field(elixir.DateTime)
    CurrentHosts = elixir.Field(elixir.Integer)
    ClaimId = elixir.Field(elixir.Unicode(255))
    PublicClaimId = elixir.Field(elixir.Unicode(255))
    StartdIpAddr = elixir.Field(elixir.Unicode(255))
    RemoteHost = elixir.Field(elixir.Unicode(255))
    RemoteSlotID = elixir.Field(elixir.Integer)
    StartdPrincipal = elixir.Field(elixir.Unicode(255))
    ShadowBday = elixir.Field(elixir.DateTime)
    JobStartDate = elixir.Field(elixir.DateTime)
    JobCurrentStartDate = elixir.Field(elixir.DateTime)
    NumShadowStarts = elixir.Field(elixir.Integer)
    JobRunCount = elixir.Field(elixir.Integer)
    ClusterId = elixir.Field(elixir.Integer)
    QDate = elixir.Field(elixir.DateTime)
    CompletionDate = elixir.Field(elixir.DateTime)
    Owner = elixir.Field(elixir.Unicode(255))
    RemoteWallClockTime = elixir.Field(elixir.Float)
    LocalUserCpu = elixir.Field(elixir.Float)
    LocalSysCpu = elixir.Field(elixir.Float)
    RemoteUserCpu = elixir.Field(elixir.Float)
    RemoteSysCpu = elixir.Field(elixir.Float)
    ExitStatus = elixir.Field(elixir.Integer)
    NumCkpts_RAW = elixir.Field(elixir.Integer)
    NumCkpts = elixir.Field(elixir.Integer)
    NumJobStarts = elixir.Field(elixir.Integer)
    NumRestarts = elixir.Field(elixir.Integer)
    NumSystemHolds = elixir.Field(elixir.Integer)
    CommittedTime = elixir.Field(elixir.DateTime)
    TotalSuspensions = elixir.Field(elixir.Integer)
    CumulativeSuspensionTime = elixir.Field(elixir.Integer)
    ExitBySignal = elixir.Field(elixir.Boolean)
    CondorVersion = elixir.Field(elixir.Unicode(255))
    CondorPlatform = elixir.Field(elixir.Unicode(255))
    RootDir = elixir.Field(elixir.Unicode(255))
    Iwd = elixir.Field(elixir.Unicode(255))
    JobUniverse = elixir.Field(elixir.Integer)
    Cmd = elixir.Field(elixir.Unicode(255))
    MinHosts = elixir.Field(elixir.Integer)
    MaxHosts = elixir.Field(elixir.Integer)
    WantRemoteSyscalls = elixir.Field(elixir.Boolean)
    WantCheckpoint = elixir.Field(elixir.Boolean)
    RequestCpus = elixir.Field(elixir.Integer)
    JobPrio = elixir.Field(elixir.Integer)
    User = elixir.Field(elixir.Unicode(255))
    NiceUser = elixir.Field(elixir.Boolean)
    JobNotification = elixir.Field(elixir.Integer)
    WantRemoteIO = elixir.Field(elixir.Boolean)
    UserLog = elixir.Field(elixir.Unicode(255))
    CoreSize = elixir.Field(elixir.Integer)
    KillSig = elixir.Field(elixir.Unicode(255))
    Rank = elixir.Field(elixir.Float)
    In = elixir.Field(elixir.Unicode(255))
    TransferIn = elixir.Field(elixir.Boolean)
    Out = elixir.Field(elixir.Unicode(255))
    StreamOut = elixir.Field(elixir.Boolean)
    Err = elixir.Field(elixir.Unicode(255))
    StreamErr = elixir.Field(elixir.Boolean)
    BufferSize = elixir.Field(elixir.Integer)
    BufferBlockSize = elixir.Field(elixir.Integer)
    ShouldTransferFiles = elixir.Field(elixir.Unicode(255))
    WhenToTransferOutput = elixir.Field(elixir.Unicode(255))
    TransferFiles = elixir.Field(elixir.Unicode(255))
    ImageSize_RAW = elixir.Field(elixir.Integer)
    ImageSize = elixir.Field(elixir.Integer)
    ExecutableSize_RAW = elixir.Field(elixir.Integer)
    ExecutableSize = elixir.Field(elixir.Integer)
    DiskUsage_RAW = elixir.Field(elixir.Integer)
    DiskUsage = elixir.Field(elixir.Integer)
    RequestMemory = elixir.Field(elixir.Unicode(255))
    RequestDisk = elixir.Field(elixir.Unicode(255))
    Requirements = elixir.Field(elixir.Unicode(255))
    FileSystemDomain = elixir.Field(elixir.Unicode(255))
    JobLeaseDuration = elixir.Field(elixir.Integer)
    PeriodicHold = elixir.Field(elixir.Boolean)
    PeriodicRelease = elixir.Field(elixir.Boolean)
    PeriodicRemove = elixir.Field(elixir.Boolean)
    OnExitHold = elixir.Field(elixir.Boolean)
    OnExitRemove = elixir.Field(elixir.Boolean)
    LeaveJobInQueue = elixir.Field(elixir.Boolean)
    DAGNodeName = elixir.Field(elixir.Unicode(255))
    DAGParentNodeNames = elixir.Field(elixir.Unicode(255))
    DAGManJobId = elixir.Field(elixir.Unicode(255))
    HookKeyword = elixir.Field(elixir.Unicode(255))
    Environment = elixir.Field(elixir.UnicodeText())
    Arguments = elixir.Field(elixir.Unicode(255))
    MyAddress = elixir.Field(elixir.Unicode(255))
    LastJobLeaseRenewal = elixir.Field(elixir.DateTime)
    TransferKey = elixir.Field(elixir.Unicode(255))
    TransferSocket = elixir.Field(elixir.Unicode(255))
    ShadowIpAddr = elixir.Field(elixir.Unicode(255))
    ShadowVersion = elixir.Field(elixir.Unicode(255))
    UidDomain = elixir.Field(elixir.Unicode(255))
    OrigCmd = elixir.Field(elixir.Unicode(255))
    OrigIwd = elixir.Field(elixir.Unicode(255))
    StarterIpAddr = elixir.Field(elixir.Unicode(255))
    JobState = elixir.Field(elixir.Unicode(255))
    NumPids = elixir.Field(elixir.Integer)
    JobPid = elixir.Field(elixir.Integer)
    JobDuration = elixir.Field(elixir.Float)
    ExitCode = elixir.Field(elixir.Integer)
    Dataset = elixir.Field(elixir.Unicode(255))
    Instances = elixir.Field(elixir.Integer)

    def __repr__(self):
        return ('Blackboard(GlobalJobId=%s, ExitCode=%s)' %
                (self.GlobalJobId, str(self.ExitCode)))

    def todict(self):
        return (dict([(key, val) for (key, val) in self.__dict__.items()
                      if not key.startswith('_')]))
Esempio n. 30
0
class Sha1(elixir.Entity):
    sha1 = elixir.Field(elixir.Unicode(40), index=True)
    files = elixir.OneToMany('File')