def get_children(self): children = ChildrenMap() for name in self.__dict__: value = self.__dict__[name] if isinstance(value, Entity) and name != '_top_entity': if name not in self._children_name_map: continue children[name] = value elif isinstance(value, YList): for v in value: if isinstance(v, Entity): children[v.get_segment_path()] = v self._local_refs["ydk::children"] = children return children
def get_children(self): children = ChildrenMap() for name in self.__dict__: value = self.__dict__[name] if isinstance(value, Entity) and name != '_top_entity': if name not in self._children_name_map: continue children[name] = value elif isinstance(value, YList): for v in value: if isinstance(v, Entity): children[v.get_segment_path()] = v # store local refs so that pybind11 does not free the object. See https://github.com/pybind/pybind11/issues/673 self._local_refs["ydk::children"] = children return children