def _section_end_points(structure_block, id_map):
soma_idx = structure_block[:, TYPE] == POINT_TYPE.SOMA<EOL>soma_ids = structure_block[soma_idx, ID]<EOL>neurite_idx = structure_block[:, TYPE] != POINT_TYPE.SOMA<EOL>neurite_rows = structure_block[neurite_idx, :]<EOL>soma_end_pts = set(id_map[id_]<EOL>for id_ in soma_ids[np.in1d(soma_ids, neurite_rows[:, PID])])<EOL>n_children = defaultdict(int)<EOL>for row in structure_block:<EOL><INDENT>n_children[row[PID]] += <NUM_LIT:1><EOL><DEDENT>end_pts = set(i for i, row in enumerate(structure_block)<EOL>if n_children[row[ID]] != <NUM_LIT:1>)<EOL>return end_pts.union(soma_end_pts)<EOL>
Get the section end-points