human
Complete this python program:
def collect_profile_func(file_prefix, enabled=False):
assistant
#Here is the Python code you requested.

    """Method decorator for collecting profile.
    """
    import functools
    def _outer(func):
        '\n                                Outer    function    decorator.\n                                '
        @functools.wraps(func)
        def _inner(self, *args, **kwargs):
            '\n                                                Inner    wrapper    function.\n                                                '
            if enabled:
                with collect_profile(file_prefix):
                    return func(self, *args, **kwargs)
            else:
                return func(self, *args, **kwargs)
        return _inner
    return _outer