Decode a single element for a map

def decode_map_element(self, item_type, value):
        """Decode a single element for a map"""
        import urllib
        key = value
        if ":" in value:
            key, value = value.split(':',1)
            key = urllib.unquote(key)
        if Model in item_type.mro():
            value = item_type(id=value)
        else:
            value = self.decode(item_type, value)
        return (key, value)