def METHOD_NAME(obj):
	"""
	Searches a data structure of lists, tuples and dicts for IntEnum
	and replaces them by their dictionary representation, which can be loaded
	by json-tricks. This happens in-place (the object is changed, use a copy).
	"""
	from enum import IntEnum
	from json_tricks import encoders
	if isinstance(obj, IntEnum):
		return encoders.enum_instance_encode(obj)
	if isinstance(obj, dict):
		for key, val in obj.items():
			obj[key] = METHOD_NAME(val)
		return obj
	if isinstance(obj, list):
		for index, val in enumerate(obj):
			obj[index] = METHOD_NAME(val)
		return obj
	if isinstance(obj, (tuple, set)):
		return type(obj)(METHOD_NAME(val) for val in obj)
	return obj