def two_by_two(state, k=None):
    """
    '2x2' automata state transition
    http://www.conwaylife.com/wiki/2x2
    """
    if k == None:
        m, n = state.shape
        k = np.zeros((m, n))
        k[m/2-1 : m/2+2, n/2-1 : 2/n+2] = np.array([[1,1,1],[1,0,1],[1,1,1]])

    # computes sums around each pixel
    b = fft_convolve2d(state,k).round()
    c = np.zeros(b.shape)
    # checks the values, and sets alive vs. dead state

    c[np.where((b == 1) & (state == 1))] = 1
    c[np.where((b == 2) & (state == 1))] = 1
    c[np.where((b == 5) & (state == 1))] = 1

    c[np.where((b == 3) & (state == 0))] = 1
    c[np.where((b == 6) & (state == 0))] = 1

    # return new state
    return c
dataset/ETHPy150Open thearn/game-of-life/two_by_two.py/two_by_two/swapped operands of `/`