human
What is a Python program to print the input and output expressions at each rule application' given the following:
Complete the below
def debug(brule, file=None):

    ''''Print the input and output expressions at each rule application'
    '''
assistant
#Here is Python program to print the input and output expressions at each rule application'
.
    if (not file):
        from sys import stdout
        file = stdout
    def write(brl, expr, result):
        file.write(('Rule:    %s\n' % get_function_name(brl)))
        file.write(('In:    %s\nOut:    %s\n\n' % (expr, result)))
    return onaction(brule, write)