import re


def camel_case_to_underscore(s):
    """
       Converts a camelCase string to snake_case

       :type s: ``str``
       :param s: The string to convert (e.g. helloWorld) (required)

       :return: The converted string (e.g. hello_world)
       :rtype: ``str``
    """
    s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', s)
    return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()