def str_cmp_with_numbers_sorted(str1, str2):
    '\n    Compares two strings where numbers are sorted according to value, so Sq12 ends up after Sq8,  use in sorted function\n    Copied from spt3g_software to fix dependencies (sorry)\n    '
    if (str1 == str2):
        return 0
    split1 = split_on_numbers(str1)
    split2 = split_on_numbers(str2)
    largestStr = 0
    for l in [split1, split2]:
        for s in l:
            if s[0].isdigit():
                largestStr = (len(s) if (len(s) > largestStr) else largestStr)
    for l in [split1, split2]:
        for i in range(len(l)):
            if l[i][0].isdigit():
                l[i] = (('0' * (largestStr - len(l[i]))) + l[i])
    p1 = reduce((lambda x, y: (x + y)), split1)
    p2 = reduce((lambda x, y: (x + y)), split2)
    return ((- 1) if (p1 < p2) else 1)
Compares two strings where numbers are sorted according to value, so Sq12 ends up after Sq8,  use in sorted function
Copied from spt3g_software to fix dependencies (sorry)
def str_cmp_with_numbers_sorted(str1, str2):
    '\n    Compares two strings where numbers are sorted according to value, so Sq12 ends up after Sq8,  use in sorted function\n    Copied from spt3g_software to fix dependencies (sorry)\n    '
    if (str1 == str2):
        return 0
    split1 = split_on_numbers(str1)
    split2 = split_on_numbers(str2)
    largestStr = 0
    for l in [split1, split2]:
        for s in l:
            if s[0].isdigit():
                largestStr = (len(s) if (len(s) > largestStr) else largestStr)
    for l in [split1, split2]:
        for i in range(len(l)):
            if l[i][0].isdigit():
                l[i] = (('0' * (largestStr - len(l[i]))) + l[i])
    p1 = reduce((lambda x, y: (x + y)), split1)
    p2 = reduce((lambda x, y: (x + y)), split2)
    return ((- 1) if (p1 < p2) else 1)