def _parse_metrics(self, message):
        """
        Given a raw message of metrics split by newline characters, this will
        parse the metrics and return an array of metric objects.

        This will raise a :exc:`ValueError` if any metrics are invalid, unless
        ``ignore_errors`` is set to True.
        """
        results = []
        for line in message.split("\n"):
            # If the line is blank, we ignore it
            if len(line) == 0: continue

            # Parse the line, and skip it if its invalid
            try:
                (key, value, metric_type, flag) = parser.parse_line(line)
            except __HOLE__:
                self.logger.error("Invalid line syntax: %s" % line)
                continue

            # Create the metric and store it in our results
            if metric_type in metrics.METRIC_TYPES:
                # Create and store the metric object
                metric = metrics.METRIC_TYPES[metric_type](key, value, flag)
                results.append(metric)
            else:
                # Ignore the bad invalid metric, but log it
                self.logger.error("Invalid metric '%s' in line: %s" % (metric_type, line))

        return results
dataset/ETHPy150Open kiip/statsite/statsite/collector.py/Collector._parse_metrics