Python script to sort the statement in mysql slowlog