def get_aws_metadata(headers, provider=None):
    if not provider:
        provider = boto.provider.get_default()
    metadata_prefix = provider.metadata_prefix
    metadata = {}
    for hkey in headers.keys():
        if hkey.lower().startswith(metadata_prefix):
            val = urllib.unquote_plus(headers[hkey])
            try:
                metadata[hkey[len(metadata_prefix):]] = unicode(val, 'utf-8')
            except __HOLE__:
                metadata[hkey[len(metadata_prefix):]] = val
            del headers[hkey]
    return metadata
dataset/ETHPy150Open radlab/sparrow/deploy/third_party/boto-2.1.1/boto/utils.py/get_aws_metadata