<commit_before>module Main exposing (..)

import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import Canvas exposing (Size, Point, Canvas, DrawOp(..))
import Canvas.Pixel as Pixel
import Html.Attributes exposing (style)
import Color


main =
    Html.beginnerProgram
        { model = 5
        , view = view
        , update = update
        }


type Msg
    = ChangeBy Int


update : Msg -> Int -> Int
update message model =
    case message of
        ChangeBy int ->
            int + model


view : Int -> Html Msg
view resolution =
    div
        []
        [ Canvas.toHtml
            [ style
                [ ( "width", "400px" )
                , ( "height", "400px" )
                , ( "image-rendering", "pixelated" )
                ]
            ]
            (Canvas.batch (draws resolution) canvas)
        , input
            [ value "+ 1"
            , onClick (ChangeBy 1)
            , type_ "submit"
            ]
            []
        , input
            [ value "- 1"
            , onClick (ChangeBy -1)
            , type_ "submit"
            ]
            []
        ]


canvas : Canvas
canvas =
    let
        size =
            Size 100 100
    in
        Canvas.batch
            [ BeginPath
            , Rect (Point 0 0) size
            , FillStyle Color.blue
            , Fill
            ]
            (Canvas.initialize size)


draws : Int -> List DrawOp
draws resolution =
     Pixel.bezier
         resolution
         Color.red
         (Point 90 90)
         (Point 90 10)
         (Point 10 90)
         (Point 10 10)
<commit_msg>Applied elm format to examples<commit_after>module Main exposing (..)

import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import Canvas exposing (Size, Point, Canvas, DrawOp(..))
import Canvas.Pixel as Pixel
import Html.Attributes exposing (style)
import Color


main =
    Html.beginnerProgram
        { model = 5
        , view = view
        , update = update
        }


type Msg
    = ChangeBy Int


update : Msg -> Int -> Int
update message model =
    case message of
        ChangeBy int ->
            int + model


view : Int -> Html Msg
view resolution =
    div
        []
        [ Canvas.toHtml
            [ style
                [ ( "width", "400px" )
                , ( "height", "400px" )
                , ( "image-rendering", "pixelated" )
                ]
            ]
            (Canvas.batch (draws resolution) canvas)
        , input
            [ value "+ 1"
            , onClick (ChangeBy 1)
            , type_ "submit"
            ]
            []
        , input
            [ value "- 1"
            , onClick (ChangeBy -1)
            , type_ "submit"
            ]
            []
        ]


canvas : Canvas
canvas =
    let
        size =
            Size 100 100
    in
        Canvas.batch
            [ BeginPath
            , Rect (Point 0 0) size
            , FillStyle Color.blue
            , Fill
            ]
            (Canvas.initialize size)


draws : Int -> List DrawOp
draws resolution =
    Pixel.bezier
        resolution
        Color.red
        (Point 90 90)
        (Point 90 10)
        (Point 10 90)
        (Point 10 10)

{'fraction_non_alphanumeric': 0.09415384615384616, 'fraction_numerical': 0.021538461538461538, 'mean_word_length': 1.2236662106703147, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '4419839', 'n_tokens_mistral': 997, 'n_tokens_neox': 891, 'n_words': 268}