<commit_before>Flask Redistore
===============

Adds Redis to your Flask Appliation.

Install
-------

.. code:: bash

    $ pip install Flask-Redistore

Usage
-----

.. code:: python

    import flask
    from flask.ext.redistore import Redistore

    app = flask.Flask(__name__)
    app.config["REDIS_URI"] = "redis://:password@localhost/0"
    redis = Redistore(app)
    redis.set("My key", "the value!")
    redis.get("My key")

Usage (advanced)
----------------

.. code:: python

    import flask
    import redis

    from flask.ext.redistore import Redistore

    redis = Redistore(redis_class=redis.StrictRedis)

    def create_app(name=__name__):
        app = flask.Flask(name)
        redis.init_app(app)
        return app

    create_app()
    redis.set("My new key", "Another Value!")
    redis.get("My new key")<commit_msg>Fix the advanced usage<commit_after>Flask Redistore
===============

Adds Redis to your Flask Appliation.

Install
-------

.. code:: bash

    $ pip install Flask-Redistore

Usage
-----

.. code:: python

    import flask
    from flask.ext.redistore import Redistore

    app = flask.Flask(__name__)
    app.config["REDIS_URI"] = "redis://:password@localhost/0"
    redis = Redistore(app)
    redis.set("My key", "the value!")
    redis.get("My key")

Usage (advanced)
----------------

.. code:: python

    import flask
    import redis

    from flask.ext.redistore import Redistore

    redis = Redistore(redis_class=redis.StrictRedis)

    def create_app(name=__name__):
        app = flask.Flask(name)
        app.config["REDIS_URI"] = "redis://:password@localhost/0"

        redis.init_app(app)

        return app

    create_app()
    redis.set("My new key", "Another Value!")
    redis.get("My new key")
{'fraction_non_alphanumeric': 0.1606837606837607, 'fraction_numerical': 0.0017094017094017094, 'mean_word_length': 2.620618556701031, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3156249', 'n_tokens_mistral': 627, 'n_tokens_neox': 578, 'n_words': 134}