def METHOD_NAME(self, node_ids: np.ndarray, *, time_stamp: datetime = None):
    if not node_ids.size:
        return node_ids
    mask = np.in1d(node_ids, np.fromiter(self.parents_cache.keys(), dtype=NODE_ID))
    parents = node_ids.copy()
    parents[mask] = self._parent_vec(node_ids[mask])
    parents[~mask] = self._cg.get_parents(
        node_ids[~mask], raw_only=True, time_stamp=time_stamp
    )
    update(self.parents_cache, node_ids[~mask], parents[~mask])
    return parents