'Delete the block or tree rooted at block (if delete_children) and any references w/in the course to the block
from a new version of the course structure.
returns CourseLocator for new version
raises ItemNotFoundError if the location does not exist.
raises ValueError if usage_locator points to the structure root
Creates a new course version. If the descriptor\'s location has a org, a course, and a run, it moves the course head
pointer. If the version_guid of the descriptor points to a non-head version and there\'s been an intervening
change to this item, it raises a VersionConflictError unless force is True. In the force case, it forks
the course but leaves the head pointer where it is (this change will not be in the course head).'

def delete_item(self, usage_locator, user_id, force=False):

    if ((not isinstance(usage_locator, BlockUsageLocator)) or usage_locator.deprecated):
        raise ItemNotFoundError(usage_locator)
    with self.bulk_operations(usage_locator.course_key):
        original_structure = self._lookup_course(usage_locator.course_key).structure
        block_key = BlockKey.from_usage_key(usage_locator)
        if (original_structure['root'] == block_key):
            raise ValueError('Cannot    delete    the    root    of    a    course')
        if (block_key not in original_structure['blocks']):
            raise ValueError('Cannot    delete    block_key    {}    from    course    {},    because    that    block    does    not    exist.'.format(block_key, usage_locator))
        index_entry = self._get_index_if_valid(usage_locator.course_key, force)
        new_structure = self.version_structure(usage_locator.course_key, original_structure, user_id)
        new_blocks = new_structure['blocks']
        new_id = new_structure['_id']
        parent_block_keys = self._get_parents_from_structure(block_key, original_structure)
        for parent_block_key in parent_block_keys:
            parent_block = new_blocks[parent_block_key]
            parent_block.fields['children'].remove(block_key)
            parent_block.edit_info.edited_on = datetime.datetime.now(UTC)
            parent_block.edit_info.edited_by = user_id
            parent_block.edit_info.previous_version = parent_block.edit_info.update_version
            parent_block.edit_info.update_version = new_id
            parent_block.edit_info.source_version = None
            self.decache_block(usage_locator.course_key, new_id, parent_block_key)
        self._remove_subtree(BlockKey.from_usage_key(usage_locator), new_blocks)
        self.update_structure(usage_locator.course_key, new_structure)
        if (index_entry is not None):
            self._update_head(usage_locator.course_key, index_entry, usage_locator.branch, new_id)
            result = usage_locator.course_key.for_version(new_id)
        else:
            result = CourseLocator(version_guid=new_id)
        if isinstance(usage_locator.course_key, LibraryLocator):
            self._flag_library_updated_event(usage_locator.course_key)
        self._emit_item_deleted_signal(usage_locator, user_id)
        return result
