Skip to content

Instantly share code, notes, and snippets.

@hosackm
hosackm / colorlog.py
Created July 28, 2020 01:39
Colored logger module using Colorama
import logging
from colorama import init, Fore, Back
init(autoreset=True)
class ColorFormatter(logging.Formatter):
# Change this dictionary to suit your coloring needs!
COLORS = {
"WARNING": Fore.RED,
@Michael-J-Ward
Michael-J-Ward / central_limit_demo.py
Last active April 24, 2016 19:41
Demonstrating Central Limit theorem
# Demonstrating the Central Limit Theorem for MITs Probabilistic Systems course
import numpy as np
import matplotlib.pyplot as plt
def genTest(distribution,**kwargs):
"""Returns a score generating function from the given distribution"""
def test(num_students):
kwargs['size'] = num_students