Skip to content

Instantly share code, notes, and snippets.

View kwist-sgr's full-sized avatar

Vitaliy Yelnik kwist-sgr

  • Ukraine
View GitHub Profile
LOGGING ={
'version': 1,
'disable_existing_loggers': False,
'formatters': {
"generic": {
"format": "%(asctime)s [%(process)d] [%(levelname)s] %(message)s",
"datefmt": "[%Y-%m-%d %H:%M:%S %z]",
"class": "logging.Formatter"
},
},
#!/usr/bin/env python3.7
# pip install aiohttp aiodns
import sys
import asyncio
import aiohttp
from pathlib import Path
GOOGLE = 'http://www.google.com'
@kwist-sgr
kwist-sgr / lazy_partition.py
Created November 22, 2018 08:11
lazy_partition
def lazy_partition(predicate, iterable):
"""
lazy partition implementation
"""
true, false = deque(), deque()
sequence = ((true if predicate(x) else false).append(x) for x in iterable)
def _share(seq):
while True:
while seq: