def serialize_entry(data=None, **kwargs):
 data = (data or {})
 entry_dict = copy.copy(data)
 entry_dict.update(**kwargs)
 result = {}
 for (k, v) in entry_dict.items():
  if (k == 'source'):
   qualifier = encode_unicode(('f:s_%s' % v))
   result[qualifier] = dump('1')
  elif (k == 'meter'):
   for (meter, ts) in v.items():
    qualifier = encode_unicode(('f:m_%s' % meter))
    result[qualifier] = dump(ts)
  elif (k == 'resource_metadata'):
   flattened_meta = dump_metadata(v)
   for (key, m) in flattened_meta.items():
    metadata_qualifier = encode_unicode(('f:r_metadata.' + key))
    result[metadata_qualifier] = dump(m)
   result['f:resource_metadata'] = dump(v)
  else:
   result[('f:' + quote(k, ':'))] = dump(v)
 return result

def serialize_entry ( data = None , ** kwargs ) : data = ( data or { } ) entry_dict = copy . copy ( data ) entry_dict . update ( ** kwargs ) result = { } for ( k , v ) in entry_dict . items ( ) : if ( k == 'source' ) : qualifier = encode_unicode ( ( 'f:s_%s' % v ) ) result [ qualifier ] = dump ( '1' ) elif ( k == 'meter' ) : for ( meter , ts ) in v . items ( ) : qualifier = encode_unicode ( ( 'f:m_%s' % meter ) ) result [ qualifier ] = dump ( ts ) elif ( k == 'resource_metadata' ) : flattened_meta = dump_metadata ( v ) for ( key , m ) in flattened_meta . items ( ) : metadata_qualifier = encode_unicode ( ( 'f:r_metadata.' + key ) ) result [ metadata_qualifier ] = dump ( m ) result [ 'f:resource_metadata' ] = dump ( v ) else : result [ ( 'f:' + quote ( k , ':' ) ) ] = dump ( v ) return result
return a dict that is ready to be stored to hbase .