Skip to content

Instantly share code, notes, and snippets.

from PIL import Image, ImageDraw, ImageFont
import argparse
import numpy as np
sample_rate = 0.4
def ascii_art(file):
im = Image.open(file)
@wowkin2
wowkin2 / SingletonMongoClient.py
Created May 14, 2016 17:20
Python Singleton with parameters (so the same parameters get you the same object) with support to default arguments and passing arguments as kwargs (but no support for pure kwargs).
"""
Python Singleton with parameters (so the same parameters get you the same object)
with support to default arguments and passing arguments as kwargs (but no support for pure kwargs).
And implementation for MongoClient class from pymongo package.
"""
from pymongo import MongoClient
import inspect