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 os | |
import sys | |
import multiprocessing | |
import signal | |
import logging | |
class Daemonize(): | |
def __init__(self, pid_file='daemon.pid'): | |
self.obj = None | |
self.pid_file = pid_file |
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 time | |
import random | |
class Profiler(): | |
def __init__(sel,f name): | |
self.name = name | |
self.count = 0 | |
def __call__(self, fn): | |
import time |
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
class Element(): | |
def __init__(self, data, next=None, prev=None): | |
self.data = data | |
self.next = next | |
self.prev = prev | |
class Deque(): | |
def __init__(self): | |
self.first = None | |
self.last = None |