def human_order_sorted(l):
 def atoi(text):
  return (int(text) if text.isdigit() else text)
 def natural_keys(text):
  if isinstance(text, tuple):
   text = text[0]
  return [atoi(c) for c in re.split(u'(\\d+)', text)]
 return sorted(l, key=natural_keys)

def human_order_sorted ( l ) : def atoi ( text ) : return ( int ( text ) if text . isdigit ( ) else text ) def natural_keys ( text ) : if isinstance ( text , tuple ) : text = text [ 0 ] return [ atoi ( c ) for c in re . split ( u'(\\d+)' , text ) ] return sorted ( l , key = natural_keys )
sorts string in human order .