Entrypoint to send data to Zabbix
        If debug is enabled, items are sent one by one
        If debug isn't enable, we send items in bulk
        Returns a list of results (1 if no debug, as many as items in other case)
509649
def send(self):
        
        if self.logger: # pragma: no cover
            self.logger.info("Starting to send %d items" % len(self._items_list))
        try:
            # Zabbix trapper send a maximum of 250 items in bulk
            # We have to respect that, in case of enforcement on zabbix server side
            # Special case if debug is enabled: we need to send items one by one
            max_value = ZBX_TRAPPER_MAX_VALUE
            if self.debug_level >= 4:
                max_value = 1
                if self.logger: # pragma: no cover
                    self.logger.debug("Bulk limit is %d items" % max_value)
            else:
                if self.logger: # pragma: no cover
                    self.logger.info("Bulk limit is %d items" % max_value)
            # Initialize offsets & counters
            max_offset = len(self._items_list)
            run = 0
            start_offset = 0
            stop_offset = min(start_offset + max_value, max_offset)
            server_success = server_failure = processed = failed = total = time = 0
            while start_offset < stop_offset:
                run += 1
                if self.logger: # pragma: no cover
                    self.logger.debug(
                        'run %d: start_offset is %d, stop_offset is %d' %
                        (run, start_offset, stop_offset)
                    )

                # Extract items to be send from global item's list'
                _items_to_send = self.items_list[start_offset:stop_offset]

                # Send extracted items
                run_response, run_processed, run_failed, run_total, run_time = self._send_common(_items_to_send)

                # Update counters
                if run_response == 'success':
                    server_success += 1
                elif run_response == 'failed':
                    server_failure += 1
                processed += run_processed
                failed += run_failed
                total += run_total
                time += run_time
                if self.logger: # pragma: no cover
                    self.logger.info("%d items sent during run %d" % (run_total, run))
                    self.logger.debug(
                        'run %d: processed is %d, failed is %d, total is %d' %
                        (run, run_processed, run_failed, run_total)
                    )

                # Compute next run's offsets
                start_offset = stop_offset
                stop_offset = min(start_offset + max_value, max_offset)

                # Reset socket, which is likely to be closed by server
                self._socket_reset()
        except:
            self._reset()
            self._socket_reset()
            raise
        if self.logger: # pragma: no cover
            self.logger.info('All %d items have been sent in %d runs' % (total, run))
            self.logger.debug(
                'Total run is %d; item processed: %d, failed: %d, total: %d, during %f seconds' %
                (run, processed, failed, total, time)
            )
        # Everything has been sent.
        # Reset DataContainer & return results_list
        self._reset()
        return server_success, server_failure, processed, failed, total, time
353878
public void sendBulkDataAsync(List<? extends Map<String, ?>> bulkSourceList,
            String index, String type) {
        executeBulkRequestAsync(
                buildBulkIndexRequestBuilder(bulkSourceList
                        .stream().map(source -> jmESClient
                                .prepareIndex(index, type).setSource(source))
                        .collect(toList())));
    }
68500
def debug(self, *debugReqs):
        """"""
        return self._client.send(debug=sc2api_pb2.RequestDebug(debug=debugReqs))
859700
def _send(self, data):
        
        retry = self.RETRY
        # Attempt to send any data in the queue
        while retry > 0:
            # Check socket
            if not self.socket:
                # Log Error
                self.log.error("StatsiteHandler: Socket unavailable.")
                # Attempt to restablish connection
                self._connect()
                # Decrement retry
                retry -= 1
                # Try again
                continue
            try:
                # Send data to socket
                data = data.split()
                data = data[0] + ":" + data[1] + "|kv\n"
                self.socket.sendall(data)
                # Done
                break
            except socket.error as e:
                # Log Error
                self.log.error("StatsiteHandler: Failed sending data. %s.", e)
                # Attempt to restablish connection
                self._close()
                # Decrement retry
                retry -= 1
                # try again
                continue
1249926
def _send_query(self, query: Dict[str, Any]):
        
        queryb = self.encoder(query)
        self._client.write(queryb)
        if self.debug is True:
            print("send query {}".format(queryb))

        return True
820013
def debug(self):
        
        debug_instance = self.add_transform_task('debug', locals())
        response = utils.make_call(debug_instance.url, 'get')
        return response.json()
575288
def debug(self, message, *args, **kwargs):
        
        self.system.debug(message, *args, **kwargs)
1143054
def send(self, *args):
        
        # this and the serializer could use some streamlining
        if None in args:
            raise TypeError('None is not a valid queue item.')
        serialized_values = [self.serialize(value) for value in args]
        logger.debug('Sending to "%s": %s', self.name, serialized_values)
        return self.redis.rpush(self.name, *serialized_values)
861842
def _debug(self, out, print_prefix=True):
        
        if self.debug:
            if print_prefix:
                pre = self.__class__.__name__
                if hasattr(self, 'debug_prefix'):
                    pre = getattr(self, 'debug_prefix')
                sys.stderr.write("%s: " % pre)
            sys.stderr.write(out)
658494
def debug_btn_clicked(self, widget, data=None):
        
        self.store.clear()
        self.thread = threading.Thread(target=self.logs_update)
        self.thread.start()
372753
def _chunk_actions(actions, chunk_size, max_chunk_bytes, serializer):
    
    bulk_actions = []
    size, action_count = 0, 0
    for action, data in actions:
        action = serializer.dumps(action)
        cur_size = len(action) + 1

        if data is not None:
            data = serializer.dumps(data)
            cur_size += len(data) + 1

        # full chunk, send it and start a new one
        if bulk_actions and (size + cur_size > max_chunk_bytes or action_count == chunk_size):
            yield bulk_actions
            bulk_actions = []
            size, action_count = 0, 0

        bulk_actions.append(action)
        if data is not None:
            bulk_actions.append(data)
        size += cur_size
        action_count += 1

    if bulk_actions:
        yield bulk_actions
404536
def debug_info(self):
        """"""
        return [tuple(imap(int, x.split('='))) for x in
                self._debug_info.split('&')]
219319
def set_debug(self, debug=1):
        
        self._check_if_ready()
        self.debug = debug
        self.main_loop.debug = debug
391173
public void send(List<StDatapoint> datapoints) {
    for (StDatapoint metric : datapoints) {
      StDatapointValidator.validate(metric);
    }
    sender.send(datapoints);
  }
829014
public void printResults() {
	System.out.println("[ --- Lucee Debug Response --- ]");
	System.out.println();

	System.out.println("----------------------------");
	System.out.println("|          Output          |");
	System.out.println("----------------------------");
	System.out.println(write);
	System.out.println();

	System.out.println("----------------------------");
	System.out.println("|       Debug Output       |");
	System.out.println("----------------------------");
	System.out.println(writeDebug);
	System.out.println();

	System.out.println("----------------------------");
	System.out.println("|        Variables         |");
	System.out.println("----------------------------");

	Enumeration e = variables.keys();
	while (e.hasMoreElements()) {
	    final Object key = e.nextElement();
	    System.out.println("[Variable:" + key + "]");
	    System.out.println(escapeString(variables.get(key).toString()));
	}
	System.out.println();

	e = queries.keys();
	while (e.hasMoreElements()) {
	    final Query query = (Query) queries.get(e.nextElement());
	    printQuery(query);
	    System.out.println();
	}

    }
415472
def send_batches(self, batch_list):
        
        if isinstance(batch_list, BaseMessage):
            batch_list = batch_list.SerializeToString()

        return self._post('/batches', batch_list)
938723
def init_debug():
    """"""
    global debug_stats
    global QueueLength
    if debug_stats is None:
        list_defaultdict = partial(defaultdict, list)
        debug_stats = defaultdict(list_defaultdict)
        QueueLength = []