import re


def uncamel(s):
    """
    Convert CamelCase class names into lower_snake_case.
    Taken from http://stackoverflow.com/a/1176023/3288364
    """
    return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s).lower()