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

public partial class ModuleWeaver
{
    public Func<TypeDefinition, bool> ShouldIncludeType;
    List<LineMatcher> lineMatchers;

    public void ProcessIncludesExcludes()
    {
        if (ExcludeNamespaces.Any())
        {
            lineMatchers = GetLines(ExcludeNamespaces).ToList();
            ShouldIncludeType = definition => lineMatchers.All(lineMatcher => !lineMatcher.Match(definition.Namespace)) && !ContainsIgnoreAttribute(definition);
            return;
        }

        if (IncludeNamespaces.Any())
        {
            lineMatchers = GetLines(IncludeNamespaces).ToList();
            ShouldIncludeType = definition => lineMatchers.Any(lineMatcher => lineMatcher.Match(definition.Namespace)) && !ContainsIgnoreAttribute(definition);
            return;
        }

        ShouldIncludeType = definition => !ContainsIgnoreAttribute(definition);
    }

    bool ContainsIgnoreAttribute(TypeDefinition typeDefinition)
    {
        return typeDefinition.CustomAttributes.ContainsAttribute("DoNotVirtualizeAttribute");
    }

    public static IEnumerable<LineMatcher> GetLines(List<string> namespaces)
    {
        return namespaces.Select(BuildLineMatcher);<commit_msg>Update InclusionChecker.cs<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using Mono.Cecil;

public partial class ModuleWeaver
{
    public Func<TypeDefinition, bool> ShouldIncludeType;
    List<LineMatcher> lineMatchers;

    public void ProcessIncludesExcludes()
    {
        if (ExcludeNamespaces.Any())
        {
            lineMatchers = GetLines(ExcludeNamespaces).ToList();
            ShouldIncludeType = type =>
            {
                return lineMatchers.All(lineMatcher => !lineMatcher.Match(type.Namespace)) &&
                       !ContainsIgnoreAttribute(type);
            };
            return;
        }

        if (IncludeNamespaces.Any())
        {
            lineMatchers = GetLines(IncludeNamespaces).ToList();
            ShouldIncludeType = type =>
            {
                return lineMatchers.Any(lineMatcher => lineMatcher.Match(type.Namespace)) &&
                       !ContainsIgnoreAttribute(type);
            };
            return;
        }

        ShouldIncludeType = definition => !ContainsIgnoreAttribute(definition);
    }

    bool ContainsIgnoreAttribute(TypeDefinition typeDefinition)
    {
        return typeDefinition.CustomAttributes.ContainsAttribute("DoNotVirtualizeAttribute");
    }

    public static IEnumerable<LineMatcher> GetLines(List<string> namespaces)
    {
        return namespaces.Select(BuildLineMatcher);
{'fraction_non_alphanumeric': 0.09117755629383537, 'fraction_numerical': 0.0, 'mean_word_length': 2.8549075391180656, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 21, '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': '6521338', 'n_tokens_mistral': 678, 'n_tokens_neox': 662, 'n_words': 114}