def METHOD_NAME(value):
    if isinstance(value, list):
        value = [METHOD_NAME(v) for v in value]
    elif isinstance(value, set):
        value = set([METHOD_NAME(v) for v in value])
    elif isinstance(value, str):
        value = escape(value)
    return value