<commit_before># -*- coding: utf-8 -*-
import yaml
import os
from clint.textui import colored, puts


class Settings:
    """Simple object representation of Tarbell settings."""
    def __init__(self, path):
        self.path = path

        self.config = {}
        try:
            with open(self.path) as f:
                self.config = yaml.load(f)
        except IOError:
            puts("{0}: {1}".format(
                colored.red("Warning:"),
                "No Tarbell configuration found, please run `tarbell configure`."
            ))

        self.client_secrets = False
        client_secrets_path = os.path.join(os.path.dirname(self.path), "client_secrets.json")
        try:<commit_msg>bail if no configuration found<commit_after># -*- coding: utf-8 -*-
import yaml
import os
import sys

from clint.textui import colored, puts
from .utils import show_error

class Settings:
    """Simple object representation of Tarbell settings."""
    def __init__(self, path):
        self.path = path

        self.config = {}
        try:
            with open(self.path) as f:
                self.config = yaml.load(f)
        except IOError:
            show_error("No Tarbell configuration found, please run `{0}`."
                       .format(colored.yellow('tarbell configure')))
            sys.exit()

        self.client_secrets = False
        client_secrets_path = os.path.join(os.path.dirname(self.path), "client_secrets.json")
        try:
{'fraction_non_alphanumeric': 0.11399317406143344, 'fraction_numerical': 0.0034129692832764505, 'mean_word_length': 2.119148936170213, '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': '2315615', 'n_tokens_mistral': 428, 'n_tokens_neox': 408, 'n_words': 112}