'End the active bulk operation on structure_key (course or library key).'

def _end_bulk_operation(self, structure_key, emit_signals=True, ignore_case=False):

    bulk_ops_record = self._get_bulk_ops_record(structure_key, ignore_case)
    if (not bulk_ops_record.active):
        return
    if (emit_signals and bulk_ops_record.is_root):
        self.send_pre_publish_signal(bulk_ops_record, structure_key)
    bulk_ops_record.unnest()
    if bulk_ops_record.active:
        return
    dirty = self._end_outermost_bulk_operation(bulk_ops_record, structure_key)
    bulk_ops_record.nest()
    if (emit_signals and dirty):
        self.send_bulk_published_signal(bulk_ops_record, structure_key)
        self.send_bulk_library_updated_signal(bulk_ops_record, structure_key)
    bulk_ops_record.unnest()
    self._clear_bulk_ops_record(structure_key)
