<commit_before>import yaml

from configuration_py.parsers.base_parser import BaseConfigParser


class YAMLParser(BaseConfigParser):

    extensions = 'yml', 'yaml'

    def parse(self, file_content, context={}):
        config_dict = yaml.load(file_content)
        if not config_dict or type(config_dict) is not dict:
            raise EnvironmentError('Config file does not contain config variables')
        return config_dict<commit_msg>Fix idiomatic typecheck<commit_after>import yaml

from configuration_py.parsers.base_parser import BaseConfigParser


class YAMLParser(BaseConfigParser):

    extensions = 'yml', 'yaml'

    def parse(self, file_content, context={}):
        config_dict = yaml.load(file_content)
        if not config_dict or not isinstance(config_dict, dict):
            raise EnvironmentError('Config file does not contain config variables')
        return config_dict
{'fraction_non_alphanumeric': 0.07477678571428571, 'fraction_numerical': 0.0, 'mean_word_length': 4.03932584269663, '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': '3505318', 'n_tokens_mistral': 249, 'n_tokens_neox': 235, 'n_words': 70}