<commit_before>using System;
using System.Collections.Generic;
using System.Text;
using System.Json;
using System.Linq;

namespace Salesforce
{
	public class SObject : ISalesforceResource
	{
		private static readonly string Format = "{0}/";
		string id;
		IDictionary<string, string> options;
		string resourceName;
		bool constructedFromJson;
		SObject innerObject;

		public static SObject Parse (string jsonText)
		{
			try {
				var jsonValue = JsonObject.Parse (jsonText);
				return new SObject ((JsonObject) jsonValue);
			} catch {
				throw new ArgumentException ("Could not parse passed input text into JsonObject");
			}
		}

		#region ISalesforceResource implementation

		string ISalesforceResource.ResourceType {
			get {
				return "sobjects";
			}
		}

		public string Id
		{
			get { return innerObject == null ? id : innerObject.Id; }
			set
			{
				if (innerObject == null)
					id = value;
				else
					innerObject.Id = value;
			}
		}

		public IDictionary<string, string> Options
		{
			get { return innerObject == null ? options : innerObject.Options; }
			protected set { options = value; }
		}

		#endregion

		#region IVersionableRestResource implementation

		public string Version {
			get { return "v28.0"; }
		}

		#endregion

		#region IRestResource implementation

		public string ResourceName
		{
			get { return innerObject == null ? resourceName : innerObject.ResourceName; }
			set
			{
				if (innerObject == null)
					resourceName = value;
				else
					innerObject.ResourceName = value;
			}
		}

		public Uri AbsoluteUri { get { return new Uri (ToUriString (), UriKind.RelativeOrAbsolute); } }

		#endregion

		public SObject() : this(null) { }

		public SObject(JsonObject restObject)
		{
			if (restObject == null) {
				Options = new Dictionary<string, string> ();
			} else {
				constructedFromJson = true;
				Options = restObject.Where (o => o.Key != "attributes").ToDictionary(k => k.Key, v => v.Value != null ? (string)v.Value : String.Empty);
				ResourceName = restObject["attributes"]["type"];
				Id = restObject["Id"];
			}<commit_msg>Make sure we dont double add the ID<commit_after>using System;
using System.Collections.Generic;
using System.Text;
using System.Json;
using System.Linq;

namespace Salesforce
{
	public class SObject : ISalesforceResource
	{
		private static readonly string Format = "{0}/";
		string id;
		IDictionary<string, string> options;
		string resourceName;
		bool constructedFromJson;
		SObject innerObject;

		public static SObject Parse (string jsonText)
		{
			try {
				var jsonValue = JsonObject.Parse (jsonText);
				return new SObject ((JsonObject) jsonValue);
			} catch {
				throw new ArgumentException ("Could not parse passed input text into JsonObject");
			}
		}

		#region ISalesforceResource implementation

		string ISalesforceResource.ResourceType {
			get {
				return "sobjects";
			}
		}

		public string Id
		{
			get { return innerObject == null ? id : innerObject.Id; }
			set
			{
				if (innerObject == null)
					id = value;
				else
					innerObject.Id = value;
			}
		}

		public IDictionary<string, string> Options
		{
			get { return innerObject == null ? options : innerObject.Options; }
			protected set { options = value; }
		}

		#endregion

		#region IVersionableRestResource implementation

		public string Version {
			get { return "v28.0"; }
		}

		#endregion

		#region IRestResource implementation

		public string ResourceName
		{
			get { return innerObject == null ? resourceName : innerObject.ResourceName; }
			set
			{
				if (innerObject == null)
					resourceName = value;
				else
					innerObject.ResourceName = value;
			}
		}

		public Uri AbsoluteUri { get { return new Uri (ToUriString (), UriKind.RelativeOrAbsolute); } }

		#endregion

		public SObject() : this(null) { }

		public SObject(JsonObject restObject)
		{
			if (restObject == null) {
				Options = new Dictionary<string, string> ();
			} else {
				constructedFromJson = true;
				Options = restObject.Where (o => o.Key != "attributes").ToDictionary(k => k.Key, v => v.Value != null ? (string)v.Value : String.Empty);
				ResourceName = restObject["attributes"]["type"];
				Id = restObject["Id"];
				if (Options.ContainsKey ("Id"))
					Options.Remove ("Id");
			}
{'fraction_non_alphanumeric': 0.10562060889929742, 'fraction_numerical': 0.001873536299765808, 'mean_word_length': 3.288152610441767, 'pattern_counts': {'":': 0, '<': 9, '<?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': '6866548', 'n_tokens_mistral': 1540, 'n_tokens_neox': 1253, 'n_words': 360}