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 random | |
| from datetime import datetime | |
| import numpy as np | |
| import pandas as pd | |
| targets = ['big bathroom', 'kitchen', 'floor', 'small bathroom'] | |
| cleaners = ['larry1', 'larry2', 'larry3', 'larry4', 'larry5'] | |
| nbr_weeks = 11 |
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 torch import nn | |
| from torch.distributions import Laplace | |
| from torch.utils.data import Dataset, DataLoader | |
| import torch | |
| class ToyNet1(nn.Module): | |
| def __init__(self): | |
| super().__init__() | |
| self.dens1 = nn.Linear(in_features=16, out_features=8) |
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 torch | |
| import torch.distributed as dist | |
| import torch.multiprocessing as mp | |
| from torch import nn | |
| from torch.distributions import Laplace | |
| from torch.nn.parallel import DistributedDataParallel as DDP | |
| from torch.utils.data import Dataset, DataLoader |
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
| #!/usr/bin/env python3 | |
| import argparse | |
| import subprocess | |
| import time | |
| import requests | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument('command', type=str, help='command to be exectued') |
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 tempfile | |
| with tempfile.TemporaryDirectory() as tmpdirname: | |
| with open('some_file.txt', mode='w') as f: | |
| f.write('Hi, and goodbye.') | |
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
| def get_str_experiment(prefix: str = '') -> str: | |
| from datetime import datetime | |
| dateTimeObj = datetime.now() | |
| dateStr = dateTimeObj.strftime("%Y_%m_%d_%H_%M_%S_%f") | |
| if prefix: | |
| return prefix + '_' + dateStr | |
| else: | |
| return 'exp' + '_' + dateStr |
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 logging | |
| import pathlib | |
| import datetime | |
| import multiprocessing, threading | |
| import warnings | |
| # filter out warnings with : | |
| # warnings.filterwarnings("ignore", message="numpy.ufunc size changed") |
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
| smart-live-rebuild |
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 subprocess_tee import run | |
| output = run('python script1.py', shell=True) | |
| print(output) |
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
| # HK, 01.01.21 | |
| import argparse | |
| import os | |
| from pathlib import Path | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument('--dir_path', type=str, help='directory which file permissions will be changed') | |
| parser.add_argument('--ref_path', type=str, help='directory of which file permissions will be taken as reference') | |
| flags = parser.parse_args() | |
| dir_path = Path(flags.dir_path) |
OlderNewer