Skip to content

Instantly share code, notes, and snippets.

View e-dorigatti's full-sized avatar

Emilio Dorigatti e-dorigatti

View GitHub Profile
@e-dorigatti
e-dorigatti / wrap_exceptions.py
Last active October 8, 2015 09:48
Wraps all non built-in exceptions raised by all methods in a class into a base exception
import sys
import inspect
class MyBaseException(Exception):
def __init__(self, msg=None, inner=None):
super(Exception, self).__init__(msg)
self.inner = inner
class WrapExceptions(type):
@e-dorigatti
e-dorigatti / pyladies-sentiment.ipynb
Created September 25, 2015 16:48
Very simple sentiment analysis for the python ladies at Trento researchers' night
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env python
# encoding: utf-8
import codecs
import itertools
import json
import os
import re
import sys
import stopwords