def METHOD_NAME(grid_state):
    new_grid_state = deepcopy(grid_state)
    for cell, state in grid_state.items():
        neighbors = get_neighbors(*cell)
        n_living = get_num_living(grid_state, neighbors)
        if state == 0 and n_living == 3:
            new_grid_state[cell] = 1
        elif state == 1:
            if not 1 < n_living < 4:
                new_grid_state[cell] = 0
    return new_grid_state