parameters: (self, key)
docstring: Get the element (k,v) pair associated with the greatest key less
          than or equal to the given key, raises KeyError if there is no such key.
docstring_summary: Get the element (k,v) pair associated with the greatest key less
          than or equal to the given key, raises KeyError if there is no such key.
docstring_tokens: Get the element ( k v ) pair associated with the greatest key less than or equal to the given key raises KeyError if there is no such key .
function: def floor_item(self, key):
          """ Get the element (k,v) pair associated with the greatest key less
          than or equal to the given key, raises KeyError if there is no such key.
          """
          node = self._tree.root
          prev = None
          while node is not None:
              if key == node.key:
                  return node.key, node.value
              elif key < node.key:
                  node = node.left
              else:
                  if (prev is None) or (node.key > prev.key):
                      prev = node
                  node = node.right
          # node must be None here
          if prev:
              return prev.key, prev.value
          raise KeyError(str(key))
function_tokens: def floor_item ( self , key ) : node = self . _tree . root prev = None while node is not None : if key == node . key : return node . key , node . value elif key < node . key : node = node . left else : if ( prev is None ) or ( node . key > prev . key ) : prev = node node = node . right # node must be None here if prev : return prev . key , prev . value raise KeyError ( str ( key ) )