def common_pairs(profile):
 if (not has_pairs(profile)):
  return []
 result = [((op1, op2), (opcode.opname[op1], opcode.opname[op2]), count) for (op1, op1profile) in enumerate(profile[:(-1)]) for (op2, count) in enumerate(op1profile) if (count > 0)]
 result.sort(key=operator.itemgetter(2), reverse=True)
 return result

def common_pairs ( profile ) : if ( not has_pairs ( profile ) ) : return [ ] result = [ ( ( op1 , op2 ) , ( opcode . opname [ op1 ] , opcode . opname [ op2 ] ) , count ) for ( op1 , op1profile ) in enumerate ( profile [ : ( - 1 ) ] ) for ( op2 , count ) in enumerate ( op1profile ) if ( count > 0 ) ] result . sort ( key = operator . itemgetter ( 2 ) , reverse = True ) return result
returns the most common opcode pairs in order of descending frequency .