def normalize_dnsname(name, padding=10):
    parts = re.split(r'(\d+)', name)
    retval = []
    for part in parts:
        if re.match(r'^\d+$', part):
            retval.append(part.zfill(padding))
        else:
            retval.append(part)

    return ''.join(retval)
Check against known values of Spence's function.
dataset/ETHPy150Open openshift/openshift-ansible/bin/openshift_ansible/utils.py/normalize_dnsname--crossover with--dataset/ETHPy150Open scipy/scipy/scipy/special/tests/test_spence.py/test_special_points