#NEWLINE# def __init__( self , json ) : #NEWLINE# #INDENT# self . json = json #NEWLINE# if ( 'boolean' in json ) : #NEWLINE# #INDENT# type_ = 'ASK' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( 'results' in type_ ) : #NEWLINE# #INDENT# type_ = 'SELECT' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ResultException ( 'No boolean or results in json!' ) #NEWLINE# #UNINDENT# #UNINDENT# Result . __init__ ( self , type_ ) #NEWLINE# if ( type_ == 'ASK' ) : #NEWLINE# #INDENT# self . askAnswer = bool ( json [ 'boolean' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . bindings = self . _get_bindings ( ) #NEWLINE# self . vars = [ Variable ( x ) for x in json [ 'head' ] [ 'vars' ] ]