<commit_before>import logging
import time

# Redis Queue
from redis import Redis
from rq import Queue

# other libraries for rdflib
from rdflib import Graph

# our own slightly more general stuff
from insert import insert
from turtle_grapher import generate_output

# for various features we add
from savvy import savvy # serotype/amr/vf

def rq_get_graph(job):
    graph = job.result

def spfy(args_dict):
    '''
    # note: the timeout times refer to how long the job has once it has STARTED executing
    # we use the high priority queue for things that should be immediately returned to the user
    high = Queue('high', default_timeout=80)  # 80 seconds
    low = Queue('low', default_timeout=600)
    '''

    # use 1 queue for now
    low = Queue('low', default_timeout=600)

    sav = low.enqueue(savvy,args_dict)
    while sav.result is None:
        time.sleep(20)
    graph = sav.result
    logging.info('uploading to blazegraph')
    print "Uploading to Blazegraph"
    print insert(graph)
    print 'uploaded wooot!'


if __name__ == "__main__":
    import argparse
    import os  # for batch cleanup

    from ConfigParser import SafeConfigParser
    from turtle_utils import generate_hash<commit_msg>bug day<commit_after>import logging
import time

# Redis Queue
from redis import Redis
from rq import Queue

# other libraries for rdflib
from rdflib import Graph

# our own slightly more general stuff
from insert import insert
from turtle_grapher import generate_output
from turtle_utils import generate_uri as gu

# for various features we add
from savvy import savvy # serotype/amr/vf

def spfy(args_dict):
    '''
    # note: the timeout times refer to how long the job has once it has STARTED executing
    # we use the high priority queue for things that should be immediately returned to the user
    high = Queue('high', default_timeout=80)  # 80 seconds
    low = Queue('low', default_timeout=600)
    '''

    # use 1 queue for now
    low = Queue('low', default_timeout=600)

    sav = low.enqueue(savvy,args_dict)
    while sav.result is None:
        time.sleep(20)
    graph = sav.result
    logging.info('uploading to blazegraph')
    print "Uploading to Blazegraph"
    print insert(graph)
    print 'uploaded wooot!'


if __name__ == "__main__":
    import argparse
    import os  # for batch cleanup

    from ConfigParser import SafeConfigParser
    from turtle_utils import generate_hash
{'fraction_non_alphanumeric': 0.06397028477094512, 'fraction_numerical': 0.010730499380932727, 'mean_word_length': 3.5822306238185253, 'pattern_counts': {'":': 2, '<': 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': '5881240', 'n_tokens_mistral': 752, 'n_tokens_neox': 707, 'n_words': 280}