Skip to content

Instantly share code, notes, and snippets.

View Lukasa's full-sized avatar

Cory Benfield Lukasa

View GitHub Profile
@dgouldin
dgouldin / similarity.py
Created June 6, 2015 09:53
Twitter friend similarity
from __future__ import division
import json
import os
import urlparse
from collections import defaultdict
from datetime import datetime
from dateutil.relativedelta import relativedelta
from requests import HTTPError
from requests_oauthlib import OAuth1Session
git diff --no-prefix --ignore-space-at-eol | sed -e "s/^diff --git [^[:space:]]*/Index:/" -e "s/^index.*/===================================================================/" > changes.patch
import zipimport
# Used to try and prevent bugs from people who see that Wheels
# support being added to sys.path and expect that your library/tool should
# support this misfeature.
try:
if isinstance(__loader__, zipimport.zipimporter):
raise RuntimeError(
"Zipped imports are not supported, use something less terrible."
)