Skip to content

Instantly share code, notes, and snippets.

View e3krisztian's full-sized avatar

Krisztián Fekete e3krisztian

  • Budapest, Hungary
View GitHub Profile
#!/usr/bin/env python
# wagnerfischer.py: Dynamic programming Levensthein distance function
# Kyle Gorman <gormanky@ohsu.edu>
#
# Based on:
#
# Robert A. Wagner and Michael J. Fischer (1974). The string-to-string
# correction problem. Journal of the ACM 21(1):168-173.
#
# The thresholding function was inspired by BSD-licensed code from
from datetime import datetime
import csv
import sys
START_DATE = 'start_date'
END_DATE = 'end_date'
TOLERANCE = 31 # days
PRIMARY_KEYS = ['frame_id', 'person_id']
def mold_date(any_date):
@e3krisztian
e3krisztian / template.py
Created November 17, 2017 06:48 — forked from jamescasbon/template.py
Pure python templates using with statement
"""
A really stupid python template language inspired by coffeekup, markaby.
Do not use this code, it will ruin your day. A byproduct of insomnia.
TL;DR
-----
This module defines a template language that allows us to do:
d = Doc()