def flatten_list(data, flattened=None, old_key=None):
 flattened = (flattened or {})
 old_key = (old_key or [])
 for (num, value) in enumerate(data):
  if (not isinstance(value, dict)):
   raise DataError('Values in lists need to be dicts')
  new_key = (old_key + [num])
  flattened = flatten_dict(value, flattened, new_key)
 return flattened

def flatten_list ( data , flattened = None , old_key = None ) : flattened = ( flattened or { } ) old_key = ( old_key or [ ] ) for ( num , value ) in enumerate ( data ) : if ( not isinstance ( value , dict ) ) : raise DataError ( 'Values in lists need to be dicts' ) new_key = ( old_key + [ num ] ) flattened = flatten_dict ( value , flattened , new_key ) return flattened
input a list of list .