human
Complete the below
def gaussian_filter(kernel_shape):

    ''''.. todo::
    WRITEME
    Parameters
    kernel_shape : WRITEME'
    '''
assistant
#Here is the Python code you requested.
    x = numpy.zeros((kernel_shape, kernel_shape), dtype=theano.config.floatX)
    def gauss(x, y, sigma=2.0):
        Z = ((2 * numpy.pi) * (sigma ** 2))
        return ((1.0 / Z) * numpy.exp(((- ((x ** 2) + (y ** 2))) / (2.0 * (sigma ** 2)))))
    mid = numpy.floor((kernel_shape / 2.0))
    for i in xrange(0, kernel_shape):
        for j in xrange(0, kernel_shape):
            x[(i, j)] = gauss((i - mid), (j - mid))
    return (x / numpy.sum(x))