def create( self, name, scriptNode ) :

		layout = self.__namedLayouts[name]

		# first try to import the modules the layout needs
		contextDict = { "scriptNode" : scriptNode }
		imported = set()
		classNameRegex = re.compile( "[a-zA-Z]*Gaffer[^(,]*\(" )
		for className in classNameRegex.findall( layout ) :
			moduleName = className.partition( "." )[0]
			if moduleName not in imported :
				exec( "import %s" % moduleName, contextDict, contextDict )
				imported.add( moduleName )

		return eval( layout, contextDict, contextDict )

	## Saves all layouts whose name matches the optional regular expression into the file object
	# specified. If the file is later evaluated during application startup, it will reregister
	# the layouts with the application.
	## \todo Remove this method and follow the model in Bookmarks.py, where user bookmarks
	# are saved automatically. This wasn't possible when Layouts.py was first introduced,
	# because at that point in time, the Layouts class didn't have access to an application.
dataset/ETHPy150Open ImageEngine/gaffer/python/GafferUI/Layouts.py/Layouts.create/original