<commit_before>import tornado
from tornado import ioloop, httpclient
from seria import NowObject, NowClient
import types

class WebPullService(NowObject):
    def handle_fetch_url(self, url, callback):
        print 'FETCH', url, callback

        request = httpclient.HTTPRequest(
                    url=url,
                  )
        http_client = httpclient.AsyncHTTPClient()
        http_client.fetch(request, lambda x: x and callback(x.body))

def main():
    now = NowClient()

    now.local['webpull'] = WebPullService

    def joined_workerpool(result):
        print 'JOINED'
    
    now.system.join_workerpool('webpull', joined_workerpool)

    ioloop = tornado.ioloop.IOLoop.instance()
    ioloop.start()

if __name__ == '__main__':
    main()
<commit_msg>can make calls from js now<commit_after>import tornado
from tornado import ioloop, httpclient
from seria import NowObject, NowClient
import types

class WebPullService(NowObject):
    def handle_fetch_url(self, url, callback):
        print 'FETCH', url, callback

        request = httpclient.HTTPRequest(
                    url=url,
                  )
        http_client = httpclient.AsyncHTTPClient()
        def got_result(result ):
            print result
            result and callback and callback(x.body)
        http_client.fetch(request, got_result)

def main():
    now = NowClient()

    now.local['webpull'] = WebPullService

    def joined_workerpool(result):
        print 'JOINED'
    
    now.system.join_workerpool('webpull', joined_workerpool)

    ioloop = tornado.ioloop.IOLoop.instance()
    ioloop.start()

if __name__ == '__main__':
    main()

{'fraction_non_alphanumeric': 0.09245742092457421, 'fraction_numerical': 0.0, 'mean_word_length': 2.8078703703703702, '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': '1623767', 'n_tokens_mistral': 504, 'n_tokens_neox': 473, 'n_words': 118}