def _bucket_tagging_from_xml(self, xml):
    parsed_xml = xmltodict.parse(xml)
    tags = {}
    if parsed_xml['Tagging'].get('TagSet'):
        if (not isinstance(parsed_xml['Tagging']['TagSet']['Tag'], list)):
            tags[parsed_xml['Tagging']['TagSet']['Tag']['Key']] = parsed_xml['Tagging']['TagSet']['Tag']['Value']
        else:
            for tag in parsed_xml['Tagging']['TagSet']['Tag']:
                if (tag['Key'] in tags):
                    raise DuplicateTagKeys()
                tags[tag['Key']] = tag['Value']
    for (key, _) in tags.items():
        if key.startswith('aws:'):
            raise NoSystemTags()
    return tags
def _bucket_tagging_from_xml(self, xml):
    parsed_xml = xmltodict.parse(xml)
    tags = {}
    if parsed_xml['Tagging'].get('TagSet'):
        if (not isinstance(parsed_xml['Tagging']['TagSet']['Tag'], list)):
            tags[parsed_xml['Tagging']['TagSet']['Tag']['Key']] = parsed_xml['Tagging']['TagSet']['Tag']['Value']
        else:
            for tag in parsed_xml['Tagging']['TagSet']['Tag']:
                if (tag['Key'] in tags):
                    raise DuplicateTagKeys()
                tags[tag['Key']] = tag['Value']
    for (key, _) in tags.items():
        if key.startswith('aws:'):
            raise NoSystemTags()
    return tags