def verifyNode(nodeName):
	allObjects = cmds.ls()
	if ampy.indexOf(nodeName, allObjects) == None:
		# if nodeName is a DAG node then we need to test further possibilities
		# if nodeName exists but is not unique, then a full path must be provided
		msg = None
		for node in allObjects:
			if node.find('|%s'%nodeName) > -1:
				raiseExceptionWithMessage('%s is not a unique object name. Please specify the complete DAG path.'%nodeName, 1)
		# see if nodeName is a full path for a unique object, in which case it won't look the same as that returned by cmds.ls
		for node in allObjects:
			if nodeName[nodeName.rfind(node):nodeName.rfind(node)+len(node)] == node: return True
		raiseExceptionWithMessage('%s is not a valid object name. Please ensure that you have entered it correctly.'%nodeName, 1)
Verify the existence of a DG node, primarily for validating user input.
dataset/ETHPy150Open CountZer0/PipelineConstructionSet/python/maya/site-packages/amTools/utilities/dg.py/verifyNode