<s> from __future__ import division <EOL> import numpy as np <EOL> import scipy as sp <EOL> import matplotlib . pyplot as plt <EOL> def displayData ( X , size = None , showit = False ) : <EOL> '''<STR_LIT>''' <EOL> x_length = int ( np . sqrt ( X . shape [ <NUM_LIT:1> ] ) ) ; <EOL> y_length = int ( np . sqrt ( X . shape [ <NUM_LIT:1> ] ) ) ; <EOL> if size == None : <EOL> size = np . sqrt ( X . shape [ <NUM_LIT:0> ] ) <EOL> size = [ size , size ] <EOL> bigimg = np . zeros ( ( x_length * size [ <NUM_LIT:0> ] , y_length * size [ <NUM_LIT:1> ] ) ) ; <EOL> for i in range ( x_length ) : <EOL> for j in range ( y_length ) : <EOL> im = X [ : , ( i - <NUM_LIT:1> ) * y_length + j ] . reshape ( <NUM_LIT:32> , <NUM_LIT:32> ) . transpose ( ) <EOL> bigimg [ i * <NUM_LIT:32> : ( i + <NUM_LIT:1> ) * <NUM_LIT:32> , ( j ) * <NUM_LIT:32> : ( j + <NUM_LIT:1> ) * <NUM_LIT:32> ] = im <EOL> if showit : <EOL> fig = plt . figure ( ) <EOL> plt . imshow ( bigimg , cmap = '<STR_LIT>' ) <EOL> else : <EOL> return bigimg </s>
