def addTogetherList(functionList, togetherLists):
 sortedList = functionList[:]
 sortedList.sort(compareFunctionName)
 togetherList = None
 for functionIndex in xrange(len(functionList)):
  function = functionList[functionIndex]
  sorted = sortedList[functionIndex]
  if (function != sorted):
   together = (function, sorted)
   if (togetherList == None):
    togetherList = []
    togetherLists.append(togetherList)
   togetherList.append(together)

def addTogetherList ( functionList , togetherLists ) : sortedList = functionList [ : ] sortedList . sort ( compareFunctionName ) togetherList = None for functionIndex in xrange ( len ( functionList ) ) : function = functionList [ functionIndex ] sorted = sortedList [ functionIndex ] if ( function != sorted ) : together = ( function , sorted ) if ( togetherList == None ) : togetherList = [ ] togetherLists . append ( togetherList ) togetherList . append ( together )
add the togetherlist to the togetherlists is the sorted is different .