def camel_to_snake(s):
    """Converts camelCase to snake_case.

    :param str s: The camel case string to transform.

    :return: a snake case string
    :rtype: str
    """
    def characters():
        for c in s:
            if c.isupper():
                yield '_'
            yield c.lower()
    return ''.join(characters())