def METHOD_NAME(s="", log=None):
    """
    Set the context for the currently executing function and optionally log it.
    :param s: A string.  If not provided, the context for the current function
            will be cleared.
    :param log: A logging function to pass the context message to.  If None, no
            function will be called.
    """
    ctx.contexts[-1] = s
    if s and log:
        log("Context: %s" % get_context())