<commit_before>use crate::config::Config;
use crate::cpp_checks::CppChecksItem;
use crate::cpp_code_generator::{all_include_directives, write_include_directives};
use crate::cpp_data::CppPath;
use crate::cpp_ffi_data::CppFfiItem;
use crate::cpp_type::CppType;
use crate::database::{DatabaseClient, DbItem, ItemId};
use crate::processor::ProcessorData;
use crate::{cluster_api, cpp_code_generator};
use itertools::Itertools;
use log::{debug, error, info, trace};
use rayon::iter::ParallelIterator;
use rayon::slice::ParallelSliceMut;
use ritual_common::cpp_build_config::{CppBuildConfigData, CppBuildPaths};
use ritual_common::cpp_lib_builder::{
    BuildType, CMakeConfigData, CppLibBuilder, CppLibBuilderOutput,
};
use ritual_common::errors::{bail, err_msg, Result};
use ritual_common::file_utils::{
    copy_recursively, create_dir_all, create_file, os_str_to_str, remove_dir_all,
};
use ritual_common::target::{current_target, LibraryTarget};
use ritual_common::utils::ProgressBar;
use serde_derive::{Deserialize, Serialize};
use std::collections::{hash_map::Entry, HashMap};
use std::io::Write;
use std::iter::once;
use std::path::PathBuf;
use std::sync::{Arc, Mutex};
use std::thread::ThreadId;
use std::time::Instant;
use std::{iter, thread};

pub const CHUNK_SIZE: usize = 64;

fn snippet_for_item(item: DbItem<&CppFfiItem>, database: &DatabaseClient) -> Result<Snippet> {
    match &item.item {
        CppFfiItem::Function(_) => {
            let item = item.map(|item| item.as_function_ref().unwrap());
            let item_code = cpp_code_generator::function_implementation(database, item.clone())?;
            let mut needs_moc = false;

            let source_ffi_item = database.source_ffi_item(&item.id)?;

            let full_code = if let Some(source_ffi_item) = source_ffi_item {
                if source_ffi_item.item.is_slot_wrapper() {
                    needs_moc = true
                }
                let source_item_code = source_ffi_item.item.source_item_cpp_code(database)?;<commit_msg>set needs_moc when using signal wrappers<commit_after>use crate::config::Config;
use crate::cpp_checks::CppChecksItem;
use crate::cpp_code_generator::{all_include_directives, write_include_directives};
use crate::cpp_data::CppPath;
use crate::cpp_ffi_data::CppFfiItem;
use crate::cpp_type::CppType;
use crate::database::{DatabaseClient, DbItem, ItemId};
use crate::processor::ProcessorData;
use crate::{cluster_api, cpp_code_generator};
use itertools::Itertools;
use log::{debug, error, info, trace};
use rayon::iter::ParallelIterator;
use rayon::slice::ParallelSliceMut;
use ritual_common::cpp_build_config::{CppBuildConfigData, CppBuildPaths};
use ritual_common::cpp_lib_builder::{
    BuildType, CMakeConfigData, CppLibBuilder, CppLibBuilderOutput,
};
use ritual_common::errors::{bail, err_msg, Result};
use ritual_common::file_utils::{
    copy_recursively, create_dir_all, create_file, os_str_to_str, remove_dir_all,
};
use ritual_common::target::{current_target, LibraryTarget};
use ritual_common::utils::ProgressBar;
use serde_derive::{Deserialize, Serialize};
use std::collections::{hash_map::Entry, HashMap};
use std::io::Write;
use std::iter::once;
use std::path::PathBuf;
use std::sync::{Arc, Mutex};
use std::thread::ThreadId;
use std::time::Instant;
use std::{iter, thread};

pub const CHUNK_SIZE: usize = 64;

fn snippet_for_item(item: DbItem<&CppFfiItem>, database: &DatabaseClient) -> Result<Snippet> {
    match &item.item {
        CppFfiItem::Function(_) => {
            let item = item.map(|item| item.as_function_ref().unwrap());
            let item_code = cpp_code_generator::function_implementation(database, item.clone())?;
            let mut needs_moc = false;

            let source_ffi_item = database.source_ffi_item(&item.id)?;

            let full_code = if let Some(source_ffi_item) = source_ffi_item {
                if source_ffi_item.item.is_slot_wrapper()
                    || source_ffi_item.item.is_signal_wrapper()
                {
                    needs_moc = true;
                }
                let source_item_code = source_ffi_item.item.source_item_cpp_code(database)?;
{'fraction_non_alphanumeric': 0.12952243125904486, 'fraction_numerical': 0.000964785335262904, 'mean_word_length': 5.340978593272172, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3796583', 'n_tokens_mistral': 1329, 'n_tokens_neox': 1355, 'n_words': 249}