Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
""" | |
Context manager or function to send text messages to your phone when a | |
process is done. | |
Edit the global variables. You might be able to find your phone e-mail | |
address here: http://tinywords.com/about-old/mobile/ | |
Usage: | |
with SendText("long running process"): | |
do_something() |
# Mathieu Blondel, October 2010 | |
# License: BSD 3 clause | |
import numpy as np | |
from numpy import linalg | |
def linear_kernel(x1, x2): | |
return np.dot(x1, x2) | |
def polynomial_kernel(x, y, p=3): |