Skip to content
Permalink
cb00e1ed3e
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 14 lines (10 sloc) 325 Bytes
'''
@author: jbayer
Sorts a list of items in naturla order ( [mir2,mir1,mir10] -> [mir1,mir2,mir10] )
'''
import re
def natural_keys(text):
'''alist.sort(key=natural_keys) sorts in human order'''
return [ atoi(c) for c in re.split('(\d+)', text) ]
def atoi(text):
return int(text) if text.isdigit() else text