<commit_before>﻿using System.Collections.Generic;
using System.Web.Mvc;
using Umbraco.Core.Models;
using Umbraco.Web.Models;
using Umbraco.Web.Mvc;

namespace Our.Umbraco.Ditto
{
    /// <summary>
    /// Abstract class for a DittoView
    /// </summary>
    public abstract class DittoView : DittoView<IPublishedContent>
    { }

    /// <summary>
    /// Abstract class for a DittoView
    /// </summary>
    /// <typeparam name="TViewModel">The type of the view model.</typeparam>
    public abstract class DittoView<TViewModel>
        : UmbracoViewPage<DittoViewModel<TViewModel>>
        where TViewModel : class
    {
        /// <summary>
        /// Sets the view data.
        /// </summary>
        /// <param name="viewData">The view data.</param>
        protected override void SetViewData(ViewDataDictionary viewData)
        {
            // If model is already ditflo view model, use it
            if (viewData.Model is DittoViewModel<TViewModel>)
            {
                base.SetViewData(viewData);
                return;
            }

            // Gather dit flow view model properties
            var model = viewData.Model;
            var processorContexts = new List<DittoProcessorContext>();

            var transferModel = model as DittoTransferModel;
            if (transferModel != null)
            {
                model = transferModel.Model;
                processorContexts = transferModel.ProcessorContexts;
            }

            // Check to see if we are a dit flo view model at least and copy processors
            var baseDittoViewModel = model as BaseDittoViewModel;
            if (baseDittoViewModel != null)
            {
                processorContexts.AddRange(baseDittoViewModel.ProcessorContexts);
            }

            // Get current content / culture
            var content = UmbracoContext.PublishedContentRequest.PublishedContent;
            var culture = UmbracoContext.PublishedContentRequest.Culture;

            // Process model
            var publishedContent = model as IPublishedContent;
            if (publishedContent != null) 
            {<commit_msg>Removed some comment references to ditflo<commit_after>﻿using System.Collections.Generic;
using System.Web.Mvc;
using Umbraco.Core.Models;
using Umbraco.Web.Models;
using Umbraco.Web.Mvc;

namespace Our.Umbraco.Ditto
{
    /// <summary>
    /// Abstract class for a DittoView
    /// </summary>
    public abstract class DittoView : DittoView<IPublishedContent>
    { }

    /// <summary>
    /// Abstract class for a DittoView
    /// </summary>
    /// <typeparam name="TViewModel">The type of the view model.</typeparam>
    public abstract class DittoView<TViewModel>
        : UmbracoViewPage<DittoViewModel<TViewModel>>
        where TViewModel : class
    {
        /// <summary>
        /// Sets the view data.
        /// </summary>
        /// <param name="viewData">The view data.</param>
        protected override void SetViewData(ViewDataDictionary viewData)
        {
            // If model is already ditto view model, use it
            if (viewData.Model is DittoViewModel<TViewModel>)
            {
                base.SetViewData(viewData);
                return;
            }

            // Gather ditto view model properties
            var model = viewData.Model;
            var processorContexts = new List<DittoProcessorContext>();

            var transferModel = model as DittoTransferModel;
            if (transferModel != null)
            {
                model = transferModel.Model;
                processorContexts = transferModel.ProcessorContexts;
            }

            // Check to see if we are a ditto view model at least and copy processors
            var baseDittoViewModel = model as BaseDittoViewModel;
            if (baseDittoViewModel != null)
            {
                processorContexts.AddRange(baseDittoViewModel.ProcessorContexts);
            }

            // Get current content / culture
            var content = UmbracoContext.PublishedContentRequest.PublishedContent;
            var culture = UmbracoContext.PublishedContentRequest.Culture;

            // Process model
            var publishedContent = model as IPublishedContent;
            if (publishedContent != null) 
            {
{'fraction_non_alphanumeric': 0.0840297121634169, 'fraction_numerical': 0.0, 'mean_word_length': 1.9193766937669376, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, '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': '2261888', 'n_tokens_mistral': 1110, 'n_tokens_neox': 1051, 'n_words': 295}