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
from itertools import chain, tee | |
def walk(drive, root_dir, maxResults=10): | |
dirs = iter([(root_dir["title"], root_dir)]) | |
while True: | |
try: | |
cur_path, cur_dir = next(dirs) | |
except StopIteration: | |
break |
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 dask.array as da | |
import zarr | |
fn = "<some filename>" | |
fh = zarr.open_group(fn + ".zarr") | |
dict_ = da.from_array(fh["dict"], chunks=fh["dict"].chunks) | |
dict_min = dict_.min() |
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 pickle5 import Pickler, load, PickleBuffer | |
import copyreg | |
import os | |
import numpy as np | |
import time | |
import gc | |
import io | |
from multiprocessing import get_context | |
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
cimport libc | |
cimport libc.math | |
from libc.math cimport isfinite as _isfinite, isinf as _isinf | |
cimport cython | |
cimport numpy | |
import numpy | |
numpy.import_array() |
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 ctypes | |
import mmap | |
import os | |
import stat | |
import sys | |
try: | |
unicode | |
except NameError: |
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
# | |
# Based on multiprocessing.sharedctypes.RawArray | |
# | |
# Uses posix_ipc (http://semanchuk.com/philip/posix_ipc/) to allow shared ctypes arrays | |
# among unrelated processors | |
# | |
# Usage Notes: | |
# * The first two args (typecode_or_type and size_or_initializer) should work the same as with RawArray. | |
# * The shared array is accessible by any process, as long as tag matches. | |
# * The shared memory segment is unlinked when the origin array (that returned |
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 ctypes | |
import dask.array | |
import dask.array.image | |
import dask.array as da | |
import numpy as np | |
import os | |
import pathlib | |
import skimage.io | |
import subprocess | |
import sys |
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
# Export LSF variables, if available. | |
# May not be available when using Linux locally or Windows with Git Bash. | |
if [[ -f /misc/lsf/conf/profile.lsf ]]; then | |
# Needed to activate LSF and specify DRMAA's location. | |
source /misc/lsf/conf/profile.lsf | |
export LSF_DRMAA_LIBRARY_PATH=/misc/sc/lsf-glibc2.3/lib/libdrmaa.so.0.1.1 | |
export DRMAA_LIBRARY_PATH=$LSF_DRMAA_LIBRARY_PATH | |
# Other nice options with LSF, but not required. | |
export LSB_STDOUT_DIRECT='Y' | |
export LSB_JOB_REPORT_MAIL='N' |