def flatten_metadata(metadata):
 if metadata:
  return dict(((k.replace('.', ':').replace(':', '.', 1), six.text_type(v)) for (k, v) in utils.recursive_keypairs(metadata, separator='.') if (type(v) is not set)))
 return {}

def flatten_metadata ( metadata ) : if metadata : return dict ( ( ( k . replace ( '.' , ':' ) . replace ( ':' , '.' , 1 ) , six . text_type ( v ) ) for ( k , v ) in utils . recursive_keypairs ( metadata , separator = '.' ) if ( type ( v ) is not set ) ) ) return { }
return flattened resource metadata .