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 python | |
import re | |
import subprocess as sp | |
from operator import itemgetter | |
import docker | |
def map_gpu_ids(): |
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
"""\ | |
Find dependent images for a given Docker image ID. | |
""" | |
import argparse | |
import docker | |
def find_img(img_idx, id): | |
try: |
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 functools import wraps | |
def admin_only(*fargs): | |
def _admin_only(func): | |
@wraps(func) | |
def _check_admin(*args, **kwargs): | |
self = args[0] | |
if not self.user.isAdmin: | |
raise RuntimeError("ERROR: admin only") |
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 java.util.UUID; | |
import java.io.PrintWriter; | |
import loci.formats.ImageReader; | |
import loci.formats.FormatTools; | |
import loci.formats.ome.OMEXMLMetadata; | |
import loci.formats.services.OMEXMLService; | |
import loci.common.Constants; | |
import loci.common.Location; | |
import loci.common.xml.XMLTools; |
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 https://github.com/CellMigStandOrg/CMSO-Samples/pull/10 | |
import ome_files | |
import ome_files.metadata as ofmd | |
reader = ome_files.OMETIFFReader() | |
reader.set_id("links/ome_links_1/multifile.companion.ome") | |
meta = ofmd.OMEXMLMetadata(reader.get_ome_xml()) | |
reader.close() |
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
#!/bin/bash | |
set -eu | |
shopt -s nullglob | |
AVRO_PARENTDIR=/uod/idr/homes/szleo/features/idr0012-fuchs-cellmorph/screenA/input | |
IDR_WRITEABLE=/home/idr-scratch/szleo | |
RUNAS_USER=13500 | |
ADD_TASK="../venv/bin/python tasks.py" | |
TASKID_LOG=taskid-calc.log |
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-scratch MetaMorph Stack (STK) reader. | |
Currently just a quick hack. Dumps the TIFF tags to stdout and each | |
plane to its own single-image TIFF file. | |
""" | |
import sys | |
import struct | |
from contextlib import closing |
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 | |
PAGESIZE = os.sysconf("SC_PAGE_SIZE") # BYTES | |
STATM_FIELDS = ["size", "resident", "share", "text", "lib", "data", "dt"] | |
def meminfo(pid=None): | |
if pid is None: | |
pid = os.getpid() | |
pid = str(pid) |