def CompareManagedObject(referenceObject, differenceObject, excludeDifferent=YesOrNo.FALSE, includeEqual=YesOrNo.FALSE,
						 noVersionFilter=YesOrNo.FALSE, includeOperational=YesOrNo.FALSE, xlateOrg=None, xlateMap=None):
	"""
    Compares managed objects.

    - referenceObject specifies objects used as a reference for comparison.
    - differenceObject specifies objects that are compared to the reference objects.
    - excludeDifferent, if set as True then displays only the properties of compared objects that are equal.
    - includeEqual, set as True to display properties of compared objects that are equal. By default, only properties that differ between the
      reference and difference objects are displayed.
    - noVersionFilter, set as True to ignore minimum version in properties.
    - includeOperational, set as True to include operational properties.
    - xlateOrg specifies the translation org to be used.
    - xlateMap specifies translation map with DNs of entities that needs to be translated.
    """
	from UcsBase import UcsUtils, WriteUcsWarning, GenericMO
	from Mos import OrgOrg

	referenceDict = {}
	differenceDict = {}

	if ((referenceObject != None) and (isinstance(referenceObject, list)) and (len(referenceObject) > 0)):
		for mo in referenceObject:
			if mo == None:
				continue

			moMeta = UcsUtils.IsPropertyInMetaIgnoreCase(mo.propMoMeta.name, "Meta")
			if (moMeta != None):
				if (moMeta.io == UcsMoMeta.ACCESS_TYPE_OUTPUTONLY):
					# WriteUcsWarning('[Warning]: Ignoring [%s]. Non-configurable class [%s]' %(mo.Dn, mo.propMoMeta.name))
					continue
				if ((moMeta.io == UcsMoMeta.ACCESS_TYPE_IO) and (len(moMeta.access) == 1) and (
							moMeta.access[0] == "read-only")):
					# WriteUcsWarning('[Warning]: Ignoring read-only MO  [%s]. Class [%s]' %(mo.Dn, mo.propMoMeta.name))
					continue

			referenceDict[mo.Dn] = mo

	if ((differenceObject != None) and (isinstance(differenceObject, list)) and (len(differenceObject) > 0)):
		for mo in differenceObject:
			if mo == None:
				continue

			moMeta = UcsUtils.IsPropertyInMetaIgnoreCase(mo.propMoMeta.name, "Meta")
			if (moMeta != None):
				if (moMeta.io == UcsMoMeta.ACCESS_TYPE_OUTPUTONLY):
					# WriteUcsWarning('[Warning]: Ignoring [%s]. Non-configurable class [%s]' %(mo.Dn, mo.propMoMeta.name))
					continue
				if ((moMeta.io == UcsMoMeta.ACCESS_TYPE_IO) and (len(moMeta.access) == 1) and (
							moMeta.access[0] == "read-only")):
					# WriteUcsWarning('[Warning]: Ignoring read-only MO  [%s]. Class [%s]' %(mo.Dn, mo.propMoMeta.name))
					continue

			translatedMo = TranslateManagedObject(mo, xlateOrg, xlateMap)
			differenceDict[translatedMo.Dn] = translatedMo

	dnList = []
	for key in referenceDict:
		dnList.append(key)
	for key in differenceDict:
		if key not in referenceDict:
			dnList.append(key)
	dnList = sorted(dnList)
	diffOutput = []

	for dn in dnList:
		if dn not in differenceDict:
			if excludeDifferent not in _AffirmativeList:
				moDiff = UcsMoDiff(referenceDict[dn], UcsMoDiff.REMOVE)
				diffOutput.append(moDiff)
		elif dn not in referenceDict:
			if excludeDifferent not in _AffirmativeList:
				moDiff = UcsMoDiff(differenceDict[dn], UcsMoDiff.ADD_MODIFY)
				diffOutput.append(moDiff)
		else:
			diffProps = []
			option = WriteXmlOption.AllConfig
			if includeOperational in _AffirmativeList:
				option = WriteXmlOption.All
			gmoReference = GenericMO(referenceDict[dn], option)
			gmoDifference = GenericMO(differenceDict[dn], option)
			if (not noVersionFilter):
				handle = gmoReference.GetHandle()
				if ((handle != None) and (handle._version != None)):
					gmoReference.FilterVersion(handle._version)

				handle = gmoDifference.GetHandle()
				if ((handle != None) and (handle._version != None)):
					gmoDifference.FilterVersion(handle._version)

			diffStatus = Compare(gmoReference, gmoDifference, diffProps)
			if ((diffStatus == CompareStatus.Equal) and (includeEqual in _AffirmativeList)):
				moDiff = UcsMoDiff(referenceDict[dn], UcsMoDiff.EQUAL)
				diffOutput.append(moDiff)
			elif ((diffStatus == CompareStatus.TypesDifferent) and (excludeDifferent not in _AffirmativeList)):
				moDiff = UcsMoDiff(referenceDict[dn], UcsMoDiff.REMOVE)
				diffOutput.append(moDiff)
				moDiff = UcsMoDiff(referenceDict[dn], UcsMoDiff.ADD_MODIFY)
				diffOutput.append(moDiff)
			elif ((diffStatus == CompareStatus.PropsDifferent) and (excludeDifferent not in _AffirmativeList)):
				refValues = {}
				diffValues = {}
				for prop in diffProps:
					refValues[prop] = gmoReference.getattr(prop)
					diffValues[prop] = gmoDifference.getattr(prop)
				moDiff = UcsMoDiff(differenceDict[dn], UcsMoDiff.ADD_MODIFY, diffProps, refValues, diffValues)
				diffOutput.append(moDiff)

	return diffOutput