// Path: src/main/java/org/jpy/PyLib.java
// public static void assertPythonRuns() {
//     if (dllProblem != null) {
//         throw new RuntimeException("PyLib not initialized", dllProblem);
//     }
//     if (!isPythonRunning()) {
//         throw new RuntimeException("PyLib not initialized");
//     }
// }


import java.util.Objects;
import static org.jpy.PyLib.assertPythonRuns;
     * Extends Python's 'sys.path' variable by the given module path.
     *
     * @param modulePath The new module path. Should be an absolute pathname.
     * @param prepend    If true, the new path will be the new first element of 'sys.path', otherwise it will be the last.
     * @return The altered 'sys.path' list.
     * @since 0.8
     */
    public static PyObject extendSysPath(String modulePath, boolean prepend) {
        Objects.requireNonNull(modulePath, "path must not be null");
        PyModule sys = importModule("sys");
        PyObject sysPath = sys.getAttribute("path");
        if (prepend) {
            sysPath.call("insert", 0, modulePath);
        } else {
            sysPath.call("append", modulePath);
        }
        return sysPath;
    }


    /**
     * Create a Java proxy instance of this Python module which contains compatible functions to the ones provided in the
     * interface given by the {@code type} parameter.
     *
     * @param type The interface's type.
     * @param <T>  The interface name.
     * @return A (proxy) instance implementing the given interface.
     */
    @Override
    public <T> T createProxy(Class<T> type) {
// Path: src/main/java/org/jpy/PyLib.java
// public static void assertPythonRuns() {
//     if (dllProblem != null) {
//         throw new RuntimeException("PyLib not initialized", dllProblem);
//     }
//     if (!isPythonRunning()) {
//         throw new RuntimeException("PyLib not initialized");
//     }
// }


// Path: src/main/java/org/jpy/PyModule.java
import java.util.Objects;
import static org.jpy.PyLib.assertPythonRuns;

     * Extends Python's 'sys.path' variable by the given module path.
     *
     * @param modulePath The new module path. Should be an absolute pathname.
     * @param prepend    If true, the new path will be the new first element of 'sys.path', otherwise it will be the last.
     * @return The altered 'sys.path' list.
     * @since 0.8
     */
    public static PyObject extendSysPath(String modulePath, boolean prepend) {
        Objects.requireNonNull(modulePath, "path must not be null");
        PyModule sys = importModule("sys");
        PyObject sysPath = sys.getAttribute("path");
        if (prepend) {
            sysPath.call("insert", 0, modulePath);
        } else {
            sysPath.call("append", modulePath);
        }
        return sysPath;
    }


    /**
     * Create a Java proxy instance of this Python module which contains compatible functions to the ones provided in the
     * interface given by the {@code type} parameter.
     *
     * @param type The interface's type.
     * @param <T>  The interface name.
     * @return A (proxy) instance implementing the given interface.
     */
    @Override
    public <T> T createProxy(Class<T> type) {
        assertPythonRuns();