Did I find the right examples for you? yes no

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)
This performs the first stage of validation. It takes a dictionary where
some keys will be compound names, such as "form:subform:field" and converts
this into a nested dict/list structure. It also performs unicode decoding.

        def unflatten_params(params):
    """This performs the first stage of validation. It takes a dictionary where
    some keys will be compound names, such as "form:subform:field" and converts
    this into a nested dict/list structure. It also performs unicode decoding.
    """
    if isinstance(params, webob.MultiDict):
        params = params.mixed()
    # TODO: the encoding can be in the given params, use it!
    enc = 'utf-8'
    for p in params:
        if isinstance(params[p], str):
            # Can raise an exception!
            params[p] = params[p].decode(enc)

    out = {}
    for pname in params:
        dct = out
        elements = pname.split(':')
        for e in elements[:-1]:
            dct = dct.setdefault(e, {})
        dct[elements[-1]] = params[pname]

    numdict_to_list(out)
    return out
        


src/x/m/xmltool-0.3.6.1/xmltool/factory.py   xmltool(Download)
    :rtype: :class:`Element`
    """
    data = utils.unflatten_params(data)
    encoding = data.pop('_xml_encoding')
    dtd_url = data.pop('_xml_dtd_url')