parameters: (self, entry)
docstring: Insert ``entry`` (which should be a :class:`DSStoreEntry`)
          into the B-Tree.
docstring_summary: Insert ``entry`` (which should be a :class:`DSStoreEntry`)
          into the B-Tree.
docstring_tokens: Insert entry ( which should be a : class : DSStoreEntry ) into the B - Tree .
function: def insert(self, entry):
          """Insert ``entry`` (which should be a :class:`DSStoreEntry`)
          into the B-Tree."""
          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)
                          if entry < e:
                              next_node = ptr
                              break
                          elif entry == e:
                              # If we find an existing entry the same, replace it
                              self._insert_inner(path, node, entry, None)
                              return
                      path.append(node)
                      node = next_node
                  else:
                      self._insert_leaf(path, node, entry)
                      return
function_tokens: def insert ( self , entry ) : 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 ) if entry < e : next_node = ptr break elif entry == e : # If we find an existing entry the same, replace it self . _insert_inner ( path , node , entry , None ) return path . append ( node ) node = next_node else : self . _insert_leaf ( path , node , entry ) return