#NEWLINE# def create_dict( breadcrumbs , value = None ) : #NEWLINE# #INDENT# "\n    Created a dict out of the breadcrumbs in a recursive manner.\n    each entry in the breadcrumb should be a valid dictionary key.\n    If value is None, the last string within' the breadcrumbs becomes the\n    final value.\n    :param breadcrumbs:\n    :param value:\n    :return:\n    " #NEWLINE# if value : #NEWLINE# #INDENT# if ( not breadcrumbs ) : #NEWLINE# #INDENT# return value #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( breadcrumbs ) == 1 ) : #NEWLINE# #INDENT# return breadcrumbs [ 0 ] #NEWLINE# #UNINDENT# #UNINDENT# return { #NEWLINE# #INDENT# value [ 0 ] : create_dict ( breadcrumbs [ 1 : ] , value ) , #NEWLINE# #UNINDENT# }