def pyify_0(name):
    res = ""
    match = re.match(
            r"^(([A-Z])[a-z]+)(([A-Z])[a-z]+)?(([A-Z])[a-z]+)?(([A-Z])[a-z]+)?",
            name)
    res += match.group(1).lower()
    for num in range(3, len(match.groups()), 2):
        try:
            res += "_"+match.group(num+1).lower()+match.group(num)[1:]
        except AttributeError:
            break
    
    res = res.replace("-","_")
    if res in ["class"]:
        res += "_"
    return res
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/pysaml2-2.4.0/tools/parse_xsd2.py/pyify_0/original