code: def cleanup(self):
      # Clean up the server; we drain all messages if any
      if self._poller is not None:
          # If we have self._poller, we have self._server_process
          with self._poller_lock:
              self._poller.unregister(self._channel)
              last_evts = self._poller.poll(5)
          for fd, _ in last_evts:
              # Readlines will never block here because `bufsize` is set to
              # 1 (line buffering)
              if fd == self._server_process.stdout.fileno():
                  sys.stdout.write(
                      self._server_process.stdout.readline()
                  )
              elif fd == self._server_process.stderr.fileno():
                  sys.stderr.write(
                      self._server_process.stderr.readline()
                  )
          sys.stdout.flush()
          sys.stderr.flush()
          self._poller = None
      if self._server_process is not None:
          # Attempt to send it a terminate signal and then wait and kill
          try:
              self._channel.send(
                  {
                      FIELD_MSGTYPE: MSG_CONTROL,
                      FIELD_OPTYPE: CONTROL_SHUTDOWN,
                  }
              )
              self._channel.recv(
                  timeout=10
              )  # If we receive, we are sure we
              # are good
          except:  # noqa E722
              pass  # If there is any issue sending this message, just ignore it
          self._server_process.kill()
          self._server_process = None
      if self._socket_path is not None and os.path.exists(
          self._socket_path
      ):
          os.unlink(self._socket_path)
          self._socket_path = None
  
imports: import fcntl
  import gc
  import os
  import importlib
  import itertools
  import select
  from subprocess import Popen, PIPE
  import sys
  import threading
  import time
  from .None import data_transferer
  from .consts import FIELD_ARGS, FIELD_CONTENT, FIELD_KWARGS, FIELD_MSGTYPE, FIELD_OPTYPE, FIELD_TARGET, MSG_CONTROL, MSG_EXCEPTION, MSG_INTERNAL_ERROR, MSG_OP, MSG_REPLY, OP_GETMETHODS, VALUE_LOCAL, VALUE_REMOTE, CONTROL_GETEXPORTS, CONTROL_SHUTDOWN
  from .communication.channel import Channel
  from .communication.socket_bytestream import SocketByteStream
  from .data_transferer import DataTransferer, ObjReference
  from .exception_transferer import load_exception
  from .override_decorators import LocalAttrOverride, LocalException, LocalOverride
  from .stub import create_class
  from .utils import get_canonical_name
label_desc: Use image node_id 4 for calling the Client obj's underlying member method code with example usage: obj.cleanup() without return types