#NEWLINE# def create_maze( layout_mesh ) : #NEWLINE# #INDENT# ' Transforms a layout_mesh into a Maze.\n\n    Parameters\n    ----------\n    layout_mesh : Mesh of single char strings\n        Mesh of single character strings describing the layout\n\n    Returns\n    -------\n    maze : Maze\n        the Maze\n\n    ' #NEWLINE# maze = Maze ( layout_mesh . width , layout_mesh . height ) #NEWLINE# food = [ ] #NEWLINE# for ( pos , items ) in layout_mesh . items ( ) : #NEWLINE# #INDENT# if ( Wall in maze ) : #NEWLINE# #INDENT# maze [ pos ] = True #NEWLINE# #UNINDENT# if ( Food in items ) : #NEWLINE# #INDENT# food . append ( pos ) #NEWLINE# #UNINDENT# #UNINDENT# return ( maze , food )