<commit_before>window.ContentEdit =

    # Global settings

    # The default min/max constraints (in pixels) for element that can be
    # resized (`ContentEdit.ResizableElement`). The default values are used when
    # a min/max width has not been set using the custom attributes
    # `data-ce-max-width` and `data-ce-min-width`.
    DEFAULT_MAX_ELEMENT_WIDTH: 800
    DEFAULT_MIN_ELEMENT_WIDTH: 80

    # Some elements such as images are dragged simply by clicking on them and
    # moving the mouse. Others like text handle click events differently (for
    # example focusing the element so text can be edited), these element support
    # dragging behaviour when a user clicks and holds (without moving the
    # mouse). The duration of the hold is determined in milliseconds.
    DRAG_HOLD_DURATION: 500

    # The size (in pixels) of the edges used to switch horizontal placement
    # (e.g drop left/right) when dragging an element over another (for
    # example an image being dragged to the right edge of a text element).
    DROP_EDGE_SIZE: 50

    # The maximum number of characters to insert into a helper (for example the
    # helper tool that appears when dragging elements).
    HELPER_CHAR_LIMIT: 250

    # String to use for a single indent. For example if you wanted html to
    # return HTML indented using tabs instead of spaces you could set this to
    # `\t`.
    INDENT: '    '

    # The current language. Must be a a 2 digit ISO_639-1 code.
    LANGUAGE: 'en'

    # The size (in pixels) of the corner region used to detect a resize event
    # against an element. To resize an element (for example an image or video)
    # the user must click in a corner region of an element. The size is
    # automatically reduced for small elements where the corner size represents
    # more than a 1/4 of the total size.
    RESIZE_CORNER_SIZE: 15

    # Translation - the ContentEdit library provides basic translation support
    # which is used both by the library itself and the associated ContentTools
    # library.
    _translations: {}

    _: (s) ->
        # Look for a translation of the given string and return it, or if no
        # translation is found return the string unchanged.
        lang = ContentEdit.LANGUAGE
        if ContentEdit._translations[lang] and
                ContentEdit._translations[lang][s]

            return ContentEdit._translations[lang][s]
        return s

    addTranslations: (language, translations) ->
        # Add a translation where `language` is a 2 digit ISO_639-1 code and
        # `translations` is an object containing a map of English strings and
        # their translated counter parts e.g {'Hello': 'Bonjour'}.
        ContentEdit._translations[language] = translations

    # Utility functions

    addCSSClass: (domElement, className) ->
        # Add a CSS class to a DOM element

        # Add the class using classList if possible
        if domElement.classList
            domElement.classList.add(className)
            return

        # As there isn't universal support for the classList attribute, fallback
        # to a more manual process if necessary.
        classAttr = domElement.getAttribute('class')
        if classAttr
            # Convert class attribute to a list of class names
            classNames = (c for c in classAttr.split(' '))

            # If the class name isn't in the list add it
            if classNames.indexOf(className) == -1
                domElement.setAttribute(
                    'class',
                    "#{ classAttr } #{ className }"
                    )
<commit_msg>Updated comment<commit_after>window.ContentEdit =

    # Global settings

    # The default min/max constraints (in pixels) for element that can be
    # resized (`ContentEdit.ResizableElement`). The default values are used when
    # a min/max width has not been set using the custom attributes
    # `data-ce-max-width` and `data-ce-min-width`.
    DEFAULT_MAX_ELEMENT_WIDTH: 800
    DEFAULT_MIN_ELEMENT_WIDTH: 80

    # Some elements such as images are dragged simply by clicking on them and
    # moving the mouse. Others like text handle click events differently (for
    # example focusing the element so text can be edited), these element support
    # dragging behaviour when a user clicks and holds (without moving the
    # mouse). The duration of the hold is determined in milliseconds.
    DRAG_HOLD_DURATION: 500

    # The size (in pixels) of the edges used to switch horizontal placement
    # (e.g drop left/right) when dragging an element over another (for
    # example an image being dragged to the right edge of a text element).
    DROP_EDGE_SIZE: 50

    # The maximum number of characters to insert into a helper (for example the
    # helper tool that appears when dragging elements).
    HELPER_CHAR_LIMIT: 250

    # String to use for a single indent. For example if you wanted html to
    # return HTML indented using tabs instead of spaces you could set this to
    # `\t`.
    INDENT: '    '

    # The current language. Must be a a 2 digit ISO_639-1 code.
    LANGUAGE: 'en'

    # The size (in pixels) of the corner region used to detect a resize event
    # against an element. To resize an element (for example an image or video)
    # the user must click in a corner region of an element. The size is
    # automatically reduced for small elements where the corner size represents
    # more than a 1/4 of the total size.
    RESIZE_CORNER_SIZE: 15

    # Translation - the ContentEdit library provides basic translation support
    # which is used both by the library itself and the associated ContentTools
    # library.
    _translations: {}

    _: (s) ->
        # Look for a translation of the given string and return it, or if no
        # translation is found return the string unchanged.
        lang = ContentEdit.LANGUAGE
        if ContentEdit._translations[lang] and
                ContentEdit._translations[lang][s]

            return ContentEdit._translations[lang][s]
        return s

    addTranslations: (language, translations) ->
        # Add translations where `language` is a 2 digit ISO_639-1 code and
        # `translations` is an object containing a map of English strings and
        # their translated counterparts e.g {'Hello': 'Bonjour'}.
        ContentEdit._translations[language] = translations

    # Utility functions

    addCSSClass: (domElement, className) ->
        # Add a CSS class to a DOM element

        # Add the class using classList if possible
        if domElement.classList
            domElement.classList.add(className)
            return

        # As there isn't universal support for the classList attribute, fallback
        # to a more manual process if necessary.
        classAttr = domElement.getAttribute('class')
        if classAttr
            # Convert class attribute to a list of class names
            classNames = (c for c in classAttr.split(' '))

            # If the class name isn't in the list add it
            if classNames.indexOf(className) == -1
                domElement.setAttribute(
                    'class',
                    "#{ classAttr } #{ className }"
                    )

{'fraction_non_alphanumeric': 0.05898643035170313, 'fraction_numerical': 0.007754084741068956, 'mean_word_length': 2.533757338551859, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '898660', 'n_tokens_mistral': 1900, 'n_tokens_neox': 1777, 'n_words': 853}