def _send(data, sample_rate=1):
    """
    Squirt the metrics over UDP.
    """
    if host is None or port is None:
        return
    sampled_data = {}
    if sample_rate > 1:
        if random.random() <= sample_rate:
            for k, v in data.iteritems():
                sampled_data[k] = '{0}|@{1}'.format(v, sample_rate)
    else:
        sampled_data = data
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    try:
        for k, v in sampled_data.iteritems():
            #print('{0}:{1}'.format(k, v))
            s.sendto('{0}:{1}'.format(k, v), (host, port))
    except:
        logging.error(repr(sys.exc_info()))
dataset/ETHPy150Open devstructure/blueprint/blueprint/io/server/statsd.py/_send/swapped operands of `>`