

@_handle_object_not_found
def set_metadata(self, obj, metadata, clear=False, prefix=None):
    "\n        Accepts a dictionary of metadata key/value pairs and updates the\n        specified object metadata with them.\n\n        If 'clear' is True, any existing metadata is deleted and only the\n        passed metadata is retained. Otherwise, the values passed here update\n        the object's metadata.\n\n        By default, the standard object metadata prefix ('X-Object-Meta-') is\n        prepended to the header name if it isn't present. For non-standard\n        headers, you must include a non-None prefix, such as an empty string.\n        "
    if (prefix is None):
        prefix = OBJECT_META_PREFIX
    massaged = _massage_metakeys(metadata, prefix)
    cname = utils.get_name(self.container)
    oname = utils.get_name(obj)
    new_meta = {
        
    }
    if (not clear):
        obj_meta = self.get_metadata(obj, prefix=prefix)
        new_meta = _massage_metakeys(obj_meta, prefix)
    utils.case_insensitive_update(new_meta, massaged)
    to_pop = []
    for (key, val) in six.iteritems(new_meta):
        if (not val):
            to_pop.append(key)
    for key in to_pop:
        new_meta.pop(key)
    uri = ('/%s/%s' % (cname, oname))
    (resp, resp_body) = self.api.method_post(key, headers=new_meta)

dataset/ETHPy150Open rackspace/pyrax/pyrax/object_storage.py StorageObjectManager.set_metadata/VarMisuse@194/450 `uri`->`key`