<s> def Thread ( id , uri , title ) : <EOL> return { <EOL> "<STR_LIT:id>" : id , <EOL> "<STR_LIT>" : uri , <EOL> "<STR_LIT:title>" : title <EOL> } <EOL> class Threads ( object ) : <EOL> def __init__ ( self , db ) : <EOL> self . db = db <EOL> self . db . execute ( [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ] ) <EOL> def __contains__ ( self , uri ) : <EOL> return self . db . execute ( "<STR_LIT>" , ( uri , ) ) . fetchone ( ) is not None <EOL> def __getitem__ ( self , uri ) : <EOL> return Thread ( * self . db . execute ( "<STR_LIT>" , ( uri , ) ) . fetchone ( ) ) <EOL> def new ( self , uri , title ) : <EOL> self . db . execute ( "<STR_LIT>" , ( uri , title ) ) <EOL> return self [ uri ] </s>
