Skip to content

Instantly share code, notes, and snippets.

View luismond's full-sized avatar
🎯
Focusing

Luis Mondragón luismond

🎯
Focusing
View GitHub Profile
@rolph-recto
rolph-recto / contractions.py
Last active January 14, 2016 18:06
Featureset builder for tweets Used for classification and other machine learning tasks
# contractions.py
# list from: http://en.wikipedia.org/wiki/Wikipedia:List_of_English_contractions
contractions = [
("aren't", "are not"),
("can't", "cannot"),
("can't've", "cannot have"),
("'cause", "because"),
("could've", "could have"),
("couldn't", "could not"),
("couldn't've", "could not have"),
@66Ton99
66Ton99 / logging_to_str.py
Created August 28, 2015 16:26
Capturing Python Log Output In A Variable
import logging
from StringIO import StringIO as StringBuffer
logger = logging.getLogger('basic_logger')
logger.setLevel(logging.DEBUG)
### Setup the console handler with a StringIO object
log_capture_string = StringBuffer()
# log_capture_string.encoding = 'cp1251'
ch = logging.StreamHandler(log_capture_string)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.