def __remove(self, path, check_empty=False): # {{{3
    node_id, inode = self.__path2keys(path)
    # Make sure directories are empty before deleting them to avoid orphaned inodes.
    query = """ SELECT COUNT(t.id) FROM tree t, inodes i WHERE
                t.parent_id = ? AND i.inode = t.inode AND i.nlinks > 0 """
    if check_empty and 0 > self.__fetchval(query, node_id):
      raise OSError, (errno.ENOTEMPTY, os.strerror(errno.ENOTEMPTY), path)
    self.__cache_set(path, None)
    self.conn.execute('DELETE FROM tree WHERE id = ?', (node_id,))
    self.conn.execute('UPDATE inodes SET nlinks = nlinks - 1 WHERE inode = ?', (inode,))
    # Inodes with nlinks = 0 are purged periodically from __collect_garbage() so
    # we don't have to do that here.
    if self.__fetchval('SELECT mode FROM inodes where inode = ?', inode) & stat.S_IFDIR:
      parent_id, parent_ino = self.__path2keys(os.path.split(path)[0])
      self.conn.execute('UPDATE inodes SET nlinks = nlinks - 1 WHERE inode = ?', (parent_ino,))
dataset/ETHPy150Open xolox/dedupfs/dedupfs.py/DedupFS.__remove/swapped operands of `>`