code: def __pickleable(tree):
          '''
          Makes the tree pickleable.
          '''
  
          def removeDeviceReference(view):
              '''
              Removes the reference to a L{MonkeyDevice}.
              '''
  
              view.device = None
  
          ###########################################################################################
          # FIXME: Unfortunately deepcopy does not work with MonkeyDevice objects, which is
          # sadly the reason why we cannot pickle the tree and we need to remove the MonkeyDevice
          # references.
          # We wanted to copy the tree to preserve the original and make piclkleable the copy.
          #treeCopy = copy.deepcopy(tree)
          treeCopy = tree
          # IMPORTANT:
          # This assumes that the first element in the list is the tree root
          ViewClient.__traverse(treeCopy[0], transform=removeDeviceReference)
          ###########################################################################################
          return treeCopf __pickleable(tree):
          '''
          Makes the tree pickleable.
          '''
  
          def removeDeviceReference(view):
              '''
              Removes the reference to a L{MonkeyDevice}.
              '''
  
              view.device = None
  
          ###########################################################################################
          # FIXME: Unfortunately deepcopy does not work with MonkeyDevice objects, which is
          # sadly the reason why we cannot pickle the tree and we need to remove the MonkeyDevice
          # references.
          # We wanted to copy the tree to preserve the original and make piclkleable the copy.
          #treeCopy = copy.deepcopy(tree)
          treeCopy = tree
          # IMPORTANT:
          # This assumes that the first element in the list is the tree root
          ViewClient.__traverse(treeCopy[0], transform=removeDeviceReference)
          ###########################################################################################
          return treeCopy
docs: Makes the tree pickleable.