This file contains 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
# based on: https://stackoverflow.com/questions/24527006/split-a-generator-into-chunks-without-pre-walking-it | |
def chunks(iterable, size=10): | |
iterator = iter(iterable) | |
for first in iterator: | |
yield chain([first], islice(iterator, size - 1)) | |
This file contains 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 __future__ import annotations | |
from dataclasses import dataclass | |
from typing import Optional | |
class Model: | |
def __init__(self, name: str, age: int) -> None: | |
self.name = name | |
self.age = age |
This file contains 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 selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
class WebDriver: | |
DOWNLOAD_DIR = '/tmp' | |
def __init__(self, headless=True): | |
self.options = webdriver.ChromeOptions() |
This file contains 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 cx_Freeze import setup, Executable | |
import requests.certs | |
build_exe_options = \ | |
{"include_files":[ | |
(requests.certs.where(),'cacert.pem'), | |
('config.ini'), | |
('input/'), | |
('output/') | |
]} |