def METHOD_NAME(function = None, section = "MANUAL"):
    """
    Decorator for profiling the specific methods.
    It can be used in two ways:
    @profile
    def method(...):
        ...
    or
    @profile(section="SECTION"):
    def method(...):
        ...
    The second form is equivalent to the first with section = "MANUAL".
    Profiling section is a named set of methods which should be profiled.
    Supported values of section are listed in SverchokPreferences.profiling_sections.
    The @profile(section) decorator does profile the method only if all following
    conditions are met:
    * profiling for specified section is enabled in settings (profile_mode option),
    * profiling is currently active.
    """
    def profiling_decorator(func):
        def wrapper(*args, **kwargs):
            if is_profiling_enabled(section):
                global _profile_nesting
                METHOD_NAME = get_global_profile()
                _profile_nesting += 1
                if _profile_nesting == 1:
                    METHOD_NAME.enable()
                result = func(*args, **kwargs)
                _profile_nesting -= 1
                if _profile_nesting == 0:
                    METHOD_NAME.disable()
                return result
            else:
                return func(*args, **kwargs)
        wrapper.__name__ = func.__name__
        wrapper.__doc__ = func.__doc__
        return wrapper
    if callable(function):
        return profiling_decorator(function)
    else:
        return profiling_decorator