Skip to content

Instantly share code, notes, and snippets.

View solalatus's full-sized avatar

Levente Szabados solalatus

View GitHub Profile
class ABC():
def __init__(my_parameter):
self.my_object_variable = my_parameter
def whatever_shit():
print(self.my_object_variable)
def plot_digits(data):
fig, axes = plt.subplots(10, 10, figsize=(10, 10),
subplot_kw={'xticks':[], 'yticks':[]},
gridspec_kw=dict(hspace=0.1, wspace=0.1))
for i, ax in enumerate(axes.flat):
ax.imshow(data[i],
cmap='binary', interpolation='nearest',
clim=(0, 16))
plt.show()
@solalatus
solalatus / fuzzy_date_detector.py
Created July 16, 2016 12:33
Dateparser based detctor for all dates in a string - untested
import dateparser
def detect_date(line=""):
"""Detect multiple, multi language date and datetime entries in a given string.
@param type: String to detect occuring_dates in, ideally a single line.
@type type: String
@return: Returns the list of found DateTime objects or None
@rtype: List or None
"""