Alarm Status Table - Dynamic filtering

My apologies; I copied that conversion script from a post I made here without putting it into context. Using a parameterized popup window, I imagine that this would need to be adapted for the alarm status table's filterAlarm extension function. The script would look like this:

#def filterAlarm(self, alarmEvent):
	tagPath = self.parent.yourCustomProp #custom prop value here
	def getSourcePath(tagPath):
		sourcePath = tagPath.replace('[', 'prov:').replace(']', ':/tag:').replace('/Alarms/', ':/alm:', 1)
		return sourcePath
	if getSourcePath(tagPath) in str(alarmEvent.source):
		return True
	else:
		return False

...or perhaps even simpler:

#def filterAlarm(self, alarmEvent):
	tagPath = self.parent.yourCustomProperty #custom prop value here
	sourcePath = tagPath.replace('[', 'prov:').replace(']', ':/tag:').replace('/Alarms/', ':/alm:', 1)
	if sourcePath in str(alarmEvent.source):
		return True
	else:
		return False