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
def _setup_logger(debug=False): | |
logger = logging.getLogger(__name__) | |
level = logging.DEBUG if debug else logging.ERROR | |
logger.setLevel(level) | |
sh = logging.StreamHandler(sys.stdout) | |
sh.setFormatter(logging.Formatter(logging.BASIC_FORMAT)) | |
logger.addHandler(sh) |
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
<!DOCTYPE html> | |
<html> | |
<head><meta charset="utf-8" /> | |
<title>SVGBug</title><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> | |
<style type="text/css"> | |
/*! | |
* | |
* Twitter Bootstrap |
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
[0] MPI startup(): Intel(R) MPI Library, Version 2017 Update 3 Build 20170405 (id: 17193) | |
[0] MPI startup(): Copyright (C) 2003-2017 Intel Corporation. All rights reserved. | |
[0] MPI startup(): Multi-threaded optimized library | |
[0] DAPL startup(): trying to open DAPL provider from I_MPI_DAPL_PROVIDER: ofa-v2-ib0 | |
[2] DAPL startup(): trying to open DAPL provider from I_MPI_DAPL_PROVIDER: ofa-v2-ib0 | |
[3] DAPL startup(): trying to open DAPL provider from I_MPI_DAPL_PROVIDER: ofa-v2-ib0 | |
[1] DAPL startup(): trying to open DAPL provider from I_MPI_DAPL_PROVIDER: ofa-v2-ib0 | |
[4] DAPL startup(): trying to open DAPL provider from I_MPI_DAPL_PROVIDER: ofa-v2-ib0 | |
[5] DAPL startup(): trying to open DAPL provider from I_MPI_DAPL_PROVIDER: ofa-v2-ib0 | |
[6] DAPL startup(): trying to open DAPL provider from I_MPI_DAPL_PROVIDER: ofa-v2-ib0 |
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://blogs.msdn.microsoft.com/wsl/2017/04/18/file-system-improvements-to-the-windows-subsystem-for-linux/ | |
sudo mkdir /mnt/d | |
sudo mount -t drvfs D: /mnt/d |
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
#!/usr/bin/env bash | |
# Opens the usual ports | |
name=msvm | |
resource_group=msvmrg | |
az vm open-port -g $resource_group -n $name --port 9999 --priority 1010 # Jupyter | |
az vm open-port -g $resource_group -n $name --port 6006 --priority 1050 # Tensorboard | |
az vm open-port -g $resource_group -n $name --port 3000 --priority 1060 # Grafana |
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
#!/usr/bin/env bash | |
# Resizes os disk of existing vm | |
# Example | |
# resize_os_disk myVM myResourceGroup | |
name=$1 # myVM | |
resource_group=$2 # myResourceGroup | |
# Stop VM | |
az vm deallocate --resource-group $resource_group --name $name |
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
#!/usr/bin/env bash | |
# Deletes resource group, useful for deleting VMs etc. | |
# arguments: | |
# resource_group_name | |
az group delete --name $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
#!/usr/bin/env bash | |
# Install with sudo | |
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg | |
mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg | |
sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main" > /etc/apt/sources.list.d/dotnetdev.list' | |
apt-get update -y | |
apt-get install -y dotnet-sdk-2.0.2 | |
wget -O azcopy.tar.gz https://aka.ms/downloadazcopyprlinux |
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
#!/usr/bin/env bash | |
# Sample script to create Ubuntu DSVM | |
# We specify a large os disk because by default it is 50GB which is often insufficient | |
location=eastus | |
resource_group=msvmrg | |
name=msvm | |
az group create --location $location --name $resource_group |
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
def _generate_start_and_end(num_elements, sequence_length): | |
start_gen = chain(repeat(0, times=sequence_length), | |
range(1, num_elements)) | |
end_gen = chain(range(1, sequence_length), | |
range(sequence_length, num_elements)) | |
for start, stop in zip_longest(start_gen, end_gen, fillvalue=num_elements): | |
yield start, stop | |
def generate_variable_window(timeseries_array, sequence_length): |