def METHOD_NAME(base_node, path, cached_nodes):
	'''
	Take the base node and the path and return a node
	Results are cached because searching the node tree is expensive
	The following code is executed by threads, it is not safe, so a lock is needed...
	'''
	# normalize the path because ant_glob() does not understand
	# parent path components (..)
	path = os.path.normpath(path)
	# normalize the path case to increase likelihood of a cache hit
	path = os.path.normcase(path)
	# ant_glob interprets [] and () characters, so those must be replaced
	path = path.replace('[', '?').replace(']', '?').replace('(', '[(]').replace(')', '[)]')
	node_lookup_key = (base_node, path)
	try:
		node = cached_nodes[node_lookup_key]
	except KeyError:
		# retry with lock on cache miss
		with lock:
			try:
				node = cached_nodes[node_lookup_key]
			except KeyError:
				node_list = base_node.ant_glob([path], ignorecase=True, remove=False, quiet=True, regex=False)
				node = cached_nodes[node_lookup_key] = node_list[0] if node_list else None
	return node