# Path: ronin/utils/unicode.py

# 
# Path: ronin/contexts.py
# def current_context(immutable=True):
#     """
#     Returns the current context if there is one, otherwise raises :class:`NoContextException`.
#     
#     By default, the context will be treated as immutable.
#     
#     :param immutable: set to False in order to allow changes to the context
#     :type immutable: bool
#     :returns: current context
#     :rtype: :class:`Context`
#     """
# 
#     ctx = Context._peek_thread_local()
#     if ctx is None:
#         raise NoContextException()
#     return Context(ctx, True) if immutable else ctx


from .unicode import to_str
from ..contexts import current_context
import re
    
    :param values: values
    :type values: {}
    :returns: values
    :rtype: {object: str}
    """
    
    return {k: stringify(v) for k, v in values.items()}


def bool_stringify(value):
    """
    Like :func:`stringify`, except checks if the return value equals, ignoring case, to ``true``. 
    
    :param value: value
    :type value: str|FunctionType
    :returns: True if the stringified value is ``true``
    :rtype: bool
    """
    
    if value is None:
        return False
    elif hasattr(value, '__call__'):
        with current_context() as ctx:
            value = value(ctx)
        return bool_stringify(value)
    else:
        if isinstance(value, bool):
            return value
        try:

# Path: ronin/utils/unicode.py

# 
# Path: ronin/contexts.py
# def current_context(immutable=True):
#     """
#     Returns the current context if there is one, otherwise raises :class:`NoContextException`.
#     
#     By default, the context will be treated as immutable.
#     
#     :param immutable: set to False in order to allow changes to the context
#     :type immutable: bool
#     :returns: current context
#     :rtype: :class:`Context`
#     """
# 
#     ctx = Context._peek_thread_local()
#     if ctx is None:
#         raise NoContextException()
#     return Context(ctx, True) if immutable else ctx


# Path: ronin/utils/strings.py
from .unicode import to_str
from ..contexts import current_context
import re

    
    :param values: values
    :type values: {}
    :returns: values
    :rtype: {object: str}
    """
    
    return {k: stringify(v) for k, v in values.items()}


def bool_stringify(value):
    """
    Like :func:`stringify`, except checks if the return value equals, ignoring case, to ``true``. 
    
    :param value: value
    :type value: str|FunctionType
    :returns: True if the stringified value is ``true``
    :rtype: bool
    """
    
    if value is None:
        return False
    elif hasattr(value, '__call__'):
        with current_context() as ctx:
            value = value(ctx)
        return bool_stringify(value)
    else:
        if isinstance(value, bool):
            return value
        try:

            value = to_str(value)