docstr: A sepset can only be inserted
  into the JT if the cliques it
  separates are NOT already on
  the same tree.
  NOTE: For efficiency we should
  add an index that indexes cliques
  into the trees in the forest.
docstr_tok: ["A","sepset","can","only","be","inserted","into","the","JT","if","the","cliques","it","separates","are","NOT","already","on","the","same","tree",".","NOTE",":","For","efficiency","we","should","add","an","index","that","indexes","cliques","into","the","trees","in","the","forest","."]
code: def insertable(self, forest):
      """A sepset can only be inserted
      into the JT if the cliques it
      separates are NOT already on
      the same tree.
      NOTE: For efficiency we should
      add an index that indexes cliques
      into the trees in the forest."""
      X_trees = [
          t
          for t in forest
          if self.X in [n.clique for n in t.clique_nodes]
      ]
      Y_trees = [
          t
          for t in forest
          if self.Y in [n.clique for n in t.clique_nodes]
      ]
      assert len(X_trees) == 1
      assert len(Y_trees) == 1
      if X_trees[0] is not Y_trees[0]:
          return True
      return False
  
imports: import copy
  import heapq
  import logging
  from collections import defaultdict
  from io import StringIO
  from itertools import combinations, product
  from random import choice, random
  from .exceptions import VariableNotInGraphError, VariableValueNotInDomainError
  from .graph import Node, UndirectedGraph, UndirectedNode, connect
  from .utils import get_args, get_original_factors
label_desc: Use image node_id 4 for calling the SepSet obj's underlying member method code with example usage: obj.insertable(forest) and returns: False, True