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 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}") |
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 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) |
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
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) |
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 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) |