@Override
	public GhidraScript getScriptInstance(ResourceFile sourceFile, PrintWriter writer)
			throws GhidraScriptLoadException {
		if (scriptRunner == null) {
			String msg = "Ghidra was not started with PyGhidra. Python is not available";
			throw new GhidraScriptLoadException(msg);
		}
		GhidraScript script = SystemUtilities.isInHeadlessMode() ? new PyGhidraHeadlessScript()
				: new PyGhidraGhidraScript();
		script.setSourceFile(sourceFile);
		return script;
	}
Sets the Python side script runner.

This method is for <b>internal use only</b> and is only public so it can be
called from Python.

@param scriptRunner the Python side script runner
@throws AssertException if the script runner has already been set
Ghidra/Features/PyGhidra/src/main/java/ghidra/pyghidra/PyGhidraScriptProvider.java