Skip to content

Instantly share code, notes, and snippets.

View nderkach's full-sized avatar
✏️

Nikolay Derkach nderkach

✏️
View GitHub Profile
#!/usr/bin/python
import itertools
from collections import defaultdict
from timeit import Timer
class Feature(object):
def __init__(self, name):
self.name = name
#!/usr/bin/python
import unittest
class Node(object):
def __init__(self, data, children=None):
self.children = []
self.right = None
self.data = data
#!/usr/bin/env python
import unittest
class Stack(list):
def push(self, item):
self.append(item)
def isEmpty(self):
return not self
def peek(self):
@nderkach
nderkach / find_missing_packages
Created September 19, 2014 17:36
Find missing python packages
#!/usr/bin/env python
import os
import importlib
for fn in os.listdir():
if fn.endswith(".py"):
with open(fn, 'r') as f:
for line in f:
if "import" in line: