<commit_before>#coding:utf-8
'''
    PyRESTRedis A Python REST Interface to Redis key/value storage server
 
 Licensed with Apache Public License
 by AAAI Research Group
 Department of Information Engineering and Computer Science and Mathematics
 University of L'Aquila, ITALY
 http://www.disim.univaq.it

'''

__author__ = 'giodegas'

from flask import Flask
from flask.ext import restful
from flask.ext.restful import Resource

from redis import Redis

SERVICE_PORT = 8379
REDIS_IP = '127.0.0.1'

app = Flask(__name__)
api = restful.Api(app)

class ServiceDiscovery(Resource):
    def get(self):
        return {'SERVICES': '/INFO, /GET/.., /SET/../.., /EXISTS/.., /PUBLISH/../.., /KEYS/.., /SADD/../.., /SMEMBERS/.., /redis....'}

class SetKey(Resource):
    def get(self, key_id, value):
        global R
        out = R.set(key_id, value)
        return {'SET': out}

class GetKey(Resource):
    def get(self, key_id):
        global R
        out = R.get(key_id)
        return {'GET': out}

class Info(Resource):
    def get(self):
        global R
        out = R.info()
        return {'INFO': out}

class Keys(Resource):
    def get(self, keyPattern):
        global R
        out = R.keys(keyPattern)
        return {'KEYS': out}

class ExistsKey(Resource):
    def get(self, key_id):
        global R
        out = R.exists(key_id)
        return {'exists': out}

class Sadd(Resource):
    def get(self, key_id, member):
        global R
        out = R.sadd(key_id, member)
        return {'SADD': out}

class Smembers(Resource):
    def get(self, key_id):
        global R
        out = list(R.smembers(key_id))
        return {'SMEMBERS': out}
<commit_msg>exists command case<commit_after>#coding:utf-8
'''
    PyRESTRedis A Python REST Interface to Redis key/value storage server
 
 Licensed with Apache Public License
 by AAAI Research Group
 Department of Information Engineering and Computer Science and Mathematics
 University of L'Aquila, ITALY
 http://www.disim.univaq.it

'''

__author__ = 'giodegas'

from flask import Flask
from flask.ext import restful
from flask.ext.restful import Resource

from redis import Redis

SERVICE_PORT = 8379
REDIS_IP = '127.0.0.1'

app = Flask(__name__)
api = restful.Api(app)

class ServiceDiscovery(Resource):
    def get(self):
        return {'SERVICES': '/INFO, /GET/.., /SET/../.., /EXISTS/.., /PUBLISH/../.., /KEYS/.., /SADD/../.., /SMEMBERS/.., /redis....'}

class SetKey(Resource):
    def get(self, key_id, value):
        global R
        out = R.set(key_id, value)
        return {'SET': out}

class GetKey(Resource):
    def get(self, key_id):
        global R
        out = R.get(key_id)
        return {'GET': out}

class Info(Resource):
    def get(self):
        global R
        out = R.info()
        return {'INFO': out}

class Keys(Resource):
    def get(self, keyPattern):
        global R
        out = R.keys(keyPattern)
        return {'KEYS': out}

class ExistsKey(Resource):
    def get(self, key_id):
        global R
        out = R.exists(key_id)
        return {'EXISTS': out}

class Sadd(Resource):
    def get(self, key_id, member):
        global R
        out = R.sadd(key_id, member)
        return {'SADD': out}

class Smembers(Resource):
    def get(self, key_id):
        global R
        out = list(R.smembers(key_id))
        return {'SMEMBERS': out}

{'fraction_non_alphanumeric': 0.13261648745519714, 'fraction_numerical': 0.006571087216248507, 'mean_word_length': 2.528977871443625, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1259627', 'n_tokens_mistral': 1157, 'n_tokens_neox': 1119, 'n_words': 326}