<commit_before>var promise = require( 'promise' ),
	select = require( 'select-dom' );

module.exports = function( data ) {

	if( !data )
		data = {};

	return new promise( function( onOk, onErr ) {

		if( data.dataDOM ) {

			if( !data.parentDOM )
				data.parentDOM = document.body;
			else if( data.parentDOM ) {

				if( typeof data.parentDOM == 'string' )
					data.parentDOM = select( data.parentDOM );<commit_msg>if parentDOM is defined, but doesn't exist add it to body<commit_after>var promise = require( 'promise' ),
	select = require( 'select-dom' );

module.exports = function( data ) {

	if( !data )
		data = {};

	return new promise( function( onOk, onErr ) {

		if( data.dataDOM ) {

			if( !data.parentDOM )
				data.parentDOM = document.body;
			else if( data.parentDOM ) {

				if( typeof data.parentDOM == 'string' )
					var parentDOM = select( data.parentDOM );

				if(!parentDOM){

					console.warn('parentDOM does not exist, so document.body will be used instead');

					parentDOM = document.createElement('div');
					parentDOM.setAttribute("id", data.parentDOM.replace('#',''));
					document.body.appendChild(parentDOM);
				}

				data.parentDOM = parentDOM;


{'fraction_non_alphanumeric': 0.14297729184188393, 'fraction_numerical': 0.0, 'mean_word_length': 3.327272727272727, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5656484', 'n_tokens_mistral': 445, 'n_tokens_neox': 371, 'n_words': 99}