<commit_before>Title: All Tags
---
@using FluentBootstrap;

@{    
	var DocumentsByTag = Documents
        .ContainsKey("Published")
        .ToLookup<string>("Tags");
	string Tag = Model.Get<string>("Tag", null);
}

@using (Bs.Div().AddCss("container-sm-height").Begin())
{
    using (var row = Bs.GridRow().AddCss("row-sm-height").Begin())
    {<commit_msg>Temporary replacement of old ToLookup() in tag index<commit_after>Title: All Tags
---
@using FluentBootstrap;

@{    
    // This replicates the old ToLookup() extension - obsolete with new extensions
    IDictionary<IDocument, IEnumerable<string>> documentValues = Documents
        .Distinct()
        .Select(x =>
        {
            IEnumerable<string> values;
            return new KeyValuePair<IDocument, IEnumerable<string>>(x, x.MetadataAs<IEnumerable<string>>().TryGetValue("Tags", out values) ? values : null);
        })
        .Where(x => x.Value != null)
        .ToDictionary(x => x.Key, x => x.Value);
    var DocumentsByTag = documentValues
        .SelectMany(x => x.Value)
        .Distinct()
        .SelectMany(x => documentValues.Where(
            y => y.Value.Contains(x)).Select(y => new KeyValuePair<string, IDocument>(x, y.Key)))
        .ToLookup(x => x.Key, x => x.Value);

	string Tag = Model.Get<string>("Tag", null);
}

@using (Bs.Div().AddCss("container-sm-height").Begin())
{
    using (var row = Bs.GridRow().AddCss("row-sm-height").Begin())
    {
{'fraction_non_alphanumeric': 0.16759002770083103, 'fraction_numerical': 0.0, 'mean_word_length': 3.0476190476190474, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 24, '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': '2606622', 'n_tokens_mistral': 464, 'n_tokens_neox': 455, 'n_words': 94}