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

using NuClear.AdvancedSearch.Replication.CustomerIntelligence.Data.Context;
using NuClear.AdvancedSearch.Replication.CustomerIntelligence.Transforming.Operations;
using NuClear.AdvancedSearch.Replication.Model;

namespace NuClear.AdvancedSearch.Replication.CustomerIntelligence.Transforming
{
    internal abstract class ErmFactInfo
    {
        public static Builder<TFact> OfType<TFact>(params object[] x)
            where TFact : IErmFactObject, IIdentifiable
        {
            return new Builder<TFact>();
        }

        public abstract Type FactType { get; }

        public abstract Func<IErmFactsContext, IEnumerable<long>, IQueryable> Query { get; }

        public abstract IEnumerable<FactDependencyInfo> Aggregates { get; }

        public abstract IEnumerable<AggregateOperation> ApplyTo(ErmFactsTransformation transformation, IReadOnlyCollection<long> ids);

        internal class Builder<TFact>
            where TFact : IErmFactObject, IIdentifiable
        {
            private readonly List<FactDependencyInfo> _dependencies = new List<FactDependencyInfo>();
            private Func<IErmFactsContext, IEnumerable<long>, IQueryable<TFact>> _query;

            public Builder<TFact> HasSource(Func<IErmFactsContext, IEnumerable<long>, IQueryable<TFact>> query)
            {
                _query = query;
                return this;
            }

            public Builder<TFact> HasSource(Func<IErmFactsContext, IQueryable<TFact>> factQueryableProvider)
            {
                _query = (context, ids) =>
                                {
                                    var query = factQueryableProvider.Invoke(context);
                                    var filteredQuery = query.Where(fact => ids.Contains(fact.Id));
                                    return filteredQuery;
                                };
                return this;
            }

            public Builder<TFact> HasDependentAggregate<TAggregate>(Func<IErmFactsContext, IEnumerable<long>, IEnumerable<long>> dependentAggregateIdsQueryProvider)
                where TAggregate : ICustomerIntelligenceObject
            {
                _dependencies.Add(FactDependencyInfo.Create<TAggregate>(dependentAggregateIdsQueryProvider));
                return this;
            }

            public Builder<TFact> HasMatchedAggregate<TAggregate>()
            {
                _dependencies.Add(FactDependencyInfo.Create<TAggregate>());
                return this;
            }

            public static implicit operator ErmFactInfo(Builder<TFact> builder)
            {
                return new ErmFactInfoImpl<TFact>(builder._query, builder._dependencies);
            }
        }

        private class ErmFactInfoImpl<T> : ErmFactInfo
            where T : IErmFactObject
        {
            private readonly Func<IErmFactsContext, IEnumerable<long>, IQueryable<T>> _query;
            private readonly IReadOnlyCollection<FactDependencyInfo> _aggregates;

            public ErmFactInfoImpl(Func<IErmFactsContext, IEnumerable<long>, IQueryable<T>> query, IReadOnlyCollection<FactDependencyInfo> aggregates)
            {
                _query = query;
                _aggregates = aggregates ?? new FactDependencyInfo[0];
            }

            public override Type FactType
            {
                get { return typeof(T); }
            }

            public override Func<IErmFactsContext, IEnumerable<long>, IQueryable> Query
            {
                get { return _query; }
            }

            public override IEnumerable<FactDependencyInfo> Aggregates
            {
                get { return _aggregates; }
            }

            public override IEnumerable<AggregateOperation> ApplyTo(ErmFactsTransformation transformation, IReadOnlyCollection<long> ids)
            {
                return transformation.Transform(_query, _aggregates, ids);
            }
        }
    }
}<commit_msg>Удалил неиспользуемые свойства<commit_after>using System;
using System.Collections.Generic;
using System.Linq;

using NuClear.AdvancedSearch.Replication.CustomerIntelligence.Data.Context;
using NuClear.AdvancedSearch.Replication.CustomerIntelligence.Transforming.Operations;
using NuClear.AdvancedSearch.Replication.Model;

namespace NuClear.AdvancedSearch.Replication.CustomerIntelligence.Transforming
{
    internal abstract class ErmFactInfo
    {
        public static Builder<TFact> OfType<TFact>(params object[] x)
            where TFact : IErmFactObject, IIdentifiable
        {
            return new Builder<TFact>();
        }

        public abstract Type FactType { get; }

        public abstract IEnumerable<AggregateOperation> ApplyTo(ErmFactsTransformation transformation, IReadOnlyCollection<long> ids);

        internal class Builder<TFact>
            where TFact : IErmFactObject, IIdentifiable
        {
            private readonly List<FactDependencyInfo> _dependencies = new List<FactDependencyInfo>();
            private Func<IErmFactsContext, IEnumerable<long>, IQueryable<TFact>> _query;

            public Builder<TFact> HasSource(Func<IErmFactsContext, IEnumerable<long>, IQueryable<TFact>> query)
            {
                _query = query;
                return this;
            }

            public Builder<TFact> HasSource(Func<IErmFactsContext, IQueryable<TFact>> factQueryableProvider)
            {
                _query = (context, ids) =>
                                {
                                    var query = factQueryableProvider.Invoke(context);
                                    var filteredQuery = query.Where(fact => ids.Contains(fact.Id));
                                    return filteredQuery;
                                };
                return this;
            }

            public Builder<TFact> HasDependentAggregate<TAggregate>(Func<IErmFactsContext, IEnumerable<long>, IEnumerable<long>> dependentAggregateIdsQueryProvider)
                where TAggregate : ICustomerIntelligenceObject
            {
                _dependencies.Add(FactDependencyInfo.Create<TAggregate>(dependentAggregateIdsQueryProvider));
                return this;
            }

            public Builder<TFact> HasMatchedAggregate<TAggregate>()
            {
                _dependencies.Add(FactDependencyInfo.Create<TAggregate>());
                return this;
            }

            public static implicit operator ErmFactInfo(Builder<TFact> builder)
            {
                return new ErmFactInfoImpl<TFact>(builder._query, builder._dependencies);
            }
        }

        private class ErmFactInfoImpl<T> : ErmFactInfo
            where T : IErmFactObject
        {
            private readonly Func<IErmFactsContext, IEnumerable<long>, IQueryable<T>> _query;
            private readonly IReadOnlyCollection<FactDependencyInfo> _aggregates;

            public ErmFactInfoImpl(Func<IErmFactsContext, IEnumerable<long>, IQueryable<T>> query, IReadOnlyCollection<FactDependencyInfo> aggregates)
            {
                _query = query;
                _aggregates = aggregates ?? new FactDependencyInfo[0];
            }

            public override Type FactType
            {
                get { return typeof(T); }
            }

            public override IEnumerable<AggregateOperation> ApplyTo(ErmFactsTransformation transformation, IReadOnlyCollection<long> ids)
            {
                return transformation.Transform(_query, _aggregates, ids);
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.07266526757607555, 'fraction_numerical': 0.00026232948583420777, 'mean_word_length': 2.1237197869725524, 'pattern_counts': {'":': 0, '<': 89, '<?xml version=': 0, '>': 93, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4228217', 'n_tokens_mistral': 1898, 'n_tokens_neox': 1831, 'n_words': 362}