Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import absolute_import, division, print_function | |
import multiprocessing | |
import pickle | |
from multiprocessing.pool import ThreadPool | |
from celery import shared_task | |
from dask.local import get_async # TODO: get better get | |
from dask.context import _globals | |
from dask.optimize import fuse, cull |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pickle | |
import threading | |
from Queue import Queue | |
import time | |
from bson import InvalidDocument | |
from celery.utils.log import get_task_logger | |
logger = get_task_logger(__name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, request, jsonify, json, abort | |
from flask_cors import CORS, cross_origin | |
import pandas as pd | |
app = Flask(__name__) | |
cors = CORS(app) | |
app.config['CORS_HEADERS'] = 'Content-Type' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Task primitives, allows pipeline execution using celery | |
@app.task | |
def dmap(it, callback, final=None): | |
# Map a callback over an iterator and return as a group | |
callback = subtask(callback) | |
# Hack for mapping a chain to values, due to a bug where args are not copied in group creation | |
if isinstance(callback, chain): | |
if final: | |
raise ValueError('task_processor: Cannot run reducer for dmap excecuted with a chain.') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import getpass | |
import sys | |
sys.path.insert(0,r"C:\Program Files (x86)\Google\google_appengine") | |
sys.path.insert(0,r"C:\Program Files (x86)\Google\google_appengine\lib\yaml\lib") | |
sys.path.insert(0,r"C:\Program Files (x86)\Google\google_appengine\lib\fancy_urllib") | |
from google.appengine.ext.remote_api import remote_api_stub | |
from google.appengine.ext import db |