<commit_before># -*- coding: utf-8 -*-
"""
    pygments.lexers.puppet
    ~~~~~~~~~~~~~~~~~~~~~~

    Lexer for the Puppet DSL.

    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
"""

from pygments.lexer import RegexLexer, bygroups
from pygments.token import *

__all__ = ['PuppetLexer']


class PuppetLexer(RegexLexer):
    name = 'Puppet'
    aliases = ['puppet']
    filenames = ['*.pp']

    tokens = {
        'root': [
            (r'\s*#.*$', Comment),
            (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),

            (r'\s+(\?|<|>|=|\+|-|\/|\*|~|!|\|)\s+', Operator),
            (r'(in|and|or|not)\b', Operator.Word),
            (r'[]{}:(),;[]', Punctuation),

            (r'(.*)(include)(\s*)(.*)$', bygroups(Text, Keyword, Text,
                                                  Name.Variable)),

            (r'(if|else|elsif|case|class|true|false|define)\b', Keyword),
            (r'(inherits|notice|node|realize|import)\b', Keyword),

            (r'\$[^ ]*', Name.Variable),

            (r'\'(.*?)\'', String),
            (r'"(.*?)"', String),

            (r'(.*?)(\s*)(=>)(\s*)(.*?)$',
             bygroups(Name.Attribute, Text, Operator, Text, String)),

            (r'[^\S\n]+', Text),
            ],
        }<commit_msg>formatting<commit_after># -*- coding: utf-8 -*-
"""
    pygments.lexers.puppet
    ~~~~~~~~~~~~~~~~~~~~~~

    Lexer for the Puppet DSL.

    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
"""

from pygments.lexer import RegexLexer, bygroups
from pygments.token import *

__all__ = ['PuppetLexer']


class PuppetLexer(RegexLexer):
    name = 'Puppet'
    aliases = ['puppet']
    filenames = ['*.pp']

    tokens = {
        'root': [
            (r'\s*#.*$', Comment),
            (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),

            (r'\s+(\?|<|>|=|\+|-|\/|\*|~|!|\|)\s+', Operator),
            (r'(in|and|or|not)\b', Operator.Word),
            (r'[]{}:(),;[]', Punctuation),

            (r'(.*)(include)(\s*)(.*)$',
             bygroups(Text, Keyword, Text, Name.Variable)),

            (r'(if|else|elsif|case|class|true|false|define)\b', Keyword),
            (r'(inherits|notice|node|realize|import)\b', Keyword),

            (r'\$[^ ]*', Name.Variable),

            (r'\'(.*?)\'', String),
            (r'"(.*?)"', String),

            (r'(.*?)(\s*)(=>)(\s*)(.*?)$',
             bygroups(Name.Attribute, Text, Operator, Text, String)),

            (r'[^\S\n]+', Text),
            ],
        }
{'fraction_non_alphanumeric': 0.26508785332314744, 'fraction_numerical': 0.006875477463712758, 'mean_word_length': 2.0595794392523366, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2234457', 'n_tokens_mistral': 991, 'n_tokens_neox': 903, 'n_words': 154}