<commit_before><?php

namespace OP;

use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\ArrayList;

/**
 * Class used to respond with JSON requests. Supports debugging.
 */
class EBSResponse {

	private $code;
	private $content;
	private $error;
	private $raw;
	private $url;

	function __construct($content, $code, $url) {
		$this->code = $code;
		$this->content = null;
		$this->raw = $content;
		$this->url = $url;
		if ($code == 200 && is_string($content)) {
			$this->content = json_decode($content);
		} else if (is_string($content)) {
			$this->error = json_decode($content);
		}
	}

	/**
	 * JSON array of the result of the response
	 * @return json array
	 */<commit_msg>Update EBSResponse.php<commit_after><?php

namespace OP;

use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\ArrayList;
use SilverStripe\Dev\Debug;

/**
 * Class used to respond with JSON requests. Supports debugging.
 */
class EBSResponse {

	private $code;
	private $content;
	private $error;
	private $raw;
	private $url;

	function __construct($content, $code, $url) {
		$this->code = $code;
		$this->content = null;
		$this->raw = $content;
		$this->url = $url;
		if ($code == 200 && is_string($content)) {
			$this->content = json_decode($content);
		} else if (is_string($content)) {
			$this->error = json_decode($content);
		}
	}

	/**
	 * JSON array of the result of the response
	 * @return json array
	 */
{'fraction_non_alphanumeric': 0.15395580898075553, 'fraction_numerical': 0.0042765502494654314, 'mean_word_length': 3.858131487889273, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '766667', 'n_tokens_mistral': 515, 'n_tokens_neox': 474, 'n_words': 127}