@app.route('/status/<codes>', methods=['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'TRACE'])
def view_status_code(codes):
 if (',' not in codes):
  code = int(codes)
  return status_code(code)
 choices = []
 for choice in codes.split(','):
  if (':' not in choice):
   code = choice
   weight = 1
  else:
   (code, weight) = choice.split(':')
  choices.append((int(code), float(weight)))
 code = weighted_choice(choices)
 return status_code(code)

@ app . route ( '/status/<codes>' , methods = [ 'GET' , 'POST' , 'PUT' , 'DELETE' , 'PATCH' , 'TRACE' ] ) def view_status_code ( codes ) : if ( ',' not in codes ) : code = int ( codes ) return status_code ( code ) choices = [ ] for choice in codes . split ( ',' ) : if ( ':' not in choice ) : code = choice weight = 1 else : ( code , weight ) = choice . split ( ':' ) choices . append ( ( int ( code ) , float ( weight ) ) ) code = weighted_choice ( choices ) return status_code ( code )
return status code or random status code if more than one are given .