code: def start_heartbeat(self):
          
  
          if not self._hb_thread:
  
              try:
  
                  self._logger.info('Starting heartbeat thread')
                  self._prof.prof('creating heartbeat thread', uid=self._uid)
                  self._hb_terminate = threading.Event()
                  self._hb_thread = threading.Thread(target=self._heartbeat, name='heartbeat')
  
                  self._prof.prof('starting heartbeat thread', uid=self._uid)
                  self._hb_thread.start()
  
                  return True
  
              except Exception, ex:
  
                  self._logger.exception('Heartbeat not started, error: %s' % ex)
                  self.terminate_heartbeat()
                  raise
  
          else:
              self._logger.warn('Heartbeat thread already running, but attempted to restart!')
docs: **Purpose**: Method to start the heartbeat thread. The heartbeat function
          is not to be accessed directly. The function is started in a separate
          thread using this method.