'A decorator that is used to register a custom template global function.
You can specify a name for the global function, otherwise the function
name will be used. Example::
@app.template_global()
def double(n):
return 2 * n
.. versionadded:: 0.10
:param name: the optional name of the global function, otherwise the
function name will be used.'

@setupmethod
def template_global(self, name=None):

    def decorator(f):
        self.add_template_global(f, name=name)
        return f
    return decorator
