'See :py:meth `SplitMongoModuleStore.copy_from_template`'

def copy_from_template(self, source_keys, dest_key, user_id, **kwargs):

    source_keys = [self._map_revision_to_branch(key) for key in source_keys]
    dest_key = self._map_revision_to_branch(dest_key)
    head_validation = kwargs.get('head_validation')
    new_keys = super(DraftVersioningModuleStore, self).copy_from_template(source_keys, dest_key, user_id, head_validation)
    if (dest_key.branch == ModuleStoreEnum.BranchName.draft):
        with self.bulk_operations(dest_key.course_key):
            keys_to_check = list(new_keys)
            while keys_to_check:
                usage_key = keys_to_check.pop()
                if (usage_key.category in DIRECT_ONLY_CATEGORIES):
                    self.publish(usage_key.version_agnostic(), user_id, blacklist=EXCLUDE_ALL, **kwargs)
                    children = getattr(self.get_item(usage_key, **kwargs), 'children', [])
                    keys_to_check.extend(children)
    return new_keys
