<commit_before>﻿// Copyright (c) <NAME>. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using Core2D.Data;
using Spatial.Arc;
using Core2D.Shapes;
using Core2D.Style;
using Spatial;

namespace Core2D.Renderer.Wpf
{
    /// <summary>
    /// Native Windows Presentation Foundation shape renderer.
    /// </summary>
    public class WpfRenderer : ShapeRenderer
    {
        private ICache<ShapeStyle, (Brush, Pen)> _styleCache = Cache<ShapeStyle, (Brush, Pen)>.Create();
        private ICache<ArrowStyle, (Brush, Pen)> _arrowStyleCache = Cache<ArrowStyle, (Brush, Pen)>.Create();
        private ICache<LineShape, PathGeometry> _curvedLineCache = Cache<LineShape, PathGeometry>.Create();
        private ICache<ArcShape, PathGeometry> _arcCache = Cache<ArcShape, PathGeometry>.Create();
        private ICache<CubicBezierShape, PathGeometry> _cubicBezierCache = Cache<CubicBezierShape, PathGeometry>.Create();
        private ICache<QuadraticBezierShape, PathGeometry> _quadraticBezierCache = Cache<QuadraticBezierShape, PathGeometry>.Create();
        private ICache<TextShape, (string, FormattedText, ShapeStyle)> _textCache = Cache<TextShape, (string, FormattedText, ShapeStyle)>.Create();
        private ICache<string, BitmapImage> _biCache = Cache<string, BitmapImage>.Create(bi => bi.StreamSource.Dispose());
        private ICache<PathShape, (Path.PathGeometry, StreamGeometry, ShapeStyle)> _pathCache = Cache<PathShape, (Path.PathGeometry, StreamGeometry, ShapeStyle)>.Create();
        private ShapeRendererState _state = new ShapeRendererState();

        /// <inheritdoc/>
        public override ShapeRendererState State
        {
            get { return _state; }
            set { Update(ref _state, value); }
        }

        /// <summary><commit_msg>Sort usings<commit_after>﻿// Copyright (c) <NAME>. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using Core2D.Data;
using Core2D.Shapes;
using Core2D.Style;
using Spatial;
using Spatial.Arc;

namespace Core2D.Renderer.Wpf
{
    /// <summary>
    /// Native Windows Presentation Foundation shape renderer.
    /// </summary>
    public class WpfRenderer : ShapeRenderer
    {
        private ICache<ShapeStyle, (Brush, Pen)> _styleCache = Cache<ShapeStyle, (Brush, Pen)>.Create();
        private ICache<ArrowStyle, (Brush, Pen)> _arrowStyleCache = Cache<ArrowStyle, (Brush, Pen)>.Create();
        private ICache<LineShape, PathGeometry> _curvedLineCache = Cache<LineShape, PathGeometry>.Create();
        private ICache<ArcShape, PathGeometry> _arcCache = Cache<ArcShape, PathGeometry>.Create();
        private ICache<CubicBezierShape, PathGeometry> _cubicBezierCache = Cache<CubicBezierShape, PathGeometry>.Create();
        private ICache<QuadraticBezierShape, PathGeometry> _quadraticBezierCache = Cache<QuadraticBezierShape, PathGeometry>.Create();
        private ICache<TextShape, (string, FormattedText, ShapeStyle)> _textCache = Cache<TextShape, (string, FormattedText, ShapeStyle)>.Create();
        private ICache<string, BitmapImage> _biCache = Cache<string, BitmapImage>.Create(bi => bi.StreamSource.Dispose());
        private ICache<PathShape, (Path.PathGeometry, StreamGeometry, ShapeStyle)> _pathCache = Cache<PathShape, (Path.PathGeometry, StreamGeometry, ShapeStyle)>.Create();
        private ShapeRendererState _state = new ShapeRendererState();

        /// <inheritdoc/>
        public override ShapeRendererState State
        {
            get { return _state; }
            set { Update(ref _state, value); }
        }

        /// <summary>
{'fraction_non_alphanumeric': 0.10948905109489052, 'fraction_numerical': 0.0019464720194647203, 'mean_word_length': 4.1775818639798485, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 51, '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': '2477935', 'n_tokens_mistral': 1172, 'n_tokens_neox': 1131, 'n_words': 296}