def flatten_object(obj):
	"""flatten an object into paths for easier enumeration. 
		Args: an object
		Returns:
			a flat object with a list of pairs 
			[(p_1, v_1), ..., (p_k, v_k)], (paths and values)
		Example:
			{x: 1, y : {z: [a, b], w: c}} will be flatten into
			[("/x", 1), ("/y/z/0", a), ("/y/z/1", b), ("/y/w", c)]
	"""
	paths = []

	if isinstance(obj, (dict,)):
		for f in obj:
			sub_paths = flatten_object(obj[f])
			for p in sub_paths:
				paths.append(("/{}{}".format(f, p[0]), p[1]))
	elif isinstance(obj, (list,)):
		for i, x in enumerate(obj):
			sub_paths = flatten_object(x)
			for p in sub_paths:
				paths.append(("/{}{}".format(i, p[0]), p[1]))
	else:
		paths = [("", obj)]

	return paths