def METHOD_NAME():
    """Regression test for avoiding the lightning import to set the multiprocessing context."""
    package_name = "pytorch_lightning" if "lightning.pytorch" == "pytorch_lightning" else "lightning"
    # The following would fail with "context has already been set"
    code = dedent(
        f"""
        import sys
        import multiprocessing as mp
        import {package_name}
        mp.set_start_method("spawn")
        """
    )
    # run in complete isolation
    assert subprocess.call([sys.executable, "-c", code]) == 0