# Path: contentful/utils.py
# def snake_case(a_string):
#     """Returns a snake cased version of a string.
# 
#     :param a_string: any :class:`str` object.
# 
#     Usage:
#         >>> snake_case('FooBar')
#         "foo_bar"
#     """
# 
#     partial = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', a_string)
#     return re.sub('([a-z0-9])([A-Z])', r'\1_\2', partial).lower()


import dateutil.parser
from .utils import snake_case
            includes = []

        if errors is None:
            errors = []

        locale = self._locale()
        fields = {locale: {}}
        if localized:
            self._hydrate_localized_entry(fields, item, includes, errors, resources)
        else:
            self._hydrate_non_localized_entry(fields, item, includes, errors, resources)
        return fields

    def _hydrate_localized_entry(self, fields, item, includes, errors, resources=None):
        for k, locales in item['fields'].items():
            for locale, v in locales.items():
                if locale not in fields:
                    fields[locale] = {}
                fields[locale][snake_case(k)] = self._coerce(
                    snake_case(k),
                    v,
                    True,
                    includes,
                    errors,
                    resources=resources
                )

    def _hydrate_non_localized_entry(self, fields, item, includes, errors, resources=None):
        for k, v in item['fields'].items():
            fields[self._locale()][snake_case(k)] = self._coerce(

# Path: contentful/utils.py
# def snake_case(a_string):
#     """Returns a snake cased version of a string.
# 
#     :param a_string: any :class:`str` object.
# 
#     Usage:
#         >>> snake_case('FooBar')
#         "foo_bar"
#     """
# 
#     partial = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', a_string)
#     return re.sub('([a-z0-9])([A-Z])', r'\1_\2', partial).lower()


# Path: contentful/resource.py
import dateutil.parser
from .utils import snake_case

            includes = []

        if errors is None:
            errors = []

        locale = self._locale()
        fields = {locale: {}}
        if localized:
            self._hydrate_localized_entry(fields, item, includes, errors, resources)
        else:
            self._hydrate_non_localized_entry(fields, item, includes, errors, resources)
        return fields

    def _hydrate_localized_entry(self, fields, item, includes, errors, resources=None):
        for k, locales in item['fields'].items():
            for locale, v in locales.items():
                if locale not in fields:
                    fields[locale] = {}
                fields[locale][snake_case(k)] = self._coerce(
                    snake_case(k),
                    v,
                    True,
                    includes,
                    errors,
                    resources=resources
                )

    def _hydrate_non_localized_entry(self, fields, item, includes, errors, resources=None):
        for k, v in item['fields'].items():
            fields[self._locale()][snake_case(k)] = self._coerce(

                snake_case(k),