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
import requests | |
from bs4 import BeautifulSoup | |
from PIL import Image | |
import pytesseract | |
from io import BytesIO | |
from dataclasses import dataclass | |
from tqdm import tqdm | |
@dataclass | |
class Ad: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
date | kilowatt-hour | n_hosts | n_guests | temperature | |
---|---|---|---|---|---|
2022-01-01 | 2.171 | 0.0 | 0.0 | 7.875000000000028 | |
2022-01-02 | 10.31 | 0.0 | 0.5 | 8.787500000000023 | |
2022-01-03 | 16.107 | 0.0 | 1.0 | 8.35000000000003 | |
2022-01-04 | 16.563 | 0.0 | 1.0 | 9.250000000000014 | |
2022-01-05 | 17.098 | 0.0 | 1.0 | 5.700000000000024 | |
2022-01-06 | 18.76 | 0.0 | 1.0 | 2.950000000000024 | |
2022-01-07 | 20.853 | 0.0 | 1.0 | 3.2500000000000284 | |
2022-01-08 | 19.548 | 0.0 | 1.0 | 8.887500000000031 | |
2022-01-09 | 20.81 | 0.0 | 1.0 | 8.72500000000003 |
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
import pandas as pd | |
cards = pd.read_csv('archive/hearthstone_standard_cards.csv') | |
cards['multiClassIds'] = cards['multiClassIds'].map(eval) | |
cards = cards.explode('multiClassIds') | |
cards['multiClassIds'] = cards['multiClassIds'].fillna(cards['classId']) | |
classes = pd.read_csv('archive/metadata/classes.csv', index_col='id') | |
cards['class'] = cards['multiClassIds'].map(classes['name']) |
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
project: | |
outputs: | |
prod: | |
type: duckdb | |
path: /tmp/project.duckdb | |
target: prod |
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
<!DOCTYPE html> | |
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> | |
<div id="app"> | |
<div class="grid-container"> | |
<button class="grid-item" v-for="key in keys" @click="click(key[0], key[1])"> | |
{{ key[2] }} | |
</button> | |
</div> |
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
import itertools | |
def merge_components(cs): | |
while True: | |
for (i, a), (j, b) in itertools.combinations(enumerate(cs), 2): | |
if a[0] == b[0]: | |
a[1].extend(b[1]) | |
del cs[j] | |
break | |
else: |
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
import urllib.parse | |
import requests | |
import time | |
import xml.dom.minidom | |
def get_abbyy_transcription(doc, app, password): | |
proxies = {} | |
url_params = { |
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
import math | |
import random | |
def poisson(l, rng=random): | |
"""From https://www.johndcook.com/blog/2010/06/14/generating-poisson-random-values/""" | |
L = math.exp(-l) | |
k = 0 | |
p = 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
"""Generic branch and leaf implementation.""" | |
import operator | |
import textwrap | |
import typing | |
class Op: | |
"""An operator that is part of a split.""" | |
__slots__ = "symbol", "func" |