def prefixed_collapsible_map(m, prefix):
if m == values.unset:<EOL><INDENT>return {}<EOL><DEDENT>def flatten_dict(d, result={}, prv_keys=[]):<EOL><INDENT>for k, v in d.items():<EOL><INDENT>if isinstance(v, dict):<EOL><INDENT>flatten_dict(v, result, prv_keys + [k])<EOL><DEDENT>else:<EOL><INDENT>result['<STR_LIT:.>'.join(prv_keys + [k])] = v<EOL><DEDENT><DEDENT>return result<EOL><DEDENT>if isinstance(m, dict):<EOL><INDENT>flattened = flatten_dict(m)<EOL>return {'<STR_LIT>'.format(prefix, k): v for k, v in flattened.items()}<EOL><DEDENT>return {}<EOL>
Return a dict of params corresponding to those in m with the added prefix