code: def send(self, data):
          
  
          if self._device:
              if isinstance(data, str):
                  data = str.encode(data)
  
              # Hack to support unicode under Python 2.x
              if sys.version_info < (3,):
                  if isinstance(data, unicode):
                      data = bytes(data)
  
              self._device.write(data)
docs: Sends data to the `AlarmDecoder`_ device.
  
          :param data: data to send
          :type data: string