def METHOD_NAME(
    cg: ChunkedGraph, node_id: np.uint64, start_layer: int, bounding_box=None
):
    if cg.get_chunk_layer(node_id) == 2:
        return np.array([node_id], dtype=NODE_ID)
    result = [empty_1d]
    parents = np.array([node_id], dtype=np.uint64)
    while parents.size:
        children = cg.get_children(parents, flatten=True)
        bound_mask = misc_utils.mask_nodes_by_bounding_box(
            cg.meta, children, bounding_box=bounding_box
        )
        layers = cg.get_chunk_layers(children)
        result.append(children[(layers <= start_layer) & bound_mask])
        parents = children[(layers > start_layer) & bound_mask]
    return np.concatenate(result)