Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@a-leut
a-leut / history_helper.py
Created August 8, 2017 22:23
adds a version property to models implementing django-simple-history
class HistoryHelperMixin(object):
""" Adds a version property to models implementing django-simple-history
https://github.com/treyhunner/django-simple-history
"""
@property
def version(self):
return self.__class__._get_history_id(self.id)
@classmethod
def _get_history_id(cls, id):
#!/usr/bin/env python
""" https://github.com/blei-lab/edward/blob/master/examples/bayesian_logistic_regression.py
Bayesian logistic regression using Hamiltonian Monte Carlo.
We visualize the fit.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import edward as ed
@a-leut
a-leut / pygame2exe.py
Created March 2, 2013 11:52
Build a pygame project into a Windows executable.
# py2exe setup program
from distutils.core import setup
import py2exe
import sys
import os
import glob, shutil
sys.argv.append("py2exe")
VERSION = '1.0'
AUTHOR_NAME = 'Your Name'