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 psycopg2 | |
| import time | |
| import selenium | |
| from selenium import webdriver | |
| import openpyxl | |
| from openpyxl import load_workbook | |
| import subprocess | |
| from email.mime.text import MIMEText | |
| from email.mime.application import MIMEApplication | |
| from email.mime.multipart import MIMEMultipart |
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 sqlite3 | |
| db = sqlite3.connect(':memory:') | |
| c = db.cursor() | |
| c.execute('CREATE TABLE mytable (description text)') | |
| c.execute('INSERT INTO mytable VALUES ("Riemann")') | |
| c.execute('INSERT INTO mytable VALUES ("All the Carmichael numbers")') | |
| print '1) EQUALITY' | |
| c.execute('SELECT * FROM mytable WHERE description == "Riemann"'); print 'Riemann:', c.fetchall() |
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 pandas as pd | |
| from functools import wraps | |
| from typing import Union, List, Callable, Any | |
| def upsert_df(target_df: pd.DataFrame, key_columns: Union[str, List[str]]): | |
| """ | |
| Decorator that performs an upsert operation on a target DataFrame. | |
| Args: | |
| target_df: The DataFrame to upsert into |
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
| ##################################################### | |
| # Setting the Stage: Our Dataset | |
| ##################################################### | |
| import pandas as pd | |
| import numpy as np | |
| import seaborn as sns | |
| import matplotlib.pyplot as plt | |
| import plotly.express as px | |
| import plotly.graph_objects as go |
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
| # SPDX-License-Identifier: MPL-2.0 | |
| # Author: Maxim Sharabayko | |
| # See https://maxsharabayko.github.io/blog/posts/plot-vc-frame-size/ | |
| import click | |
| import pandas as pd | |
| from bokeh.plotting import figure, show, output_file | |
| from bokeh.io import output_notebook | |
| from bokeh.transform import factor_cmap | |
| from bokeh.models import Legend, LegendItem | |
| from bokeh.layouts import column |
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
| # General Information | |
| # * High-level programming language | |
| # * General-purpose (vs. domain specific) | |
| # * Created by Guido van Rossum (1991) | |
| # * Emphasizes: | |
| # * Code readability | |
| # * Highly-expressive syntax | |
| # | |
| # | |
| # Some specifics |
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 __future__ import annotations | |
| import os | |
| import sys | |
| import json | |
| import pprint | |
| import sqlite3 | |
| import argparse | |
| from pathlib import Path | |
| from typing import cast, List, NewType, Tuple, TypedDict, Generator, Union |
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 os | |
| import sys | |
| import time | |
| import hashlib | |
| import pathlib as pt | |
| import subprocess as sp | |
| from watchdog.observers import Observer | |
| from watchdog.events import PatternMatchingEventHandler |
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 | |
| import threading | |
| from contextlib import asynccontextmanager, contextmanager | |
| from typing import Any, Callable | |
| @contextmanager | |
| def my_cont_mgr(tag: str): | |
| print(f"{tag}: f entering!") |
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
| """An alternative API for st.session_state using a class decorator. | |
| So instead of doing this... | |
| if "run_counter" in st.session_state: | |
| st.session_state.run_counter = 0 | |
| st.session_state.run_counter += 1 | |
| st.write("Number of reruns:", st.session_state.run_counter) |
NewerOlder