<s> import collections <EOL> from dcos . errors import DCOSException <EOL> Command = collections . namedtuple ( <EOL> '<STR_LIT>' , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> """<STR_LIT>""" <EOL> def execute ( cmds , args ) : <EOL> """<STR_LIT>""" <EOL> for hierarchy , arg_keys , function in cmds : <EOL> match = True <EOL> for positional in hierarchy : <EOL> if not args [ positional ] : <EOL> match = False <EOL> if match : <EOL> params = [ args [ name ] for name in arg_keys ] <EOL> return function ( * params ) <EOL> raise DCOSException ( '<STR_LIT>' ) </s>
