<commit_before>package com.microsoft.controllers;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.google.gson.Gson;
import com.microsoft.config.CloudConfig;
import com.microsoft.config.DocumentDBProps;

@RestController
public class UiController {

	@Autowired
	private ApplicationContext ctx;

	@RequestMapping("/test")
	public String testMessage() {
		return "Hello world";
	}

	@RequestMapping("/vcap")
	public String getEnv() {
		DocumentDBProps dbProps = new Gson().fromJson(System.getenv("credentials"), DocumentDBProps.class);

		return new Gson().toJson(dbProps);
	}

	@RequestMapping("/cloud")
	public String getCloud() {
		CloudConfig cloudConfig = ctx.getBean(CloudConfig.class);
		return new Gson().toJson(cloudConfig.cloud().getCloudProperties());
	}

	@RequestMapping("/service")
	public String getService() {
		CloudConfig cloudConfig = ctx.getBean(CloudConfig.class);
		return new Gson().toJson(cloudConfig.cloud().getServiceInfo("docdb-dev"));
	}

}<commit_msg>change env variable<commit_after>package com.microsoft.controllers;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.google.gson.Gson;
import com.microsoft.config.CloudConfig;
import com.microsoft.config.DocumentDBProps;

@RestController
public class UiController {

	@Autowired
	private ApplicationContext ctx;

	@RequestMapping("/test")
	public String testMessage() {
		return "Hello world";
	}

	@RequestMapping("/vcap")
	public String getEnv() {
		//Try to parse VCAP_SERVICES
		DocumentDBProps dbProps = new Gson().fromJson(System.getenv("VCAP_SERVICES"), DocumentDBProps.class);

		return new Gson().toJson(dbProps);
	}

	@RequestMapping("/cloud")
	public String getCloud() {
		CloudConfig cloudConfig = ctx.getBean(CloudConfig.class);
		return new Gson().toJson(cloudConfig.cloud().getCloudProperties());
	}

	@RequestMapping("/service")
	public String getService() {
		CloudConfig cloudConfig = ctx.getBean(CloudConfig.class);
		return new Gson().toJson(cloudConfig.cloud().getServiceInfo("docdb-dev"));
	}

}
{'fraction_non_alphanumeric': 0.12277063459145583, 'fraction_numerical': 0.0, 'mean_word_length': 6.243243243243243, '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': '4552428', 'n_tokens_mistral': 726, 'n_tokens_neox': 697, 'n_words': 132}