def get_dict(dictionary, *keys,**kwargs):
if '<STR_LIT:default>' in kwargs:<EOL><INDENT>default = kwargs['<STR_LIT:default>']<EOL><DEDENT>else:<EOL><INDENT>default = None<EOL><DEDENT>existing = dictionary<EOL>for i in range(<NUM_LIT:0>, len(keys)):<EOL><INDENT>if keys[i] in existing:<EOL><INDENT>existing = existing[keys[i]]<EOL><DEDENT>else:<EOL><INDENT>return default<EOL><DEDENT><DEDENT>return existing<EOL>
This function allows traversals over several keys to
be performed by passing a list of keys::

get_dict(d,key1,key2,key3) = d[key1][key2][key3]