<commit_before>// View controller
class View {
	constructor( server ) {
		this.server = server;
		this.path = require( 'path' );
		this.fs = require( 'graceful-fs' );
		this.ejs = require( 'ejs' );
		this.Response = new ( require( this.path.normalize( this.path.resolve( __dirname + '/' + '../libs/response/response' ) ) ) )();
		this.Common = new ( require( this.path.normalize( this.path.resolve( __dirname + '/' + './common' ) ) ) )();
		this.loginView = '/account/sign-in.ejs';
		this.notFoundView = '/common/404.ejs';
	}

	// Get view controller (with or without authentication)
	get( request , response , allowedMethodTypes , authenticate ) {
		var self = this,
			route = ( request && request.route != undefined ) ? request.route : null,
			locale = ( route ) ? route.locale : null,
			query = ( route ) ? route.query : null,
			path = ( query && query.path ) ? query.path : ( ( route ) ? route.path : null ),
			pretty = ( query && query.pretty ) ? ( ( parseInt( query.pretty , 10 ) != NaN ) ? parseInt( query.pretty , 10 ) : query.pretty ) : undefined,
			view = ( path ) ? path + '.ejs' : self.notFoundView;

		if( !self.Common[ 'method-allowed' ]( request , response , allowedMethodTypes ) ) return false;

		self.getView( request , response , view , locale , null );
	}<commit_msg>initial commit, cleaning<commit_after>// View controller
class View {
	constructor( server ) {
		this.server = server;
		this.path = require( 'path' );
		this.fs = require( 'graceful-fs' );
		this.ejs = require( 'ejs' );
		this.Response = new ( require( this.path.normalize( this.path.resolve( __dirname + '/' + '../libs/response/response' ) ) ) )();
		this.Common = new ( require( this.path.normalize( this.path.resolve( __dirname + '/' + './common' ) ) ) )();
		this.notFoundView = '/common/404.ejs';
	}

	// Get view controller (with or without authentication)
	get( request , response , allowedMethodTypes , authenticate ) {
		var self = this,
			route = ( request && request.route != undefined ) ? request.route : null,
			locale = ( route ) ? route.locale : null,
			query = ( route ) ? route.query : null,
			path = ( query && query.path ) ? query.path : ( ( route ) ? route.path : null ),
			pretty = ( query && query.pretty ) ? ( ( parseInt( query.pretty , 10 ) != NaN ) ? parseInt( query.pretty , 10 ) : query.pretty ) : undefined,
			view = ( path ) ? path + '.ejs' : self.notFoundView;

		if( !self.Common[ 'method-allowed' ]( request , response , allowedMethodTypes ) ) return false;

		self.getView( request , response , view , locale , null );
	}
{'fraction_non_alphanumeric': 0.1707126076742365, 'fraction_numerical': 0.00548159749412686, 'mean_word_length': 3.2512479201331117, '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': '6394517', 'n_tokens_mistral': 880, 'n_tokens_neox': 801, 'n_words': 206}