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
class ClosableSSEClient(SSEClient): | |
def close(self): | |
self.should_connect = False | |
self.retry = 0 | |
try: | |
self.resp.raw._fp.fp._sock.shutdown(socket.SHUT_RDWR) | |
self.resp.raw._fp.fp._sock.close() | |
except AttributeError: | |
pass | |
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
#!/bin/bash | |
kill -9 $(ps aux | grep 'uwsgi' | awk '{print $2}') | |
source /home/ubuntu/.env/myappenv/bin/activate | |
cd /home/ubuntu/myapp | |
kill -9 $(ps -aux | grep 'worker.py' | awk '{print $2}') | |
nohup redis-server & | |
nohup python -u worker.py > worker.out & | |
uwsgi --socket :8881 --plugin python --wsgi-file main.py --callable app --buffer-size 32768 --process 4 --logto /home/ubuntu/myapp/log/myapp.log & | |
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 pylab as pl | |
from itertools import cycle | |
def plot_2D(data, target, target_names): | |
colors = cycle('rgbcmykw') | |
target_ids = range(len(target_names)) | |
pl.figure() | |
for i, c, label in zip(target_ids, colors, target_names): | |
pl.scatter(data[target == i, 0], data[target == i, 1], | |
c=c, label=label) | |
pl.legend() |
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 json | |
input_ls = [] | |
f = open('inputTraining.txt') | |
for line in iter(f): | |
try: | |
input_ls.append(json.loads(line)) | |
except ValueError: | |
print line +'is not a proper json line' |
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
nobuma.com | |
15qm.com | |
nokiamail.com | |
sofimail.com | |
10minut.xyz | |
emailgo.de | |
inbax.tk | |
gowikifilms.com | |
mybitti.de | |
mierdamail.com |
OlderNewer