Skip to content

Instantly share code, notes, and snippets.

@Zagrebelin
Zagrebelin / taneja.py
Last active January 13, 2017 09:42 — forked from vaxyzek/taneja.py
#! /usr/bin/python3.6
import datetime
import itertools
def show_progress(start, idx, total):
if idx == 0:
return
now = datetime.datetime.now()
speed = idx / (now - start).total_seconds()
@Zagrebelin
Zagrebelin / .py
Created June 8, 2016 08:26 — forked from anonymous/.py
def vake(list_of_keys,list_of_values):
if len(list_of_values) >= len(list_of_keys):
return {x[0]:x[1] for x in zip(list_of_keys,list_of_values)}
else:
list_of_values = list_of_values + [None]*(len(list_of_keys) - len(list_of_values))
return {x[0]:x[1] for x in zip(list_of_keys,list_of_values)}