I hereby claim:
- I am harryscholes on github.
- I am harryscholes (https://keybase.io/harryscholes) on keybase.
- I have a public key ASB46XcHPdiNgGh6EaQhhLHvrpQGAMwzN0FLjDAHulJ65wo
To claim this, I am signing this object:
def attr_printer(cls, indentation=0): | |
for attr_name in getattr(cls, "__dict__"): | |
attr = getattr(cls, attr_name) | |
print(" " * indentation, attr_name, "=", attr) | |
if hasattr(attr, "__dict__"): # recursion | |
indentation+=1 | |
attr_printer(attr, indentation) |
import jsonpickle # pip install jsonpickle | |
import json | |
def pprint_obj(obj, max_depth=None): | |
"""Pretty print all attributes of an object recursively. | |
Arguments: | |
obj (object): object whose attributes are to be printed | |
max_depth (int, optional): maximum recursion depth | |
""" |
pip install hide_code | |
jupyter nbextension install --py hide_code | |
jupyter nbextension enable --py hide_code | |
jupyter serverextension enable --py hide_code |
import requests, secrets | |
url = "https://raw.githubusercontent.com/first20hours/google-10000-english/master/google-10000-english.txt" | |
words = requests.get(url).text.split("\n") | |
def generate_password(length=4, | |
min_word_length=4, | |
max_word_length=8, | |
as_string=False): |
I hereby claim:
To claim this, I am signing this object:
# First time | |
docker run -p 5000:8888 --name tensorflow-udacity -it gcr.io/tensorflow/udacity-assignments:1.0.0 | |
# Subsequently | |
docker start -ai tensorflow-udacity |
########### | |
## Shell ## | |
########### | |
qrsh -verbose -l tmem=1G,gpu=1 -P gpu | |
echo $CUDA_VISIBLE_DEVICES | |
source /share/apps/examples/tensorflow-1.4.0.sh |
from contextlib import contextmanager | |
import matplotlib.pyplot as plt | |
@contextmanager | |
def easyplot(filename, nrows=1, ncols=1, figsize=(6, 6), *, | |
x="", y="", tight_layout=True, savefig=True, **kw): | |
fig, ax = plt.subplots(nrows, ncols, figsize=figsize, **kw) |
module OffsetArrays | |
export OffsetArray | |
importall Base | |
immutable OffsetArray{T,N,A<:AbstractArray} <: AbstractArray{T,N} | |
array::A | |
offset::NTuple{N,Int} | |
end |