def METHOD_NAME(
    self,
    args: Tuple[str, ...],
    env: Dict[str, str],
    working_dir: str,
    cancellation_latch: PySessionCancellationLatch,
) -> ExitCode:
    """Run a single daemonized run of Pants.
    All aspects of the `sys` global should already have been replaced in `__call__`, so this
    method should not need any special handling for the fact that it's running in a proxied
    environment.
    """
    try:
        logger.debug("Connected to pantsd")
        logger.debug(f"work dir: {working_dir}")
        # Capture the client's start time, which we propagate here in order to get an accurate
        # view of total time.
        env_start_time = env.get("PANTSD_RUNTRACKER_CLIENT_START_TIME", None)
        if not env_start_time:
            # NB: We warn rather than erroring here because it eases use of non-Pants nailgun
            # clients for testing.
            logger.warning(
                "No start time was reported by the client! Metrics may be inaccurate."
            )
        start_time = float(env_start_time) if env_start_time else time.time()
        options_bootstrapper = OptionsBootstrapper.create(
            env=env, args=args, allow_pantsrc=True
        )
        # Run using the pre-warmed Session.
        complete_env = CompleteEnvironmentVars(env)
        scheduler, options_initializer = self._core.prepare(options_bootstrapper, complete_env)
        runner = LocalPantsRunner.create(
            complete_env,
            working_dir,
            options_bootstrapper,
            scheduler=scheduler,
            options_initializer=options_initializer,
            cancellation_latch=cancellation_latch,
        )
        return runner.run(start_time)
    except Exception as e:
        logger.exception(e)
        return PANTS_FAILED_EXIT_CODE
    except KeyboardInterrupt:
        print("Interrupted by user.\n", file=sys.stderr)
        return PANTS_FAILED_EXIT_CODE