<commit_before>using System.Drawing;

namespace RequestReduce.Reducer
{
    public class SpritedImage
    {
        public SpritedImage(int averageColor, BackgroundImageClass cssClass, Bitmap Image)
        {
            AverageColor = averageColor;
            CssClass = cssClass;
            this.Image = Image;
        }

        public Bitmap Image { get; set; }
        public int AverageColor { get; set; }
        public int Position { get; set; }
        public string Url { get; set; }
        public BackgroundImageClass CssClass { get; set; }

        public string Render()
        {
            var newClass = CssClass.OriginalClassString.ToLower().Replace(CssClass.ImageUrl.ToLower(), Url);
            var yOffset = CssClass.YOffset.Direction.ToString();
            if (CssClass.YOffset.PositionMode != PositionMode.Direction)
                yOffset = "0";
            if (CssClass.YOffset.PositionMode == PositionMode.Unit && CssClass.YOffset.Offset > 0)
                yOffset = string.Format("{0}px", CssClass.YOffset.Offset);

            newClass = newClass.Replace("}",
                                        string.Format(";background-position: -{0}px {1}{2};}}",
                                        Position, yOffset, CssClass.Important ? " !important" : string.Empty));
            return newClass;
        }
    }
}<commit_msg>#56 set all YOffset values to 0 except positive units<commit_after>using System.Drawing;

namespace RequestReduce.Reducer
{
    public class SpritedImage
    {
        public SpritedImage(int averageColor, BackgroundImageClass cssClass, Bitmap Image)
        {
            AverageColor = averageColor;
            CssClass = cssClass;
            this.Image = Image;
        }

        public Bitmap Image { get; set; }
        public int AverageColor { get; set; }
        public int Position { get; set; }
        public string Url { get; set; }
        public BackgroundImageClass CssClass { get; set; }

        public string Render()
        {
            var newClass = CssClass.OriginalClassString.ToLower().Replace(CssClass.ImageUrl.ToLower(), Url);
            var yOffset = "0";
            if (CssClass.YOffset.PositionMode == PositionMode.Unit && CssClass.YOffset.Offset > 0)
                yOffset = string.Format("{0}px", CssClass.YOffset.Offset);

            newClass = newClass.Replace("}",
                                        string.Format(";background-position: -{0}px {1}{2};}}",
                                        Position, yOffset, CssClass.Important ? " !important" : string.Empty));
            return newClass;
        }
    }
}
{'fraction_non_alphanumeric': 0.10251524390243902, 'fraction_numerical': 0.005716463414634146, 'mean_word_length': 1.9264214046822743, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6596695', 'n_tokens_mistral': 702, 'n_tokens_neox': 689, 'n_words': 164}