#NEWLINE# def cases( arg , case_result_pairs , default = None ) : #NEWLINE# #INDENT# '\n    Create a case expression in one shot.\n\n    Returns\n    -------\n    case_expr : SimpleCase\n    ' #NEWLINE# builder = arg . case ( ) #NEWLINE# for ( case , result ) in case : #NEWLINE# #INDENT# builder = builder . when ( case , result ) #NEWLINE# #UNINDENT# if ( default is not None ) : #NEWLINE# #INDENT# builder = builder . else_ ( default ) #NEWLINE# #UNINDENT# return builder . end ( )