def remove_qos(self, qid: int, d: FlowMatch.Direction, recovery_mode=False, skip_filter=False):
    if ((not self._initialized) and (not recovery_mode)):
        return
    if ((qid < self._start_idx) or (qid > (self._max_idx - 1))):
        LOG.error('invalid qid %d, removal failed', qid)
        return
    LOG.debug('deleting qos_handle %s, skip_filter %s', qid, skip_filter)
    intf = (self._uplink if (d == FlowMatch.UPLINK) else self._downlink)
    err = TrafficClass.delete_class(intf, qid, skip_filter)
    if (err == 0):
        self._id_manager.release_idx(qid)
    else:
        LOG.error('error deleting class %d, not releasing idx', qid)
    return
def remove_qos(self, qid: int, d: FlowMatch.Direction, recovery_mode=False, skip_filter=False):
    if ((not self._initialized) and (not recovery_mode)):
        return
    if ((qid < self._start_idx) or (qid > (self._max_idx - 1))):
        LOG.error('invalid qid %d, removal failed', qid)
        return
    LOG.debug('deleting qos_handle %s, skip_filter %s', qid, skip_filter)
    intf = (self._uplink if (d == FlowMatch.UPLINK) else self._downlink)
    err = TrafficClass.delete_class(intf, qid, skip_filter)
    if (err == 0):
        self._id_manager.release_idx(qid)
    else:
        LOG.error('error deleting class %d, not releasing idx', qid)
    return