<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cost(self, node):
 """ Cost function for WeightedMinFill. The cost of eliminating a node is the sum of weights of the edges that need to be added to the graph due to its elimination, where a weight of an edge is the product of the weights, domain cardinality, of its constituent vertices. """

        edges = combinations(self.moralized_model.neighbors(node), 2)
        return sum([self.bayesian_model.get_cardinality(edge[0]) *
                    self.bayesian_model.get_cardinality(edge[1]) for edge in edges])