human
Can you provide a the Python program you requested given the following:
Complete the below
def check_interaction(fn):

    ''''Decorator to clean and prevent interaction when not available'
    '''
assistant
#Here is the Python program you requested.
    def check_fn(self, *args, **kwargs):
        interact_lock.acquire()
        try:
            if self.filename:
                self.clear_interaction()
                return fn(self, *args, **kwargs)
        finally:
            interact_lock.release()
    return check_fn