<commit_before># TODO(jeremydw): Implement.
from grow.pods import locales


class Error(Exception):
    pass


class PodSpecParseError(Error):
    pass


class PodSpec(object):

    def __init__(self, yaml, pod):
        yaml = yaml or {}
        self.yaml = yaml
        self.pod = pod
        self.grow_version = yaml.get('grow_version')
        _default_locale = yaml.get('localization', {}).get('default_locale', None)
        self.default_locale = locales.Locale.parse(_default_locale)
        self.fields = yaml

    def get_config(self):
        return self.yaml

    def __getattr__(self, name):
        if name in self.fields:
            return self.fields[name]
        if '{}@'.format(name) in self.fields:
            return self.fields['{}@'.format(name)]
        return object.__getattribute__(self, name)

    def __iter__(self):
        return self.yaml.__iter__()

    @property
    def home(self):
        return self.pod.get_home_doc()

    @property
    def root(self):<commit_msg>Tweaking the podspec file.<commit_after>"""Podspec helper."""

from grow.pods import locales


class Error(Exception):
    pass


class PodSpecParseError(Error):
    pass


class PodSpec(object):

    def __init__(self, yaml, pod):
        yaml = yaml or {}
        self.yaml = yaml
        self.pod = pod
        self.grow_version = yaml.get('grow_version')
        _default_locale = yaml.get('localization', {}).get('default_locale', None)
        self.default_locale = locales.Locale.parse(_default_locale)
        self.fields = yaml

    def get_config(self):
        return self.yaml

    def __getattr__(self, name):
        if name in self.fields:
            return self.fields[name]
        tagged_name = '{}@'.format(name)
        if tagged_name in self.fields:
            return self.fields[tagged_name]
        return object.__getattribute__(self, name)

    def __iter__(self):
        return self.yaml.__iter__()

    @property
    def home(self):
        return self.pod.get_home_doc()

    @property
    def root(self):
{'fraction_non_alphanumeric': 0.11285574092247301, 'fraction_numerical': 0.0, 'mean_word_length': 2.533795493934142, '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': '6470405', 'n_tokens_mistral': 636, 'n_tokens_neox': 601, 'n_words': 143}