def g_id_neighbor_in_grid_index(g_id, grid_index, nb_mesh=1):
    """
    Return g_id neigbhor if exists in given grid index at a distance of n mesh
    """
    x_g_id, y_g_id = g_id
    x_min = x_g_id - nb_mesh
    x_max = x_g_id + nb_mesh + 1
    y_min = y_g_id - nb_mesh
    y_max = y_g_id + nb_mesh + 1
    for x_g_id in range(x_min, x_max):
        for y_g_id in range(y_min, y_max):
            neighbor_g_id = x_g_id, y_g_id
            if neighbor_g_id in grid_index['index']:
                yield neighbor_g_id
