def setSyntax(self, syntax):
        """Choose smart indentation algorithm according to syntax"""
        self._smartIndenter = self._chooseSmartIndenter(syntax)
def kth(root, k):
    if k < size(root.left):
        return kth(root.left, k)
    elif k > size(root.left):
        return kth(root.right, k - size(root.left) - 1)
    return root.key