#NEWLINE# def createReservation( self , function_name , **kwargs ) : #NEWLINE# #INDENT# uuid = None #NEWLINE# if ( not isinstance ( function_name , str ) ) : #NEWLINE# #INDENT# for key in self . functions : #NEWLINE# #INDENT# if ( self . functions [ key ] [ 'function' ] == function_name ) : #NEWLINE# #INDENT# function_name = key #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( function_name not in self . functions ) : #NEWLINE# #INDENT# raise Exception ( ( 'Function %s does not exist.' % function_name ) ) #NEWLINE# #UNINDENT# function = self . functions [ function_name ] #NEWLINE# if ( function [ 'interval' ] > 0 ) : #NEWLINE# #INDENT# uuid = uuid4 ( ) . hex #NEWLINE# #UNINDENT# d = self . callExposedFunction ( self . functions [ function_name ] [ 'function' ] , kwargs , function_name , uuid = uuid ) #NEWLINE# d . addCallback ( self . _createReservationCallback , function_name , uuid ) #NEWLINE# d . addErrback ( self . _createReservationErrback , function_name , uuid ) #NEWLINE# return d