This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| items = range(0,10001) | |
| def iter_group(iterable, batch_size:int): | |
| iterable_type = type(iterable) | |
| length = len(iterable) | |
| start = batch_size*-1 | |
| end = 0 | |
| while(end < length): | |
| start += batch_size | |
| end += batch_size |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| seconds_verb = ( | |
| (29030400,'year'), | |
| (2419200,'month'), | |
| (604800,'week'), | |
| (86400,'day'), | |
| (3600,'hour'), | |
| (60,'minute'), | |
| (1,'second') | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "breadcrumbs.enabled": true, | |
| "debug.inlineValues": true, | |
| "editor.cursorWidth": 0, | |
| "editor.fontFamily": "Roboto Mono", | |
| "editor.fontLigatures": true, | |
| "editor.lineHeight": 30, | |
| "editor.minimap.enabled": true, | |
| "editor.multiCursorModifier": "alt", | |
| "editor.renderWhitespace": "none", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from PIL import Image | |
| import os | |
| thumbnails = [ | |
| 'D:\\preview\\chunks\\chunk_1534553190947880169_2_a.jpg', | |
| 'D:\\preview\\chunks\\chunk_1534553245644680292_13_a.jpg', | |
| 'D:\\preview\\chunks\\chunk_1534553646530284521_150_a.jpg', | |
| 'D:\\preview\\chunks\\chunk_1534553786142238979_199_a.jpg', | |
| 'D:\\preview\\chunks\\chunk_1534553810117674683_209_a.jpg', | |
| 'D:\\preview\\chunks\\chunk_1534554004357423981_277_a.jpg' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| import functools | |
| STATE = 0 | |
| async def count_to_10(loop,future): | |
| for i in range(1,11): | |
| print('#1 : {}'.format(i)) | |
| await asyncio.sleep(1) | |
| future.set_result(0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import subprocess | |
| import json | |
| CMD_LIST = 'pip list --outdated --format json' | |
| CMD_UPDATE = 'pip install --upgrade {}' | |
| result = subprocess.run(CMD_LIST.split(),stdout=subprocess.PIPE) | |
| packages = json.loads(result.stdout) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| ''' | |
| Any live cell with fewer than two live neighbours dies, as if caused by underpopulation. | |
| Any live cell with two or three live neighbours lives on to the next generation. | |
| Any live cell with more than three live neighbours dies, as if by overpopulation. | |
| Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction. | |
| ''' | |
| class Cell: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys, os | |
| import json | |
| import asyncio, aiohttp | |
| from time import time | |
| PLAYLIST_RETRIEVAL_FREQUENCY = 1 | |
| BASE_PATH = os.path.join('.','broadcasts') | |
| async def request_and_save_chunk(loop:asyncio.AbstractEventLoop,session:aiohttp.ClientSession,server_url,chunk_name,broadcast_id): | |
| chunk_path = os.path.join(BASE_PATH,broadcast_id,chunk_name) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import requests | |
| import json | |
| import asyncio, aiohttp | |
| from async_timeout import timeout | |
| from timeit import default_timer as timer | |
| import multiprocessing | |
| import os | |
| from urllib.parse import urljoin | |
| import logging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| import requests | |
| import sys | |
| import os | |
| import multiprocessing | |
| from PIL import Image | |
| from math import ceil | |
| import logging | |
| logging.basicConfig() |