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 | |
| # encoding: utf8 | |
| # filename: gensitemap.py | |
| """Simple script to generate sitemap for a specified domain. It traverse all | |
| HTML files from a given root directory and build URLs. | |
| """ | |
| import logging | |
| import xml.etree.ElementTree as etree |
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 | |
| # encoding: utf8 | |
| # filename: fix-nbcounter.py | |
| """This simple script load Jupyter notebook and fix execution counter. | |
| """ | |
| from json import load, dump | |
| from sys import argv | |
| with open(argv[1]) as fin: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 bash | |
| # download.sh | |
| declare -a archives=( | |
| "https://data-static.usercontent.dev/DataClusteringSample0107.tar.gz" | |
| "https://data-static.usercontent.dev/DataClusteringSample0817.tar.gz" | |
| "https://data-static.usercontent.dev/DataClusteringSample1821.tar.gz" | |
| ) | |
| for archive in ${archives[@]}; do |
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
| # Maintainer: Daniel Bershatsky <[email protected]> | |
| pkgname=apache-arrow | |
| pkgver=0.17.1 | |
| pkgrel=1 | |
| pkgdesc="Language-independent columnar memory format for flat and hierarchical data" | |
| arch=('x86_64') | |
| url='https://arrow.apache.org/' | |
| license=('Apache') | |
| depends=('boost-libs' 'jemalloc') |
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 typing import Tuple | |
| def unzip_dataset(dataset) -> Tuple[tf.data.Dataset, ...]: | |
| """Function unzip_dataset takes a single dataset which element spec is a | |
| tuple and returns multiple datasets by number of tuple size of element spec. | |
| :param dataset: Input dataset. | |
| :return: Output tuple of datasets. | |
| """ |
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 | |
| """This script demonstrates event multiplexing on process identifiers (PIDs). | |
| More specifically, we issue file descriptor (FD) from PID and. Then we wait | |
| events on the descriptor. Note that polling such events is feasible because of | |
| obtaining FD from PID with pidfd_open() system call. This feature was | |
| introduced in 5.3 (Sep 2019). A usage example is below. | |
| $ ./wait4pid.py 1337 & | |
| $ kill -9 1337 | |
| process with pid 1337 exited |
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 jax | |
| def collect(threshold=256 * 1024 ** 2): | |
| backend = jax.lib.xla_bridge.get_backend() | |
| freed = 0 | |
| for buf in backend.live_buffers(): | |
| if buf.nbytes >= threshold: | |
| buf += buf.nbytes | |
| buf.delete() |
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 torch as T | |
| model = T.nn.Sequential() | |
| model.add_module('W0', T.nn.Linear(128, 10)) | |
| model.add_module('tanh', T.nn.Tanh()) | |
| model.add_module('W1', T.nn.Linear(10, 5)) | |
| model.add_module('tanh', T.nn.Tanh()) | |
| model.add_module('W2', T.nn.Linear(5, 1)) | |
| input = T.randn(16, 128) |
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/evn python3 | |
| # Run this script and then the command below. | |
| # | |
| # dot -Tpng -ograph.png graph.dot | |
| # | |
| import torch as T | |
| from torchviz import make_dot | |
| model = T.nn.Sequential( |