human
Write me a the Python code you requested given the following:
Complete the below
def _run_test_complete_on_exit(f):

    ''''Decorator for job methods that automatically calls
    self.harness.run_test_complete when the method exits, if appropriate.'
    '''
assistant
#Here is the Python code you requested.
    def wrapped(self, *args, **dargs):
        try:
            return f(self, *args, **dargs)
        finally:
            if (self._logger.global_filename == 'status'):
                self.harness.run_test_complete()
                if self.drop_caches:
                    utils_memory.drop_caches()
    wrapped.__name__ = f.__name__
    wrapped.__doc__ = f.__doc__
    wrapped.__dict__.update(f.__dict__)
    return wrapped