def _order_json(data, srv):
 new_data = OrderedDict()
 for field in FIELD_ORDER[srv[0]]:
  new_data[field] = sorted_dict(data[field])
  data.pop(field, None)
 data = OrderedDict(sorted(data.items(), key=(lambda t: t[0])))
 for key in data:
  new_data[key] = sorted_dict(data[key])
 return new_data

def _order_json ( data , srv ) : new_data = OrderedDict ( ) for field in FIELD_ORDER [ srv [ 0 ] ] : new_data [ field ] = sorted_dict ( data [ field ] ) data . pop ( field , None ) data = OrderedDict ( sorted ( data . items ( ) , key = ( lambda t : t [ 0 ] ) ) ) for key in data : new_data [ key ] = sorted_dict ( data [ key ] ) return new_data
sorts the data a/c field_order and returns .