def parse_results(fields, data):
 master = []
 for record in data['records']:
  row = ([None] * len(fields))
  for (obj, value) in record.iteritems():
   if (not isinstance(value, (dict, list, tuple))):
    if (obj in fields):
     row[fields.index(obj)] = ensure_utf(value)
   elif (isinstance(value, dict) and (obj != 'attributes')):
    path = obj
    _traverse_results(value, fields, row, path)
  master.append(row)
 return master

def parse_results ( fields , data ) : master = [ ] for record in data [ 'records' ] : row = ( [ None ] * len ( fields ) ) for ( obj , value ) in record . iteritems ( ) : if ( not isinstance ( value , ( dict , list , tuple ) ) ) : if ( obj in fields ) : row [ fields . index ( obj ) ] = ensure_utf ( value ) elif ( isinstance ( value , dict ) and ( obj != 'attributes' ) ) : path = obj _traverse_results ( value , fields , row , path ) master . append ( row ) return master
traverses ordered dictionary .