def debug(opt=None, msg="", verbose=False): if opt is None or verbose: print(msg) if opt.DEBUG or verbose: print(msg)