parameters: (self, filename, code)
docstring: Delete an item, identified by ``filename`` and ``code``
          from the B-Tree.
docstring_summary: Delete an item, identified by ``filename`` and ``code``
          from the B-Tree.
docstring_tokens: Delete an item identified by filename and code from the B - Tree .
function: def delete(self, filename, code):
          """Delete an item, identified by ``filename`` and ``code``
          from the B-Tree."""
          if isinstance(filename, DSStoreEntry):
              code = filename.code
              filename = filename.filename
  
          # If we're deleting *every* node for "filename", we must recurse
          if code is None:
              ###TODO: Fix this so we can do bulk deletes
              raise ValueError('You must delete items individually.  Sorry')
  
          # Otherwise, we're deleting *one* specific node
          filename_lc = filename.lower()
          path = []
          node = self._rootnode
          while True:
              with self._get_block(node) as block:
                  next_node, count = block.read(b'>II')
                  if next_node:
                      for n in range(count):
                          ptr = block.read(b'>I')[0]
                          e = DSStoreEntry.read(block)
                          e_lc = e.filename.lower()
                          if filename_lc < e_lc \
                              or (filename_lc == e_lc and code < e.code):
                              next_node = ptr
                              break
                          elif filename_lc == e_lc and code == e.code:
                              self._delete_inner(path, node, filename_lc, code)
                              return
                      path.append(node)
                      node = next_node
                  else:
                      if self._delete_leaf(node, filename_lc, code):
                          self._rebalance(path, node)
                      return
function_tokens: def delete ( self , filename , code ) : if isinstance ( filename , DSStoreEntry ) : code = filename . code filename = filename . filename # If we're deleting *every* node for "filename", we must recurse if code is None : ###TODO: Fix this so we can do bulk deletes raise ValueError ( 'You must delete items individually.  Sorry' ) # Otherwise, we're deleting *one* specific node filename_lc = filename . lower ( ) path = [ ] node = self . _rootnode while True : with self . _get_block ( node ) as block : next_node , count = block . read ( b'>II' ) if next_node : for n in range ( count ) : ptr = block . read ( b'>I' ) [ 0 ] e = DSStoreEntry . read ( block ) e_lc = e . filename . lower ( ) if filename_lc < e_lc or ( filename_lc == e_lc and code < e . code ) : next_node = ptr break elif filename_lc == e_lc and code == e . code : self . _delete_inner ( path , node , filename_lc , code ) return path . append ( node ) node = next_node else : if self . _delete_leaf ( node , filename_lc , code ) : self . _rebalance ( path , node ) return