<commit_before>namespace $.$$ {
	
	export class $mol_app_bench extends $.$mol_app_bench {
		
		@ $mol_mem
		bench( next? : string ) {
			return $mol_state_arg.value( this.state_key( 'bench' ) , next ) || 'list/'
		}
		
		@ $mol_mem
		sandbox( next? : HTMLIFrameElement , force? : $mol_atom_force ) : HTMLIFrameElement {
			const next2 = this.Sandbox().dom_node() as HTMLIFrameElement
			
			next2.src = this.bench()
			
			next2.onload = event => {
				next2.onload = null
				this.sandbox( next2 , $mol_atom_force )
			}
			
			throw new $mol_atom_wait( `Loading sandbox...` )
		}

		'command_current()' : any[]
		
		@ $mol_mem
		command_current( next? : any[] , force? : $mol_atom_force ) {
			if( this['command_current()']['value()'] ) return
			return next
		}
		
		@ $mol_mem_key
		command_result< Result >( command : any[] , next? : Result ) : Result {
			const sandbox = this.sandbox()
			sandbox.valueOf()
			
			if( next !== void 0 ) return next
			
			const current = this.command_current( command )
			if( current !== command ) throw new $mol_atom_wait( `Waiting for ${ JSON.stringify( current ) }...` )
			
			requestAnimationFrame( ()=> {
				sandbox.contentWindow.postMessage( command , '*' )
				
				window.onmessage = event => {
					if( event.data[ 0 ] !== 'done' ) return
					window.onmessage = null
					
					this.command_current( null , $mol_atom_force )
					this.command_result( command , event.data[ 1 ] )
				}
			} )
			
			throw new $mol_atom_wait( `Running ${ command }...` )
		}
		
		meta() {
			type meta = {
				title : { [ lang : string ] : string }
				descr : { [ lang : string ] : string }
				samples : { [ sample : string ] : {
					title : { [ lang : string ] : string }
				} }
				steps : { [ step : string ] : {
					title : { [ lang : string ] : string }
				} }
				params : { [ param : string ] : {
					title : { [ lang : string ] : string }
					default : number
					type : string
					precision : number
				} }
			}
			return this.command_result< meta >( [ 'meta' ] )
		}
		
		@ $mol_mem
		samples_all( next? : string[] ) {
			return Object.keys( this.meta().samples ).sort( ( a , b )=> {
				const titleA = this.sample_title( a ).toLowerCase()
				const titleB = this.sample_title( a ).toLowerCase()
				return titleA > titleB ? 1 : titleA < titleB ? -1 : 0
			} )
		}
		
		@ $mol_mem
		samples( next? : string[] ) : string[] {
			const arg = $mol_state_arg.value( this.state_key( 'sample' ) , next && next.join( '~' ) )
			return arg ? arg.split( '~' ).sort() : []
		}
		
		@ $mol_mem
		steps( next? : string[] ) {
			return Object.keys( this.meta().steps )<commit_msg>$mol_app_bench: no fail on not exists sample.<commit_after>namespace $.$$ {
	
	export class $mol_app_bench extends $.$mol_app_bench {
		
		@ $mol_mem
		bench( next? : string ) {
			return $mol_state_arg.value( this.state_key( 'bench' ) , next ) || 'list/'
		}
		
		@ $mol_mem
		sandbox( next? : HTMLIFrameElement , force? : $mol_atom_force ) : HTMLIFrameElement {
			const next2 = this.Sandbox().dom_node() as HTMLIFrameElement
			
			next2.src = this.bench()
			
			next2.onload = event => {
				next2.onload = null
				this.sandbox( next2 , $mol_atom_force )
			}
			
			throw new $mol_atom_wait( `Loading sandbox...` )
		}

		'command_current()' : any[]
		
		@ $mol_mem
		command_current( next? : any[] , force? : $mol_atom_force ) {
			if( this['command_current()']['value()'] ) return
			return next
		}
		
		@ $mol_mem_key
		command_result< Result >( command : any[] , next? : Result ) : Result {
			const sandbox = this.sandbox()
			sandbox.valueOf()
			
			if( next !== void 0 ) return next
			
			const current = this.command_current( command )
			if( current !== command ) throw new $mol_atom_wait( `Waiting for ${ JSON.stringify( current ) }...` )
			
			requestAnimationFrame( ()=> {
				sandbox.contentWindow.postMessage( command , '*' )
				
				window.onmessage = event => {
					if( event.data[ 0 ] !== 'done' ) return
					window.onmessage = null
					
					this.command_current( null , $mol_atom_force )
					this.command_result( command , event.data[ 1 ] )
				}
			} )
			
			throw new $mol_atom_wait( `Running ${ command }...` )
		}
		
		meta() {
			type meta = {
				title : { [ lang : string ] : string }
				descr : { [ lang : string ] : string }
				samples : { [ sample : string ] : {
					title : { [ lang : string ] : string }
				} }
				steps : { [ step : string ] : {
					title : { [ lang : string ] : string }
				} }
				params : { [ param : string ] : {
					title : { [ lang : string ] : string }
					default : number
					type : string
					precision : number
				} }
			}
			return this.command_result< meta >( [ 'meta' ] )
		}
		
		@ $mol_mem
		samples_all( next? : string[] ) {
			return Object.keys( this.meta().samples ).sort( ( a , b )=> {
				const titleA = this.sample_title( a ).toLowerCase()
				const titleB = this.sample_title( a ).toLowerCase()
				return titleA > titleB ? 1 : titleA < titleB ? -1 : 0
			} )
		}
		
		@ $mol_mem
		samples( next? : string[] ) : string[] {
			const arg = $mol_state_arg.value( this.state_key( 'sample' ) , next && next.join( '~' ) )
			const all = this.samples_all()
			return arg ? arg.split( '~' ).sort().filter( name => all.indexOf( name ) >= 0 ) : []
		}
		
		@ $mol_mem
		steps( next? : string[] ) {
			return Object.keys( this.meta().steps )
{'fraction_non_alphanumeric': 0.15785540818232766, 'fraction_numerical': 0.00429665608070241, 'mean_word_length': 2.508519003931848, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 19, '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': '6054693', 'n_tokens_mistral': 2301, 'n_tokens_neox': 1809, 'n_words': 421}