import re


def camel_case_to_underscore(text):
    """ Convert camel-case to underscore.

    :param text: a text, potentially in camel-case format.
    :return: the text, converted to underscore format.
    """
    underscored = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', text)
    return re.sub('([a-z0-9])([A-Z])', r'\1_\2', underscored).lower()