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
class Path: | |
_offset_to_distance: dict[tuple[int, int], float] = { | |
(0, 0): 0, | |
(0, 1): 1, | |
(0, -1): 1, | |
(1, 0): 1, | |
(1, 1): 2 ** 0.5, | |
(1, -1): 2 ** 0.5, | |
(-1, 0): 1, | |
(-1, 1): 2 ** 0.5, |
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
def getCtAugmentedNodule(augmentation_dict, series_uid, center_xyz, width_mm, voxels_int, maxWidth_mm=32.0, use_cache=True): | |
assert width_mm <= maxWidth_mm | |
if use_cache: | |
cubic_chunk, center_irc = getCtCubicChunk(series_uid, center_xyz, maxWidth_mm) | |
else: | |
ct = getCt(series_uid) | |
ct_chunk, center_irc = ct.getCubicInputChunk(center_xyz, maxWidth_mm) | |
slice_list = [] |
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 math | |
import random | |
import numpy as np | |
import scipy.ndimage | |
import torch | |
import pytest |
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 math | |
import random | |
import warnings | |
import numpy as np | |
import scipy.ndimage | |
import torch | |
from torch.autograd import Function | |
from torch.autograd.function import once_differentiable |
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 __future__ import print_function | |
import torch | |
from torch.nn.parallel.data_parallel import DataParallel | |
from torchvision.models import resnet18 | |
from torch.autograd import Variable | |
model_list = [DataParallel(resnet18(), output_device=(i % torch.cuda.device_count())).cuda() for i in range(20)] |
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 itertools | |
def attack(n, rerolls=0, focus=False, r='', p=1.0): | |
s = 'CHHHffxx' | |
focus = 'h' if focus else None | |
result_dict = dice(s, n, r, p) | |
result_dict = reroll(result_dict, s, rerolls, focus) | |
#print 'attack', n, rerolls, focus, repr(r), p, result_dict | |
result_dict = usefocus(result_dict, focus) |
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
--==538e7a179d2544ed8eddbce0d3c5eba3== | |
Content-Disposition: form-data; name="_doc" | |
Content-Length: 297 | |
Content-MD5: p16qTKDlTHqJ3YTeGy8s3w== | |
Content-Type: application/json | |
{"int": "couchable:pickle:self.int", "couchable:": {"src_md5": "40ab314f74581b4d1ee79790703715c2", "class": "Simple", "module": "couchable.testing.test_couchable"}, "_id": "couchable.testing.test_couchable.Simple:45dc8c54-8743-11e0-85af-c42c033c1b93", "_rev": "1-f3d8e3363e3cb4ead433e3cbf855adb9"} | |
--==538e7a179d2544ed8eddbce0d3c5eba3== | |
Content-Disposition: form-data; name="attachments"; filename="pickles" | |
Content-Length: 54 |