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
# this script will install whisper, carbon and graphite-web on the current directory | |
sudo apt-get python-dev | |
mkvirtualenv --system-site-packages graphite | |
pip install twisted | |
pip install django | |
pip install django-tagging | |
pip install gunicorn |
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 os | |
import fnmatch | |
from django import template | |
register = template.Library() | |
@register.filter(is_safe=False) | |
def walk(top_path, glob='*'): | |
""" | |
Generate a list of filepath that match the `glob` pattern by walking |
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 sklearn.datasets import make_blobs | |
from sklearn.cluster import dbscan | |
from sklearn.cluster._dbscan_inner import dbscan_inner | |
from sklearn.metrics import pairwise_distances_chunked | |
from scipy.sparse import csr_matrix | |
import numpy as np | |
# dataset | |
n = 50000 | |
ds, _ = make_blobs(n, 100, 50) |
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
use futures::{ | |
channel::mpsc::{unbounded, UnboundedSender}, | |
future, pin_mut, SinkExt, StreamExt, | |
}; | |
use std::cell::RefCell; | |
use std::rc::Rc; | |
use std::{collections::HashMap, env, io::Error as IoError, net::SocketAddr}; | |
use tokio::net::{TcpListener, TcpStream}; | |
use tokio::task; | |
use tungstenite::error::Error; |