def par_sort(a, b):
 aext = a.lower().split('.')[(-1)]
 bext = b.lower().split('.')[(-1)]
 if (aext == bext):
  return cmp(a, b)
 elif (aext == 'par2'):
  return (-1)
 elif (bext == 'par2'):
  return 1

def par_sort ( a , b ) : aext = a . lower ( ) . split ( '.' ) [ ( - 1 ) ] bext = b . lower ( ) . split ( '.' ) [ ( - 1 ) ] if ( aext == bext ) : return cmp ( a , b ) elif ( aext == 'par2' ) : return ( - 1 ) elif ( bext == 'par2' ) : return 1
define sort method for par2 file names .