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 functools | |
import time | |
import ray | |
ray.init() | |
def as_completed(object_refs, num_returns=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
from IPython.display import Markdown, display | |
colors = ['#018700', '#00acc6', '#e6a500'] | |
display(Markdown('<br>'.join( | |
f'<span style="font-family: monospace">{color} <span style="color: {color}">████████</span></span>' | |
for color in colors | |
))) |
zsh
is a more useful shell than bash
, in my opinion, so we'll change your default shell from bash
to zsh
.
Follow instructions here: https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH#macos
Note: zsh uses the ~/.zshrc
file instead of ~/.bash_profile
, so you should move anything that you need in your ~.bash_profile
to the ~.zshrc
.
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
# Auto activate conda environments | |
# - If an `environment.yml` or `.venv` file is in the current directory, | |
# the environment specified by that file is activated | |
# - `environment.yml` files are parsed | |
# - `.venv` files must contain just the name of the environment | |
# - If no such files are present and no environment is already activated, then | |
# we try to activate an environment with the same name as the current directory | |
# - Assumes that the conda installation is at $HOME/miniconda3 | |
# Modified from: | |
# https://github.com/chdoig/conda-auto-env |
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
# -*- coding: utf-8 -*- | |
# state_pairs_to_tpm.py | |
import numpy as np | |
import pandas as pd | |
def state_pairs_to_tpm(previous_states, next_states): | |
"""Return a TPM from observed state transitions. |
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 | |
# https://gist.githubusercontent.com/nils-werner/9d321441006b112a4b116a8387c2280c/raw/489137f314c022ca08f0c5089319ded2eb8c5ae1/sliding_window.py | |
def sliding_window(size, data, step=1, padded=False, axis=-1, copy=True): | |
"""Calculate a sliding window over an array. | |
Note: | |
If the array cannot be windowed evenly, it is truncated at the end. | |
Args: | |
data (np.ndarray): The array to be windowed. |
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 json | |
import os | |
import pickle | |
import random | |
from time import time | |
import numpy as np | |
import pyphi | |
from pyphi import Network, Subsystem |
- Pressing Ctrl + Esc (or Ctrl + Caps Lock if you have Caps Lock mapped to Esc) will put a “window hint” at the center of every currently visible window.
- These will each have a unique letter in them.
- Pressing a letter will focus that window.
- Pressing Esc will cancel the window hints.
NewerOlder