def mark_ref_paired(osm,pid):
	""" Marks stops with common ref as paired="ref".
	Returns list of osm refs which are not in pid"""
	osmrefs = set(osm.keys())
	pidrefs = set(pid.keys())
	common = osmrefs.intersection(pidrefs)
	for ref in common:
		for stop in osm[ref]:
			stop["paired"] = "ref"
		for stop in pid[ref]:
			stop["paired"] = "ref"
			stop["osm_id"] = osm[ref][0]["osm_id"]
	osm_orphans = osmrefs.difference(pidrefs)
	return osm_orphans