<commit_before>/*!
 * qwebs
 * Copyright(c) 2016 <NAME>
 * MIT Licensed
 */

"use strict";

const Readable = require('stream').Readable;

class MyReadable extends Readable {
  constructor(options) {
    super(options);
  }

  _read() {};
}

class InfoService {
	constructor() {	
	};
	
	whoiam() {
		return "I'm Info service.";
	};

	getInfo(request, response) {
		let content = {
			whoiam: this.whoiam()
		};
		return response.send({ request: request, content: content });
	};

	getMessage(request, response) {
		let source = new PassThrough;
		setTimeout(() => {
		  source.push({ text: "hello world" });
		  source.push(null);
		}, 1000);
		return response.send({ request: request, stream: source }); //use stream instead of content		
	};
	
	save(request, response) {
		let content = {
			status: "saved"
		};
		return response.send({ request: request, content: content });
	};
	
	update(request, response) {
		let content = {
			status: "updated"
		};
		return response.send({ request: request, content: content });
	};
	
	delete(request, response) {
		let content = {
			status: "deleted"
		};
		return response.send({ request: request, content: content });
	};

        redirect(request, response) {
                return response.redirect({ url: "get" });<commit_msg>Update info.js<commit_after>/*!
 * qwebs
 * Copyright(c) 2016 <NAME>
 * MIT Licensed
 */

"use strict";

const Readable = require('stream').Readable;

class MyReadable extends Readable {
  constructor(options) {
    super(options);
  }

  _read() {};
}

class InfoService {
	constructor() {	
	};
	
	whoiam() {
		return "I'm Info service.";
	};

	getInfo(request, response) {
		let content = {
			whoiam: this.whoiam()
		};
		return response.send({ request: request, content: content });
	};

	getMessage(request, response) {
		let source = new MyReadable();
		setTimeout(() => {
		  source.push({ text: "hello world" });
		  source.push(null);
		}, 1000);
		return response.send({ request: request, stream: source }); //use stream instead of content		
	};
	
	save(request, response) {
		let content = {
			status: "saved"
		};
		return response.send({ request: request, content: content });
	};
	
	update(request, response) {
		let content = {
			status: "updated"
		};
		return response.send({ request: request, content: content });
	};
	
	delete(request, response) {
		let content = {
			status: "deleted"
		};
		return response.send({ request: request, content: content });
	};

        redirect(request, response) {
                return response.redirect({ url: "get" });
{'fraction_non_alphanumeric': 0.15713166144200627, 'fraction_numerical': 0.006269592476489028, 'mean_word_length': 3.33446519524618, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '1168035', 'n_tokens_mistral': 890, 'n_tokens_neox': 786, 'n_words': 211}