def NAND(*args, **kwargs):
errors = []<EOL>for arg in args:<EOL><INDENT>try:<EOL><INDENT>arg()<EOL><DEDENT>except CertifierError as e:<EOL><INDENT>errors.append(e)<EOL><DEDENT><DEDENT>if (len(errors) != len(args)) and len(args) > <NUM_LIT:1>:<EOL><INDENT>exc = kwargs.get(<EOL>'<STR_LIT>',<EOL>CertifierValueError('<STR_LIT>'),<EOL>)<EOL>if exc is not None:<EOL><INDENT>raise exc<EOL><DEDENT><DEDENT>
ALL args must raise an exception when called overall.
Raise the specified exception on failure OR the first exception.

:params iterable[Certifier] args:
    The certifiers to call
:param callable kwargs['exc']:
    Callable that excepts the unexpectedly raised exception as argument and return an
    exception to raise.