in src/lic/ppl/world/world.py [0:0]
def get_markov_blanket(self, node: RVIdentifier) -> Set[RVIdentifier]:
"""
Extracts the markov block of a node in the world and we exclude the
observed random variables.
:param node: the node for which we'd like to extract the markov blanket
:returns: the markov blanket of a specific node passed in
"""
markov_blanket = set()
node_var = self.get_node_in_world_raise_error(node, False)
for child in node_var.children:
if child is None:
raise ValueError("child is None")
markov_blanket.add(child)
child_var = self.get_node_in_world_raise_error(child, False)
for parent in child_var.parent:
if parent != node:
markov_blanket.add(parent)
return markov_blanket