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
(($(compare image1.png image2.png -compose src -fuzz 2% -metric ae /dev/null 2>&1) | wc -c) > 4)) |
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 sys, os | |
sys.path.insert(0, os.environ.get('GOOGLE_APPENGINE_SDK_PATH')) | |
sys.path.insert(0, os.environ.get('GOOGLE_APPENGINE_NDB_PATH')) | |
sys.modules.pop('google', None) | |
import dev_appserver | |
dev_appserver.fix_sys_path() | |
from google.appengine.ext import testbed | |
from google.appengine.api import urlfetch_errors | |
from google.appengine.runtime import apiproxy_errors | |
#from guppy import hpy |
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
ilevy@paxon:/c/2/prom/ndbleak_cur$ ipython -ic 'from ndb_test import *; print fetch_entities(); print len(wd); len(ndb.tasklets._state.all_pending)' | |
Python 2.7.3 (default, Sep 26 2013, 20:03:06) | |
Type "copyright", "credits" or "license" for more information. | |
IPython 0.13.2 -- An enhanced Interactive Python. | |
? -> Introduction and overview of IPython's features. | |
%quickref -> Quick reference. | |
help -> Python's own help system. | |
object? -> Details about 'object', use 'object??' for extra details. | |
^[[(22, 230000) |
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
diff --git a/google/appengine/api/apiproxy_rpc.py b/google/appengine/api/apiproxy_rpc.py | |
index 7e73bfd..b39c490 100644 | |
--- a/google/appengine/api/apiproxy_rpc.py | |
+++ b/google/appengine/api/apiproxy_rpc.py | |
@@ -112,6 +112,18 @@ class RPC(object): | |
assert self.__state is RPC.IDLE, ('RPC for %s.%s has already been started' % | |
(self.package, self.call)) | |
assert self.callback is None or callable(self.callback) | |
+ call = self.callback | |
+ def c2(*args, **kwargs): |
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 sys,os | |
sys.path.insert(0, os.environ.get('GOOGLE_APPENGINE_SDK_PATH')) | |
sys.path.insert(0, os.environ.get('GOOGLE_APPENGINE_NDB_PATH')) | |
import dev_appserver | |
dev_appserver.fix_sys_path() | |
from google.appengine.ext import testbed | |
t = testbed.Testbed() | |
os.environ['APPLICATION_ID'] = 'foo' | |
t.activate() | |
t.init_datastore_v3_stub(use_sqlite=True, datastore_file='100GzipText.sqlite') |
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 collections | |
def counts(ls, d): | |
cnts = collections.defaultdict(int) | |
for l in ls: | |
while l: | |
cnts[l] += 1 | |
l = d[l] | |
return cnts | |
def mst(ls, d): |
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
#!/usr/bin/python | |
""" | |
Simple implementation of disjoint set data structure using | |
path compression and union by rank. | |
Sequences of Find and Union run in O(a(x)) where a() is the | |
inverse of the Ackermann function. That means it's fast, for | |
python. |
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
#!/usr/bin/python | |
# sudo apt-get install pip; sudo pip install requests request_cache | |
import argparse | |
import collections | |
from datetime import timedelta, datetime | |
import itertools | |
import json | |
import numpy | |
import operator | |
import re |
NewerOlder