from typing import Sequence


def parse_attrs(attrs):
	"""Parse an attrs sequence/dict to have tuples as keys/items."""
	if isinstance(attrs, Sequence):
		ret = [item.split(".") for item in attrs]
	else:
		ret = dict()
		for key, value in attrs.items():
			ret[tuple(key.split("."))] = value
	return ret