code: def test_01_02_stop_heartbeat(self):
      self.awthread = self.AWThread(self.work_addr, self.zmq_context)
      self.awthread.start()
      temp_socket = self.zmq_context.socket(zmq.SUB)
      temp_socket.connect(self.awthread.keepalive_addr)
      temp_socket.setsockopt(zmq.SUBSCRIBE, b"")
      msg = temp_socket.recv()
      assert msg == b"LIVE"
      self.cancel()
      msg = temp_socket.recv()
      assert msg == cellprofiler_core.constants.worker.NOTIFY_STOP
  
imports: import io
  import queue
  import time
  import os
  import pytest
  import pickle
  import tempfile
  import threading
  import traceback
  import unittest
  import uuid
  import zlib
  import numpy
  import zmq
  import cellprofiler_core.analysis
  import cellprofiler_core.analysis.reply
  import cellprofiler_core.constants.measurement
  import cellprofiler_core.constants.worker
  import cellprofiler_core.measurement
  import cellprofiler_core.module._identify
  import cellprofiler_core.modules.namesandtypes
  import cellprofiler_core.pipeline
  import cellprofiler_core.preferences
  import cellprofiler_core.utilities.image
  import cellprofiler_core.utilities.measurement
  import cellprofiler_core.utilities.pathname
  import cellprofiler_core.utilities.zmq
  import cellprofiler_core.worker
  import cellprofiler_core.analysis.request
  from cellprofiler_core.constants.modules.namesandtypes import M_IMAGE_SET_ZIP_DICTIONARY
  from cellprofiler_core.pipeline import ImageFile
  from cellprofiler_core.pipeline import ImagePlane
  import tests.core
  import tests.core.modules
label_desc: Use image node_id 8 for calling the TestAnalysisWorker obj's underlying member method code with example usage: obj.test_01_02_stop_heartbeat() without return types