def abandon_nodes(parses, labels, remove_dependents=False):
	"""
	given an array of parses (sequences of dicts), abandon nodes with any of the defined labels, e.g., FRAG or PARSE nodes.
	note that children are preserved
	if remove_dependents is True, the entire subtree is wiped out
	"""
	result=[]
	for p in parses:
		if "NODE" in p and p["NODE"] in labels:
			if not remove_dependents:
				result.extend(abandon_nodes(p["children"],labels))
		elif "NODE" in p:
			result.append({ "NODE":p["NODE"], "children":abandon_nodes(p["children"],labels)})
		else:
			result.append(p)
	return result