Skip to content

Instantly share code, notes, and snippets.

View eddiebergman's full-sized avatar
💭

Eddie Bergman eddiebergman

💭
View GitHub Profile
from dask_jobqueue import SLURMCluster
import time
from pathlib import Path
from concurrent.futures import wait, ALL_COMPLETED
def f(x: int) -> int:
time.sleep(20)
print(f"Done {x}")
@eddiebergman
eddiebergman / seed.py
Created February 6, 2023 07:26
Case for not using `np.random.seed`
import numpy as np
np.random.seed(1)
print("My code", np.random.choice([1,2,3,4,5]))
# My code 4
# Update library
np.random.seed(1)
@eddiebergman
eddiebergman / sq.sh
Last active January 30, 2023 09:40
A more informative `sq` command
fudge() {
# Does some simple formatting for general things
# * Highlights based on status code
# * Highlight your name
# * Dim some things
# https://stackoverflow.com/a/33206814
# https://www.linuxquestions.org/questions/linux-newbie-8/tput-for-bold-dim-italic-underline-blinking-reverse-invisible-4175704737/
green=$(tput setaf 2)
orange=$(tput setaf 3)
@eddiebergman
eddiebergman / main.py
Created February 9, 2022 23:25 — forked from mypy-play/main.py
Shared via mypy Playground
from abc import abstractmethod
from typing import TypeVar, Generic, Protocol
class P1(Protocol):
def predict(self): ...
class P2(Protocol, P1):
def predict_proba(self): ...
T1 = TypeVar("T1", bound=P1)