def _serialize_rules(rules):
 result = [(rule_name, str(rule)) for (rule_name, rule) in rules.items()]
 return sorted(result, key=(lambda rule: rule[0]))

def _serialize_rules ( rules ) : result = [ ( rule_name , str ( rule ) ) for ( rule_name , rule ) in rules . items ( ) ] return sorted ( result , key = ( lambda rule : rule [ 0 ] ) )
serialize all the rule object as string which is used to compare the rules list .