old_contents: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  
  
  class TreeNode(object):
      """Tree node class collects helper functions for BinarySearchTree."""
      def __init__(self, key, value, 
                   left=None, right=None, parent=None):
          self.key = key
          self.value = value
          self.left_child = left
          self.right_child = right
          self.parent = parent
  
      def has_left_child(self):
          return self.left_child
  
      def has_right_child(self):
          return self.right_child
  
      def is_left_child(self):
          return self.parent and self.parent.left_child == self
  
      def is_right_child(self):
          return self.parent and self.parent.right_child == self
  
      def is_root(self):
          return not self.parent
  
      def is_leaf(self):
          return not (self.left_child or self.right_child)
  
      def has_any_children(self):
          return self.left_child or self.right_child
  
      def has_both_children(self):
          return self.left_child and self.right_child
  
      def replace_node_data(self, key, value, lc, rc):
          self.key = key
          self.payload = value
          self.left_child = lc
          self.right_child = rc
          if self.has_left_child():
              self.left_child.parent = self
          if self.has_right_child():
              self.right_child.parent = self
  
  
  class BinarySearchTree(object):
      def __init__(self):
          self.root = None
          self.size = 0
  
      def length(self):
          return self.size
  
      def __len__(self):
          return self.size
  
      def __iter__(self):
          return self.root.__iter__()
  
  
  def main():
      bst = BinarySearchTree()
      pass
  
  
  if __name__ == '__main__':
      main()
  
new_contents: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  
  
  class TreeNode(object):
      """Tree node class collects helper functions for BinarySearchTree."""
      def __init__(self, key, value, 
                   left=None, right=None, parent=None):
          self.key = key
          self.value = value
          self.left_child = left
          self.right_child = right
          self.parent = parent
  
      def has_left_child(self):
          return self.left_child
  
      def has_right_child(self):
          return self.right_child
  
      def is_left_child(self):
          return self.parent and self.parent.left_child == self
  
      def is_right_child(self):
          return self.parent and self.parent.right_child == self
  
      def is_root(self):
          return not self.parent
  
      def is_leaf(self):
          return not (self.left_child or self.right_child)
  
      def has_any_children(self):
          return self.left_child or self.right_child
  
      def has_both_children(self):
          return self.left_child and self.right_child
  
      def replace_node_data(self, key, value, lc, rc):
          self.key = key
          self.payload = value
          self.left_child = lc
          self.right_child = rc
          if self.has_left_child():
              self.left_child.parent = self
          if self.has_right_child():
              self.right_child.parent = self
  
  
  class BinarySearchTree(object):
      def __init__(self):
          self.root = None
          self.size = 0
  
      def length(self):
          return self.size
  
      def __len__(self):
          return self.size
  
      def __iter__(self):
          return self.root.__iter__()
  
      def _put():
          pass
  
      def put():
          pass
  
  
  def main():
      bst = BinarySearchTree()
      pass
  
  
  if __name__ == '__main__':
      main()
  
subject: Add put() method in BinarySearchTree class