code: def _on_exit(self, proc):
      if proc is not self.process:
          # Ignore exit of old process instance
          return
      self.mark_stopped()
  
imports: from __future__ import annotations
  import asyncio
  import contextlib
  import errno
  import functools
  import logging
  import multiprocessing
  import os
  import shutil
  import threading
  import uuid
  import warnings
  import weakref
  from collections.abc import Callable, Collection
  from inspect import isawaitable
  from queue import Empty
  from typing import ClassVar, Literal, cast
  from toolz import merge
  from tornado.ioloop import IOLoop
  import dask
  from dask.system import CPU_COUNT
  from dask.utils import parse_timedelta
  from distributed import preloading
  from distributed.comm import get_address_host
  from distributed.comm.addressing import address_from_user_args
  from distributed.compatibility import asyncio_run
  from distributed.config import get_loop_factory
  from distributed.core import AsyncTaskGroupClosedError, CommClosedError, ErrorMessage, OKMessage, RPCClosed, Status, coerce_to_address, error_message
  from distributed.diagnostics.plugin import NannyPlugin, _get_plugin_name
  from distributed.metrics import time
  from distributed.node import ServerNode
  from distributed.process import AsyncProcess
  from distributed.proctitle import enable_proctitle_on_children
  from distributed.protocol import pickle
  from distributed.protocol.serialize import _is_dumpable
  from distributed.security import Security
  from distributed.utils import get_ip, get_mp_context, json_load_robust, log_errors, parse_ports, silence_logging_cmgr, wait_for
  from distributed.worker import Worker, run
  from distributed.worker_memory import DeprecatedMemoryManagerAttribute, DeprecatedMemoryMonitor, NannyMemoryManager
label_desc: Use image node_id 2 for calling the WorkerProcess obj's underlying member method code with example usage: obj._on_exit(proc) without return types