Find the edges whose IDs in parent graph appeared in exclude_eids. Note that both arguments are numpy arrays or numpy dicts.
(frontier_parent_eids, exclude_eids)
| 10 | |
| 11 | |
| 12 | def _locate_eids_to_exclude(frontier_parent_eids, exclude_eids): |
| 13 | """Find the edges whose IDs in parent graph appeared in exclude_eids. |
| 14 | |
| 15 | Note that both arguments are numpy arrays or numpy dicts. |
| 16 | """ |
| 17 | if not isinstance(frontier_parent_eids, Mapping): |
| 18 | return np.isin(frontier_parent_eids, exclude_eids).nonzero()[0] |
| 19 | result = {} |
| 20 | for k, v in frontier_parent_eids.items(): |
| 21 | if k in exclude_eids: |
| 22 | result[k] = np.isin(v, exclude_eids[k]).nonzero()[0] |
| 23 | return recursive_apply(result, F.zerocopy_from_numpy) |
| 24 | |
| 25 | |
| 26 | class EidExcluder(object): |
no test coverage detected