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

using Smx.KodiInterop.Python;
using Smx.KodiInterop.Messages;

namespace Smx.KodiInterop
{
	public static class PythonInterop
    {
		#region Variables
		private const string LastResultVarName = "LastResult";

		public static string GetVariable(string variableName) {
			return EvalToResult(string.Format("Variables['{0}']", variableName));
		}

		public static void DestroyVariable(string variableName) {
			Eval(string.Format("del Variables['{0}']", variableName));
		}
		#endregion

		#region Escape
		public static string EscapeArgument(object argument, EscapeFlags escapeMethod = EscapeFlags.Quotes) {
			string text = argument.ToString();

			//TODO: handle culture decimal point -> python decimal point
			//TODO: handle "," in CallBuiltin

			//Don't escape primitives
			if(<commit_msg>Removed TODO as Builtin comma escaping is now implemented<commit_after>﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Text;
using System.Linq;

using Smx.KodiInterop.Python;
using Smx.KodiInterop.Messages;

namespace Smx.KodiInterop
{
	public static class PythonInterop
    {
		#region Variables
		private const string LastResultVarName = "LastResult";

		public static string GetVariable(string variableName) {
			return EvalToResult(string.Format("Variables['{0}']", variableName));
		}

		public static void DestroyVariable(string variableName) {
			Eval(string.Format("del Variables['{0}']", variableName));
		}
		#endregion

		#region Escape
		public static string EscapeArgument(object argument, EscapeFlags escapeMethod = EscapeFlags.Quotes) {
			string text = argument.ToString();

			//TODO: handle culture decimal point -> python decimal point

			//Don't escape primitives
			if(
{'fraction_non_alphanumeric': 0.09766233766233766, 'fraction_numerical': 0.002077922077922078, 'mean_word_length': 5.037617554858934, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1774351', 'n_tokens_mistral': 611, 'n_tokens_neox': 545, 'n_words': 153}