def declare_vars(v):
    if isinstance(v, (list, tuple)):
        for sub in v:
            for ln in declare_vars(sub):
                yield ln
        return
    if isinstance(v, dict):
        for sub in list(v.values()):
            for ln in declare_vars(sub):
                yield ln
        return
    if isinstance(v, VisibleComponent) and not v.get_view_permission(
            _for_user_profile):
        return
    if isinstance(v, Component):
        for sub in list(v.ext_options().values()):
            for ln in declare_vars(sub):
                yield ln
        # DON'T return
    elif isinstance(v, Value):
        # 20120616 if not v.is_visible(): return
        # ok = True
        for ln in declare_vars(v.value):
            yield ln
        # DON'T return

    if isinstance(v, Variable):
        # 20120616 if not v.is_visible(): return
        if v.declare_type == DECLARE_VAR:
            yield "var %s = %s;" % (v.ext_name, v.js_value())
        elif v.declare_type == DECLARE_THIS:
            yield "this.%s = %s;" % (v.ext_name, v.js_value())
Send a POST request and convert errors to exceptions
dataset/ETHPy150Open lsaffre/lino/lino/utils/jsgen.py/declare_vars--crossover with--dataset/ETHPy150Open francelabs/datafari/debian7/zookeeper/src/contrib/huebrowser/zkui/src/zkui/rest.py/ZooKeeper._do_post