def METHOD_NAME(args: argparse.Namespace) -> bool:
    """
    Ensures that Scalene runs with libscalene preloaded, if necessary,
    as well as any other required environment variables.
    Returns true iff we had to run another process.
    """
    # First, check that we are on a supported platform.
    # (x86-64 and ARM only for now.)
    if args.memory and (
        platform.machine() not in ["x86_64", "AMD64", "arm64", "aarch64"]
        or struct.calcsize("P") != 8
    ):
        args.memory = False
        print(
            "Scalene warning: currently only 64-bit x86-64 and ARM platforms are supported for memory and copy profiling."
        )
    with contextlib.suppress(Exception):
        from IPython import get_ipython
        if get_ipython():
            sys.exit = Scalene.clean_exit  # type: ignore
            sys._exit = Scalene.clean_exit  # type: ignore
    # Start a subprocess with the required environment variables,
    # which may include preloading libscalene
    req_env = ScalenePreload.get_preload_environ(args)
    if any(k_v not in os.environ.items() for k_v in req_env.items()):
        os.environ.update(req_env)
        new_args = [
            sys.executable,
            "-m",
            "scalene",
        ] + sys.argv[1:]
        result = subprocess.Popen(new_args, close_fds=True, shell=False)
        with contextlib.suppress(Exception):
            # If running in the background, print the PID.
            if os.getpgrp() != os.tcgetpgrp(sys.stdout.fileno()):
                # In the background.
                print(f"Scalene now profiling process {result.pid}")
                print(
                    f"  to disable profiling: python3 -m scalene.profile --off --pid {result.pid}"
                )
                print(
                    f"  to resume profiling:  python3 -m scalene.profile --on  --pid {result.pid}"
                )
        try:
            result.wait()
        except KeyboardInterrupt:
            result.returncode = 0
        if result.returncode < 0:
            print(
                "Scalene error: received signal",
                signal.Signals(-result.returncode).name,
            )
        sys.exit(result.returncode)
        return True
    return False