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 panel as pn | |
import param | |
import ast | |
import json | |
HSPACER = pn.Spacer(height=4, background="#261342") | |
pn.extension("tabulator") | |
class EmployeeOverviewAdminRoot(param.Parameterized): | |
"""Employee Overview App for Administrators""" |
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
terraform { | |
required_providers { | |
kubernetes = { | |
source = "hashicorp/kubernetes" | |
version = "2.7.1" | |
} | |
} | |
required_version = ">= 1.0" | |
} |
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 os | |
from pathlib import Path | |
jupyter_user = os.environ['JUPYTERHUB_USER'] | |
def make_files(depth, breadth, start_folder, key, max_depth=3): | |
print(f"Make Files at depth {depth}") | |
for i in range(0,breadth): | |
with Path(start_folder, f"testfile_{key}_{depth}_{i}.txt").open("wt") as f: | |
f.write("Here is the file.") | |
if depth < max_depth: |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 requests | |
api_url = 'https://myjupyterhub.net/hub/api' | |
token = '<token from token menu of an admin user>' | |
# List all groups | |
r = requests.get(api_url + '/groups', | |
headers={ |
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 dash | |
from dash.dependencies import Input, Output | |
import dash_html_components as html | |
from datetime import datetime | |
app = dash.Dash(__name__) | |
start_time = datetime.now() | |
app.layout = html.Div(children=[ |
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 streamlit as st | |
@st.cache | |
def get_start_time(): | |
from datetime import datetime | |
return datetime.now() | |
start_time = get_start_time() | |
st.write(start_time) |
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 streamlit as st | |
from datetime import datetime | |
start_time = datetime.now() | |
st.write(start_time) | |
count = 0 | |
if st.button('Increment'): | |
count += 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
c.JupyterHub.spawner_class = 'dockerspawner.DockerSpawner' | |
c.DockerSpawner.image = 'ideonate/jh-voila-oauth-singleuser:latest' | |
from jupyter_client.localinterfaces import public_ips | |
c.JupyterHub.hub_ip = public_ips()[0] | |
c.DockerSpawner.name_template = "{prefix}-{username}-{servername}" |
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
CSV_COLUMNS = ['p{}'.format(i) for i in range(30)] + ['Image'] | |
CSV_COLUMN_DEFAULTS = [[0.0]]*30 + [['']] | |
def parse_csv(rows_string_tensor): | |
columns = tf.decode_csv(rows_string_tensor, record_defaults=CSV_COLUMN_DEFAULTS) | |
raw_features = dict(zip(CSV_COLUMNS, columns)) | |
image_str_array_sparse = tf.string_split([raw_features['Image']]) | |
image_str_array = tf.sparse_to_dense(image_str_array_sparse.indices, image_str_array_sparse.dense_shape, image_str_array_sparse.values, '') | |
image_str_array = image_str_array[0] |
NewerOlder