<s> from foam . sfa . util . method import Method <EOL> from foam . sfa . util . parameter import Parameter , Mixed <EOL> class RedeemTicket ( Method ) : <EOL> """<STR_LIT>""" <EOL> interfaces = [ '<STR_LIT>' ] <EOL> accepts = [ <EOL> Parameter ( str , "<STR_LIT>" ) , <EOL> Mixed ( Parameter ( str , "<STR_LIT>" ) , <EOL> Parameter ( type ( [ str ] ) , "<STR_LIT>" ) ) , <EOL> ] <EOL> returns = [ Parameter ( int , "<STR_LIT>" ) ] <EOL> def call ( self , ticket , creds ) : <EOL> valid_creds = self . api . auth . checkCredentials ( cred , '<STR_LIT>' ) <EOL> self . api . auth . check_ticket ( ticket ) <EOL> self . api . manager . redeem_ticket ( self . api , ticket ) <EOL> return <NUM_LIT:1> </s>
