<commit_before>"""Cassandra database example

This example demonstrates connecting to a Cassandra database and executing a query. Note that
using the database driver remains exactly the same. The only  difference is that we're
monkey-patching everything (including the Cassandra driver), making it guv-friendly.

Adjust this example to your database address, keyspace, and query that you would like to run.
"""
import logger
logger.configure()

import guv
guv.monkey_patch()

import logging

from cassandra import cluster

log = logging.getLogger()


def main():
    nodes = ['192.168.20.2']

    c = cluster.Cluster(nodes, port=9042)
    session = c.connect('test')
    log.info('Execute commands')
    rows = session.execute('SELECT * FROM numbers')

    for row in rows:
        log.info(row)

    log.warn('Cassandra support is currently incomplete and buggy.')
    c.shutdown()


if __name__ == '__main__':
    main()

<commit_msg>Remove warning message (now fixed)<commit_after>"""Cassandra database example

This example demonstrates connecting to a Cassandra database and executing a query. Note that
using the database driver remains exactly the same. The only  difference is that we're
monkey-patching everything (including the Cassandra driver), making it guv-friendly.

Adjust this example to your database address, keyspace, and query that you would like to run.
"""
import guv

guv.monkey_patch()

import logger

logger.configure()

import logging

from cassandra import cluster

log = logging.getLogger()


def main():
    nodes = ['192.168.20.2']

    c = cluster.Cluster(nodes, port=9042)
    session = c.connect('test')
    log.info('Execute commands')
    rows = session.execute('SELECT * FROM numbers')

    for row in rows:
        log.info(row)

    c.shutdown()


if __name__ == '__main__':
    main()


{'fraction_non_alphanumeric': 0.09200438116100766, 'fraction_numerical': 0.014238773274917854, 'mean_word_length': 3.911290322580645, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '5414798', 'n_tokens_mistral': 544, 'n_tokens_neox': 505, 'n_words': 201}