def camelcase_to_snake(text: str) -> str:
    """
    Convert a camelCase text to snake_case.

    This helper replace any capitalized character by its lowered version
    preceded by '_'.

    This helper does not check that input text is camel case or not.

    >>> s = 'iAmCamelCase'
    >>> camelcase_to_snake(s)
    'i_am_camel_case'
    >>> # Ignore fully uppercase text.
    >>> camelcase_to_snake("ALL_CAPS")
    'ALL_CAPS'
    """
    if text.isupper():
        return text
    return ''.join(map(lambda c: '_' + c.lower() if c.isupper() else c, text))