<commit_before>var Path = require('path');
var fs = require('fs');
var debug = require('debug')('express-dom');
var pify = require('pify');
var BufferList = require('bl');
var http = require('http');
var https = require('https');
var URL = require('url');
var PassThrough = require('stream').PassThrough;

exports.view = function(mw, settings, request, response) {
	if (settings.input != null) return;
	var view = settings.view || request.path;

	if (Buffer.isBuffer(view)) {
		return update(view);
	}
	if (
		(typeof view == "string" && /^https?:\/\//.test(view))
		||
		(view.protocol && view.hostname)
	) {
		view = pipeUrl(view);
	}
	if (typeof view.pipe == "function") {
		return pify(function(cb) {
			view.pipe(BufferList(cb));
		})().then(update);
	}
	if (typeof view != "string") {
		return Promise.reject(new Error("unknown input type"));
	}
	if (view.startsWith('<')) {
		return update(view);
	}
	var root = request.app.get('views');
	if (!root) return Promise.reject(
		new Error("Please set app views")
	);<commit_msg>Name helper<commit_after>var Path = require('path');
var fs = require('fs');
var debug = require('debug')('express-dom');
var pify = require('pify');
var BufferList = require('bl');
var http = require('http');
var https = require('https');
var URL = require('url');
var PassThrough = require('stream').PassThrough;

exports.view = function view(mw, settings, request, response) {
	if (settings.input != null) return;
	var view = settings.view || request.path;

	if (Buffer.isBuffer(view)) {
		return update(view);
	}
	if (
		(typeof view == "string" && /^https?:\/\//.test(view))
		||
		(view.protocol && view.hostname)
	) {
		view = pipeUrl(view);
	}
	if (typeof view.pipe == "function") {
		return pify(function(cb) {
			view.pipe(BufferList(cb));
		})().then(update);
	}
	if (typeof view != "string") {
		return Promise.reject(new Error("unknown input type"));
	}
	if (view.startsWith('<')) {
		return update(view);
	}
	var root = request.app.get('views');
	if (!root) return Promise.reject(
		new Error("Please set app views")
	);
{'fraction_non_alphanumeric': 0.19757869249394674, 'fraction_numerical': 0.0, 'mean_word_length': 4.509333333333333, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1623621', 'n_tokens_mistral': 721, 'n_tokens_neox': 692, 'n_words': 174}