def mergeorder(items, working_dir):
 if (len(items) < 2):
  return items
 middle = (len(items) / 2)
 left = mergeorder(items[:middle], working_dir)
 right = mergeorder(items[middle:], working_dir)
 return mergetree(left, right, working_dir)

def mergeorder ( items , working_dir ) : if ( len ( items ) < 2 ) : return items middle = ( len ( items ) / 2 ) left = mergeorder ( items [ : middle ] , working_dir ) right = mergeorder ( items [ middle : ] , working_dir ) return mergetree ( left , right , working_dir )
code taken from URL .