<commit_before># -*- coding: utf-8 -*-
import re


class InfluxDBClient(object):
    def __init__(self,
            host,
            port,
            user,
            pwd,
            db,
    ):
        import influxdb

        self._client = influxdb.InfluxDBClient(
                host=host,
                port=port,
                username=user,
                password=<PASSWORD>,
                database=db,
        )

    def query(self, *args, **kwargs):
        return self._client.query(*args, **kwargs)

    def show_measurements(self):
        return self._client.query("SHOW MEASUREMENTS")

    def get_points(self, res):<commit_msg>default to JSON serialiser when talking to influx<commit_after># -*- coding: utf-8 -*-
import re


class InfluxDBClient(object):
    def __init__(self,
            host,
            port,
            user,
            pwd,
            db,
    ):
        import influxdb

        self._client = influxdb.InfluxDBClient(
                host=host,
                port=port,
                username=user,
                password=<PASSWORD>,
                database=db,
                headers={'Accept': 'application/json'},
        )

    def query(self, *args, **kwargs):
        return self._client.query(*args, **kwargs)

    def show_measurements(self):
        return self._client.query("SHOW MEASUREMENTS")

    def get_points(self, res):
{'fraction_non_alphanumeric': 0.10714285714285714, 'fraction_numerical': 0.0014285714285714286, 'mean_word_length': 1.5706422018348625, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1627866', 'n_tokens_mistral': 410, 'n_tokens_neox': 378, 'n_words': 84}