human
I wrote the below code

    assert isinstance(working_tree_ref, string_types), 'Decorator    requires    ref    name    for    working    tree    checkout'
    def argument_passer(func):
        @wraps(func)
        def repo_creator(self):
            prefix = 'non_'
            if bare:
                prefix = ''
            repo_dir = tempfile.mktemp(prefix=('%sbare_%s' % (prefix, func.__name__)))
            rw_repo = self.rorepo.clone(repo_dir, shared=True, bare=bare, n=True)
            rw_repo.head.commit = rw_repo.commit(working_tree_ref)
            if (not bare):
                rw_repo.head.reference.checkout()
            prev_cwd = os.getcwd()
            os.chdir(rw_repo.working_dir)
            try:
                return func(self, rw_repo)
            except:
                log.info('Keeping    repo    after    failure:    %s', repo_dir)
                repo_dir = None
                raise
            finally:
                os.chdir(prev_cwd)
                rw_repo.git.clear_cache()
                rw_repo = None
                if (repo_dir is not None):
                    gc.collect()
                    gitdb.util.mman.collect()
                    gc.collect()
                    rmtree(repo_dir)
        return repo_creator
    return argument_passer

What's a good function header?

=====
Write me a Python program to fix = 'non_'?
assistant
#Here is Python program to fix = 'non_'
.

def with_rw_repo(working_tree_ref, bare=False):