This file contains hidden or 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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """ | |
| A basic example using multiple processes | |
| We spawn 4 processes. Each process is made to draw N/4 random | |
| integers from 1 to 10, for some fixed large N. | |
| Then the processes adds up its list of numbers, passes it into a queue, | |
| and the main program adds up the subtotals to get a grand total. |
This file contains hidden or 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
| #!/usr/bin/env python3 | |
| """ Example multiprocess based python file | |
| """ | |
| import multiprocessing | |
| import argparse | |
| import itertools | |
| ARGP = argparse.ArgumentParser( |
This file contains hidden or 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 multiprocessing | |
| import time | |
| from random import randint | |
| PROCESSES = 5 | |
| WORKER_CALLS = 7 | |
| def worker(num): | |
| """worker function""" | |
| print 'Starting worker', num |
This file contains hidden or 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 print_function | |
| # import httplib2 | |
| # import os | |
| # from apiclient import discovery | |
| # from oauth2client import client | |
| # from oauth2client import tools | |
| # from oauth2client.file import Storage | |
| import urllib.request as urllibReq |
This file contains hidden or 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
| """ | |
| For more information regarding DialogFlow SDK see: | |
| * https://github.com/googleapis/dialogflow-python-client-v2 | |
| * https://dialogflow-python-client-v2.readthedocs.io/en/latest/ | |
| * https://cloud.google.com/dialogflow/docs/reference/rest/v2/projects.agent.sessions/detectIntent | |
| """ | |
| import dialogflow_v2 as dialogflow |
This file contains hidden or 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
| /* Useful celery config. | |
| app = Celery('tasks', | |
| broker='redis://localhost:6379', | |
| backend='redis://localhost:6379') | |
| app.conf.update( | |
| CELERY_TASK_RESULT_EXPIRES=3600, | |
| CELERY_QUEUES=( | |
| Queue('default', routing_key='tasks.#'), |
This file contains hidden or 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
| # ZIPLINE IMPORTS | |
| import pandas as pd | |
| import numpy as np | |
| import re | |
| import scipy | |
| from collections import OrderedDict | |
| from cvxopt import solvers, matrix, spdiag | |
| import talib | |
| from zipline.api import attach_pipeline, pipeline_output, get_datetime |
This file contains hidden or 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 asyncio | |
| import ccxt.async as ccxt | |
| from collections import defaultdict | |
| exchanges = list() | |
| exchanges.append(('binance', apiKey, secret)) | |
| exchanges.append(('livecoin', apiKey, secret)) | |
| tasks = list() | |
| tasks += [ccxt.coinmarketcap({'timeout':100000}).fetch_tickers(params={'limit':0})] |
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 hidden or 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
| # the following two lines give a two-line status, with the current window highlighted | |
| hardstatus alwayslastline | |
| hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]' | |
| # huge scrollback buffer | |
| defscrollback 5000 | |
| # no welcome message | |
| startup_message off |