def _send(self, bucket, value, sample_rate=None):
        """Format and send data to statsd.
        """
        try:
            bucket = bucket if isinstance(bucket, bytes) else bucket.encode('utf8')

            sample_rate = sample_rate or self._sample_rate
            if sample_rate and sample_rate < 1.0 and sample_rate > 0:
                if sample_rate <= random.random():
                    value = value + b'|@' + str(sample_rate).encode('utf8')
                else:
                    return

            stat = bucket + b':' + value
            if self._prefix:
                stat = self._prefix + b'.' + stat

            self._socket.sendto(stat, (self._host, self._port))
        except Exception as e:
            _logger.error("Failed to send statsd packet.", exc_info=True)
dataset/ETHPy150Open gaelenh/python-statsd-client/statsd.py/StatsdClient._send/swapped operands of `<=`