<commit_before>from __future__ import absolute_import, print_function, unicode_literals

import collections
import copy
import os
import re
import string
import yaml
from rock.exceptions import ConfigError
from rock.utils import isstr


PARENT_RE = re.compile(r'\{\{\s*parent\s*\}\}', re.MULTILINE)


class Config(collections.Mapping):
    """
    Parse and merge configuration files.
    """

    def __init__(self, data, env=None):
        self.data = data
        self.env = env
        self._setup = False

    @staticmethod
    def paths(*args):
        return (
            Config.user_path(*args),
            Config.etc_path(*args),
            Config.data_path(*args),
        )

    @staticmethod
    def data_path(*args):
        return os.path.join(*(os.path.dirname(os.path.realpath(__file__)),
            'data') + args)

    @staticmethod
    def etc_path(*args):
        return Config.mount_path(*('etc', 'rock') + args)

    @staticmethod
    def mount_path(*args):
        return os.path.join(*('/',) + args)

    @staticmethod
    def user_path(*args):
        return os.path.join(*(os.path.expanduser('~/.rock'),) + args)

    @staticmethod<commit_msg>Fix pep8 continuation line under-indented<commit_after>from __future__ import absolute_import, print_function, unicode_literals

import collections
import copy
import os
import re
import string
import yaml
from rock.exceptions import ConfigError
from rock.utils import isstr


PARENT_RE = re.compile(r'\{\{\s*parent\s*\}\}', re.MULTILINE)


class Config(collections.Mapping):
    """
    Parse and merge configuration files.
    """

    def __init__(self, data, env=None):
        self.data = data
        self.env = env
        self._setup = False

    @staticmethod
    def paths(*args):
        return (
            Config.user_path(*args),
            Config.etc_path(*args),
            Config.data_path(*args),
        )

    @staticmethod
    def data_path(*args):
        return os.path.join(*(os.path.dirname(os.path.realpath(__file__)),
                            'data') + args)

    @staticmethod
    def etc_path(*args):
        return Config.mount_path(*('etc', 'rock') + args)

    @staticmethod
    def mount_path(*args):
        return os.path.join(*('/',) + args)

    @staticmethod
    def user_path(*args):
        return os.path.join(*(os.path.expanduser('~/.rock'),) + args)

    @staticmethod
{'fraction_non_alphanumeric': 0.1292887029288703, 'fraction_numerical': 0.00041841004184100416, 'mean_word_length': 2.644817073170732, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1723107', 'n_tokens_mistral': 740, 'n_tokens_neox': 714, 'n_words': 163}