import re


def _convert_case(name):
    """Converts SomeSpecialVariable type names to some_special_variable
    for JSON to python object translation
    """
    step1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
    return re.sub('([a-z0-9])([A-Z])', r'\1_\2', step1).lower()