code: def transform(x, X, R):
      """Transform a Potential Truth Table
      Entry into a different variable space.
      For example if we have the
      entry [True, True, False] representing
      values of variable [A, B, C] in X
      and we want to transform into
      R which has variables [C, A] we
      will return the entry [False, True].
      Here X represents the argument list
      for the clique set X and R represents
      the argument list for the sepset.
      This implies that R is always a subset
      of X"""
      entry = []
      for r in R:
          pos = X.index(r)
          entry.append(x[pos])
      return tuple(entry)
  
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 1 for calling a global function with example usage: transform(x, X, R) and returns: tuple