#NEWLINE# def traverse_object( obj , breadcrumbs ) : #NEWLINE# #INDENT# '\n    Traverses an object constructed out of dicts and lists.\n    :param obj: the object to traverse\n    :param breadcrumbs: the breadcrumbs on which to traverse, while list\n    indices surrounded\n    by [x]\n    :return: the object at the end of the breadcrumbs\n    ' #NEWLINE# if ( not breadcrumbs ) : #NEWLINE# #INDENT# return obj #NEWLINE# #UNINDENT# current_key = current_key [ 0 ] #NEWLINE# if ( current_key in obj ) : #NEWLINE# #INDENT# return traverse_object ( obj [ breadcrumbs [ 0 ] ] , breadcrumbs [ 1 : ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( parse_index ( current_key ) is not False ) : #NEWLINE# #INDENT# return traverse_object ( obj [ parse_index ( current_key ) ] , breadcrumbs [ 1 : ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# }