def debug(*args, **kwargs):
if not (DEBUG and args):<EOL><INDENT>return None<EOL><DEDENT>parent = kwargs.get('<STR_LIT>', None)<EOL>with suppress(KeyError):<EOL><INDENT>kwargs.pop('<STR_LIT>')<EOL><DEDENT>backlevel = kwargs.get('<STR_LIT>', <NUM_LIT:1>)<EOL>with suppress(KeyError):<EOL><INDENT>kwargs.pop('<STR_LIT>')<EOL><DEDENT>frame = inspect.currentframe()<EOL>while backlevel > <NUM_LIT:0>:<EOL><INDENT>frame = frame.f_back<EOL>backlevel -= <NUM_LIT:1><EOL><DEDENT>fname = os.path.split(frame.f_code.co_filename)[-<NUM_LIT:1>]<EOL>lineno = frame.f_lineno<EOL>if parent:<EOL><INDENT>func = '<STR_LIT>'.format(parent.__class__.__name__, frame.f_code.co_name)<EOL><DEDENT>else:<EOL><INDENT>func = frame.f_code.co_name<EOL><DEDENT>lineinfo = '<STR_LIT>'.format(<EOL>C(fname, '<STR_LIT>'),<EOL>C(str(lineno).ljust(<NUM_LIT:4>), '<STR_LIT>'),<EOL>C().join(C(func, '<STR_LIT>'), '<STR_LIT>').ljust(<NUM_LIT:20>)<EOL>)<EOL>pargs = list(C(a, '<STR_LIT>').str() for a in args)<EOL>pargs[<NUM_LIT:0>] = '<STR_LIT>'.join((lineinfo, pargs[<NUM_LIT:0>]))<EOL>print_err(*pargs, **kwargs)<EOL>
Print a message only if DEBUG is truthy.