Skip to content

Instantly share code, notes, and snippets.

View koorukuroo's full-sized avatar
🎯
Focusing

Kyunghoon Kim koorukuroo

🎯
Focusing
View GitHub Profile
@imlucas
imlucas / add_users.py
Created April 12, 2012 12:58
Using Amazon Cloudsearch with Python and Boto
from cloudsearch import connect_cloudsearch, get_document_service
endpoint = 'paste your doc service endpoint here'
service = get_document_service(endpoint=endpoint) # Get a new instance of cloudsearch.DocumentServiceConnection
# Presumably get some users from your db of choice.
users = [
{
'id': 1,
@yamakk
yamakk / nx_pylab.py.patch
Created September 28, 2011 07:40
patch for enables function draw_networkx_edge_labels to set fontproperties.
--- networkx-1.5/networkx/drawing/nx_pylab.py 2011-06-04 09:45:38.000000000 +0900
+++ nx_pylab.py 2011-10-01 01:48:06.000000000 +0900
@@ -21,7 +21,8 @@
# All rights reserved.
# BSD license.
-__all__ = ['draw',
+__all__ = ['set_fontproperties',
+ 'draw',
'draw_networkx',
@alexbowe
alexbowe / nltk-intro.py
Created March 21, 2011 12:59
Demonstration of extracting key phrases with NLTK in Python
import nltk
text = """The Buddha, the Godhead, resides quite as comfortably in the circuits of a digital
computer or the gears of a cycle transmission as he does at the top of a mountain
or in the petals of a flower. To think otherwise is to demean the Buddha...which is
to demean oneself."""
# Used when tokenizing words
sentence_re = r'''(?x) # set flag to allow verbose regexps
([A-Z])(\.[A-Z])+\.? # abbreviations, e.g. U.S.A.