<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace Foundatio.Caching {
    public class ScopedCacheClient : ICacheClient {
        public ScopedCacheClient(ICacheClient client, string scope)
        {
            UnscopedCache = client ?? new NullCacheClient();
            Scope = scope;
        }

        public ICacheClient UnscopedCache { get; private set; }

        public string Scope { get; private set; }

        protected string GetScopedCacheKey(string key)
        {
            return key;
        }

        protected IEnumerable<string> GetScopedCacheKey(IEnumerable<string> keys) {
            return keys.Select(GetScopedCacheKey);
        }

        public bool Remove(string key)
        {
            return UnscopedCache.Remove(GetScopedCacheKey(key));
        }

        public void RemoveAll(IEnumerable<string> keys)
        {
            UnscopedCache.RemoveAll(GetScopedCacheKey(keys));
        }

        public T Get<T>(string key)
        {
            return UnscopedCache.Get<T>(GetScopedCacheKey(key));
        }

        public bool TryGet<T>(string key, out T value)
        {
            return UnscopedCache.TryGet<T>(GetScopedCacheKey(key), out value);
        }

        public long Increment(string key, uint amount)
        {
            return UnscopedCache.Increment(GetScopedCacheKey(key), amount);
        }
<commit_msg>Forgot to actually scope the key.<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace Foundatio.Caching {
    public class ScopedCacheClient : ICacheClient {
        public ScopedCacheClient(ICacheClient client, string scope)
        {
            UnscopedCache = client ?? new NullCacheClient();
            Scope = scope;
        }

        public ICacheClient UnscopedCache { get; private set; }

        public string Scope { get; private set; }

        protected string GetScopedCacheKey(string key)
        {
            return String.Concat(Scope, ":", key);
        }

        protected IEnumerable<string> GetScopedCacheKey(IEnumerable<string> keys) {
            return keys.Select(GetScopedCacheKey);
        }

        public bool Remove(string key)
        {
            return UnscopedCache.Remove(GetScopedCacheKey(key));
        }

        public void RemoveAll(IEnumerable<string> keys)
        {
            UnscopedCache.RemoveAll(GetScopedCacheKey(keys));
        }

        public T Get<T>(string key)
        {
            return UnscopedCache.Get<T>(GetScopedCacheKey(key));
        }

        public bool TryGet<T>(string key, out T value)
        {
            return UnscopedCache.TryGet<T>(GetScopedCacheKey(key), out value);
        }

        public long Increment(string key, uint amount)
        {
            return UnscopedCache.Increment(GetScopedCacheKey(key), amount);
        }

{'fraction_non_alphanumeric': 0.08411867364746946, 'fraction_numerical': 0.0, 'mean_word_length': 2.2058165548098434, 'pattern_counts': {'":': 1, '<': 17, '<?xml version=': 0, '>': 17, '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': '4723629', 'n_tokens_mistral': 791, 'n_tokens_neox': 771, 'n_words': 174}