Convert `camel_str` from camelCase to snake_case

def camel_to_snake(camel_str):
    '''
    Convert `camel_str` from camelCase to snake_case
    '''
    # Attribution: https://stackoverflow.com/a/1176023/633213
    s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', camel_str)
    return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()