<commit_before>using System;
using System.IO;
using System.Linq;
using System.Reflection;
using UnityEditor;
using UnityEngine;

namespace GitHub.Unity
{
    class Utility : ScriptableObject
    {
        public static Texture2D GetIcon(string filename, string filename2x = "")
        {
            if (EditorGUIUtility.pixelsPerPoint > 1f && !string.IsNullOrEmpty(filename2x))
            {
                filename = filename2x;
            }

            Texture2D texture2D = null;

            var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("GitHub.Unity.IconsAndLogos." + filename);
            if (stream != null)
            {
                texture2D = stream.ToTexture2D();
            }
            else
            {
                var iconPath = EntryPoint.Environment.ExtensionInstallPath.Combine("IconsAndLogos", filename).ToString(SlashMode.Forward);
                texture2D = AssetDatabase.LoadAssetAtPath<Texture2D>(iconPath);
            }

            if (texture2D != null)
            {
                texture2D.hideFlags = HideFlags.HideAndDontSave;
            }

            return texture2D;
        }

        public static Texture2D GetTextureFromColor(Color color)
        {
            Color[] pix = new Color[1];
            pix[0] = color;

            Texture2D result = new Texture2D(1, 1);
            result.hideFlags = HideFlags.HideAndDontSave;
            result.SetPixels(pix);
            result.Apply();

            return result;
        }

        public static NPath GetTool(string tool)
        {
            var outfile = Application.temporaryCachePath.ToNPath().Combine(tool);

            if (tool == "octorun.exe")<commit_msg>Place the tools in a known location independent of project<commit_after>using System;
using System.IO;
using System.Linq;
using System.Reflection;
using UnityEditor;
using UnityEngine;

namespace GitHub.Unity
{
    class Utility : ScriptableObject
    {
        public static Texture2D GetIcon(string filename, string filename2x = "")
        {
            if (EditorGUIUtility.pixelsPerPoint > 1f && !string.IsNullOrEmpty(filename2x))
            {
                filename = filename2x;
            }

            Texture2D texture2D = null;

            var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("GitHub.Unity.IconsAndLogos." + filename);
            if (stream != null)
            {
                texture2D = stream.ToTexture2D();
            }
            else
            {
                var iconPath = EntryPoint.Environment.ExtensionInstallPath.Combine("IconsAndLogos", filename).ToString(SlashMode.Forward);
                texture2D = AssetDatabase.LoadAssetAtPath<Texture2D>(iconPath);
            }

            if (texture2D != null)
            {
                texture2D.hideFlags = HideFlags.HideAndDontSave;
            }

            return texture2D;
        }

        public static Texture2D GetTextureFromColor(Color color)
        {
            Color[] pix = new Color[1];
            pix[0] = color;

            Texture2D result = new Texture2D(1, 1);
            result.hideFlags = HideFlags.HideAndDontSave;
            result.SetPixels(pix);
            result.Apply();

            return result;
        }

        public static NPath GetTool(string tool)
        {
            var outfile = EntryPoint.Environment.UserCachePath.Combine("tools", tool);
            outfile.EnsureParentDirectoryExists();

            if (tool == "octorun.exe")
{'fraction_non_alphanumeric': 0.08677098150782361, 'fraction_numerical': 0.011948790896159318, 'mean_word_length': 1.8608624898291293, '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': '3870729', 'n_tokens_mistral': 969, 'n_tokens_neox': 919, 'n_words': 188}