sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
dcfa385012de3b70c51129d26ce3cf26cafcd468f0329d159e1d6dc5a952c5fb
Python
4,185
149
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
9abb03c5616dfa126cd355087d314a5ddc8db099d8a01e1a9572ebdf20a30a82
Python
4,199
120
#!/usr/bin/python3 import collections, os import pandas as pd import numpy as np import sys sys.path.append("..") import utilities def compute_gen_obs(stats, framework, domains, dom2docs, archetypes, docs, pmids, metric="dice", clf="_lr", path=""): from scipy.spatial.distance import cdist print("\t Compu...
48e06507c674b7166c3b699b159fe06ecc142c96cf49989d5e470d749fd00d18
Python
4,203
141
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
ebcecd4392b5fe5d349535e894085f76a9dd165227f3a2243de1817ef2fef365
Python
4,204
96
import torch.nn as nn import dgl from nets.gru import GRU from models.dgl.pna_layer import PNALayer from nets.mlp_readout_layer import MLPReadout """ PNA: Principal Neighbourhood Aggregation Gabriele Corso, Luca Cavalleri, Dominique Beaini, Pietro Lio, Petar Velickovic https://arxiv.org/abs/2004.05718 ...
adc169d5d12a22b7ba86ad2879e2c593b749812bcbc1f2017588a323fc3a2452
Python
4,207
136
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
ecad4079d627b02bc83a8e3727c78590b4aa5f3b8edb0d875458bb806715e947
Python
4,208
134
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
149e87e45b8565fbb7042635132135d4377dce10d905898c8dcd1cdb9dd2f932
Python
4,212
123
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
d4c7f83c7ef339035c3400e1ffce4292bb87dc996c57c63bc6b7a0e8b87d8225
Python
4,217
128
import os import torch import torch.nn as nn import onmt.inputters from collections import deque from onmt.utils.logging import logger def build_model_saver(model_opt, opt, model, fields, optim): model_saver = ModelSaver(opt.save_model, model, model_opt,...
dac395e16a751b3914d9da6576302bd5348fb45ab843e26d8b5d598841f1fb0c
Python
4,226
122
""" After training IM model on ion intensity model pre-trained weights Predict IM with trained model """ _SEED = 0 Constants = { 'WorkSpace': './IMWorkSpace', 'PredData': './IMWorkSpace/Data-IM_Holdout.txt', # 'ModPepCol': 'sequence', 'ModPepCol': 'IntPep', # 'PrecChargeCol': 'charge', 'PrecCh...
4ca07c291e19ae8a1b9576b6a0dc1fcd0a8bfaaeaa81755d75d010a997748f2e
Python
4,243
106
import torch import numpy as np class ChemVocabMask(object): """ Chemical reaction token mask. Can either be initialized from a saved state or using a vocab file. Used to hide tokens that do not appear in the source sequence. """ def __init__(self, vocab=None, from_file=None): if from_file...
bde92fa7b5bc7ceb387e6543376ec849cfab80ddddfc9dd7d97e8a7b5784e7f4
Python
4,243
124
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
cc9f706a50f329dcc9a7343c05ac99cae05540ab717e7241c99cd46f84375063
Python
4,244
142
import operator import numpy as np import pandas as pd from margrie_libs.stats.stats import wilcoxon def abs_eq(a, b): return abs(a) == b class DatabaseIo(object): def __init__(self, db_path): self.db = pd.read_csv(db_path) @staticmethod def filter_by_idx(db, key, idx_list)...
e0bb72ce1fa17f371a3ef6eab4ac1cab6ea2272271fdf762e34981c85f2a1ddf
Python
4,278
124
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
a5e864f582bc85036ddd7b4aa86b42a4e3d8ae80a6882144c733c522393e58ed
Python
4,290
136
# -*- coding: utf-8 -*- """ Created on Thu Jun 3 17:28:44 2021 @author: yuyi6 """ import pandas as pd import numpy as np import collections from rdkit import Chem from rdkit.Chem.SaltRemover import SaltRemover from cddd.inference import InferenceModel from sklearn.model_selection import StratifiedKFold, KFold def d...
eba6ca33090b8a0994071f8831dbf451f9755ae251e9303ef88a08bf30ebdf73
Python
4,297
131
import pickle import numpy as np import pytest import cellfinder.core.tools.tools as tools from cellfinder.core.detect.filters.setup_filters import DetectionSettings @pytest.mark.parametrize( "in_dtype,filter_dtype", [ (np.uint8, np.float32), (np.uint16, np.float32), (np.uint32, np.f...
f1cf133eb7b418ae60922c2edb1515418ffd3cd651cd095b918a264abd613810
Python
4,309
156
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
0c0651cfa72fbe6d423bf05a7ddb633ea83ae7a61ab81b7c29f028878c7221fd
Python
4,311
127
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
fe15581a80c63f692e0dc1c010de2e8902a3a4ada2a27d39e103a4277afc7cad
Python
4,315
117
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
93674249d80277367a12d8b93e5d4cb2801612ab5e21d092c3bae5ab9c898dca
Python
4,324
140
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
dc5cb3ca832c88e23bff78ae994fe7c6249e73405f3ecdd714752e0a6ec83c83
Python
4,337
126
import torch import torch.nn as nn from .nnutils import create_var, index_select_ND class JTNNEncoder(nn.Module): def __init__(self, hidden_size, depth, embedding): super(JTNNEncoder, self).__init__() self.hidden_size = hidden_size self.depth = depth self.embedding = embedding ...
ea24b3505726dc7930c5e7edd830497fc6844b8dce7e246b8097c43668b27b7a
Python
4,346
119
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
7542b465dd9054be4eda9bb13da675745576711a92aa0ed7bfa539ca796e14b4
Python
4,356
144
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
11f667e79a05aa79f1225911e65294dc04dfb936bed70943cce7b005d5be4ca9
Python
4,359
97
import numpy as np import matplotlib.pyplot as plt import h5py as h5 from importlib import reload import sys direc = sys.argv[0].split('scripts')[0] where = sys.argv[1] sys.path.append(direc+'support') import parameters reload(parameters) import parameters as par import functions reload(functions) import functions as f...
c23ba516badb59b89b80d1dc0e4f32fb0995780ae922389b030c7a18280433b0
Python
4,360
132
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
c75c87b3cf42774610640c8a0e18cb3fc1793407f348efdc138e46dd768fc0a0
Python
4,365
128
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
cb6519d8014893a2981f715ce0adf2e2bfa9af9e034fb05a7242aca32ad58840
Python
4,368
128
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
c4e263b32cb54893d9e73b39d1746484f928126a1e5f5ad259d106b810435eaa
Python
4,375
144
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
bdc104376c5eb97c285deb57c45143b8a5c73ddfbd89f3cd53a80bb450b35d84
Python
4,380
102
# coding=utf-8 # Copyright 2026 The Edward2 Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
e1fa9767d60b930b184c1ec128727265e10cd2bb1174a934af13536576b659ca
Python
4,380
138
import numpy as np import pytest import torch from cellfinder.core.detect.filters.volume.ball_filter import ( BallFilter, get_kernel, ) bf_kwargs = { "plane_height": 50, "plane_width": 50, "ball_xy_size": 3, "ball_z_size": 3, "overlap_fraction": 0.5, "threshold_value": 1, "soma_cen...
0da971642130f950e9a5a8be2a936cfea1971a756867d0fb688e59a700acda20
Python
4,383
123
# coding=utf-8 # Copyright 2026 The Edward2 Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
c6c928be36e0620168862e88368a6cd223969a79385758ea1202961692874564
Python
4,391
126
#!/usr/bin/env python """ Main training workflow """ from __future__ import division import argparse import os import signal import torch import onmt.opts as opts import onmt.utils.distributed from onmt.utils.logging import logger from onmt.train_single import main as single_main def main(opt): if opt.rnn_t...
45d6116f55cb8395fc23a5bb0785afe8f6e44e8ab2dd572bf9e2db6d6b93d386
Python
4,399
121
# coding=utf-8 # Copyright 2026 The Edward2 Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
583bf166cd2f699943cc7ca02607a74b5f2e73469419911e2bae14a24162bf1c
Python
4,399
125
import os from typing import Optional, Tuple import keras from keras import Model from cellfinder.core import logger from cellfinder.core.classify.resnet import build_model, layer_type def model_input_channels(model: Model) -> int: """The number of input channels the model expects.""" return tuple(model.inp...
4ebc5947bf778da68d37d64f6c633e376f43c9c58a5f35bad4b8962e906b008a
Python
4,417
136
# coding=utf-8 # Copyright 2026 The Edward2 Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
8c031c198f76be277220ffd4816b8fa6b610ee7ad2f62ae10689556a35eb566c
Python
4,417
106
import numpy as np import torch import os import pickle as pkl import sys import re import scipy.io from Bio import SeqIO from Bio.PDB.DSSP import DSSP from Bio.PDB import PDBParser from prospr.nn import INPUT_DIM, CROP_SIZE def seq_to_mat(seq): """Convert a sequence into Nx21 matrix for input vector""" aa_or...
e11836c0897f52c6185c421afa46a52493f1488521d8a7c53e2e6cdb25bb0cdd
Python
4,418
184
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
aba367fc9a47c49a86e1c9f19a8fbfbc2c2ef7168854dab3c43303e5eb33d854
Python
4,426
134
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
f7d5658bae75b1202f65a9a04ee6e2effbe83c3960de72831d64b157adaf5139
Python
4,433
159
import torch import torch.nn as nn import rdkit.Chem as Chem import torch.nn.functional as F from .nnutils import * from .chemutils import get_mol ELEM_LIST = [ "C", "N", "O", "S", "F", "Si", "P", "Cl", "Br", "Mg", "Na", "Ca", "Fe", "Al", "I", "B", "K...
1a13a5dd5a53478ad48f0fbc6669b500fa4e80cb8bbec7727fd9c486d919e626
Python
4,435
135
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
9b8d333979eff8895f291b2254d5b63993fb1dc38fe130a18846314eb673681d
Python
4,455
156
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
0215c272963943029964215e1423dcc115556167c4ae3068afcd1dc6b799d812
Python
4,456
151
import numpy as np import logging from imlib.radial.misc import phase_unwrap from imlib.array.math import calculate_gradient_1d from movement.io.dlc import load_and_clean_dlc from movement.position.angles import angle_from_points from movement.movement.velocity import calculate_speed from opendirection.combine.calcul...
2233ec68a03ec38f741d11a19a162aa8c356714cd4e76ba93ddb9618dd0f6297
Python
4,460
129
import sys, os import shutil from calcium_recordings.recording import Recording from margrie_libs.utils.folder_operations import folders_starting_with exampleOriginalPath = "\(20160108_18_57_12\)__spont_100x100ym_256x256pxl/\(20160108_18_57_12\)__spont_100x100ym_256x256pxl.raw" def extract_folder_base_na...
68f05ea9a434d9ca63a7869d6ff68018c26178ed55175d667a41eb1ce7862cb9
Python
4,473
126
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
1b935a2bb1d91ab4b1f82ea45696067f5b8f291cdddb44f57342bb9416452472
Python
4,474
98
''' This script is an optional part of the GROBID docker image build, to pre-load selected embeddings in the image. The script is supposed to be copied under the delft installation in the docker image, then executed either with just an embedding name (e.g. "glove-840B") for online download of the embedding file or wi...
c88acbf325dac65e33caa68b27c53098614f03b1d3368a224ac9cf92193fc459
Python
4,474
119
import cv2 import numpy as np import time import threading import hamamatsu_camera as hc from Queue import Queue import pyqtgraph as pg #TRY TO REPLACE THREADING WITH PROCESS: http://stackoverflow.com/questions/323972/is-there-any-way-to-kill-a-thread-in-python class Preview(threading.Thread): def __init__(self,...
e5567c497079caf4b3be6ae1ed401761fce347513a10c4ba71eefd6872fd2ef4
Python
4,474
176
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
a53ed4e6906eb0eb0721d1b7c80eb06d2d79906930cc72b508669ebc6c146fcb
Python
4,487
166
def element_aa2res(aa_comp: dict) -> dict: res_comp = aa_comp.copy() res_comp['H'] -= 2 res_comp['O'] -= 1 return res_comp class AAComp: AAElement = { 'A': {'C': 3, 'N': 1, 'O': 2, 'H': 7}, } class ResComp: ResElement = {aa: element_aa2res(aa_comp=aa_comp) for aa, aa_comp in AACo...
a12c152bca4182968406ffd7ee3693a51d4ff55f5b2a289eb94cff0c6728b449
Python
4,493
136
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
03cb5164a193dd8c3872a10454f2812d2790f5a3805632bb7b786b3ecc8b3fed
Python
4,494
100
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division, unicode_literals import argparse from graph_embedding import init_condition_transformer from onmt.utils.logging import init_logger from onmt.translate.translator import build_translator import onmt.inputters import onmt.translate import o...
16f1a8eba2b4e25dd7400a6e90e7a4eca4608c6a618a429d31dddacd6f5137f7
Python
4,494
158
#!/usr/bin/env python from __future__ import print_function import os import shutil import subprocess import platform from distutils.command.build import build from setuptools.command.build_ext import build_ext from setuptools import Extension, find_packages, setup class build_ext_subclass(build_ext): def finali...
d003d5191e7206571f91eb7ffb7ebbf20b0b2b047832eb25f3cbba9a093cd8fc
Python
4,495
124
import math import numpy as np import time import random import csv from IK import * NUMBER_OF_SAMPLES = 200 DATA_FILE = 'end_effector_test-'+str(NUMBER_OF_SAMPLES)+'.csv' ARM_OPERATIONAL_END_EFFECTOR_ANGLE_DEGREES_RANGE = 360 ############################################################################# #...
84abc26a144662a1a38407b73b550afd42d826c6e8f2317bd9b461b29af3eb54
Python
4,500
160
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
67e6f6b738caf51bcfbeb34f08d5c18016a8d0e35b88180c16d61a4f0493c5f4
Python
4,510
141
import numpy as np import matplotlib.pyplot as plt import matplotlib import h5py as h5 from importlib import reload import sys direc = sys.argv[0].split('scripts')[0] where = sys.argv[1] sys.path.append(direc+'support') import parameters reload(parameters) import parameters as par import functions reload(functions) imp...
cc8426146e7ad679facda2687ed0787fccca829c2c49762bb57a0bc0b3ba1395
Python
4,510
187
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
5f8ea86e105571547252c2f54819b2596aecc2d370738196d170bd228ad6ec6c
Python
4,511
160
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
76c978a9565a937a8703965744e3311178bdd218470a49608c9f0aeb8d8e7e15
Python
4,517
187
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
ef2875f23dc3f4e3e46e421a6f963f466d8a1720903d783b7bdbf50cea2681ff
Python
4,519
127
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
7d2791c80c64cf8fad3c799dc9fee85f068d916d5588f34976c6412c2b42a704
Python
4,526
156
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
e01f5e9485c4b45e6e83e4fc3b2fccaee46cdef0b1663b6822956980acaafe79
Python
4,531
171
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
503d0ca1cca60f871733a7fa77199205523e9f95bc1d6030d1f496a88264a612
Python
4,535
117
from skimage import filters import numpy as np from multiprocessing import Pool import pims import cv2 def createDiffLine(video, cropx1, cropx2, cropy1, cropy2): """ Binarizes video and returns a frame to frame difference trace. Inputs: video - pims object cropx1 - int, crop pixel starting for firs...
6fa3804f68c0310c9e1648fdeff5a34a02c1a9c85c313216232546dcf138407a
Python
4,547
111
import numpy as np import tensorflow.keras as tfk from tensorflow.python.keras.layers.core import Dropout def model( length: int, n_filters_1=8, n_filters_2=16, n_filters_3=8, filter_shape_1=64, filter_shape_2=8, filter_shape_3=(8, 4), dropout_1=0.2, dropout_2=0.3, continuous=T...
b25aebf06d348fa2415ac7d5db3b703264a7041891cc9d789c7f12c9c9d025ec
Python
4,549
155
import rdkit import rdkit.Chem as Chem import copy from .chemutils import ( get_clique_mol, tree_decomp, get_mol, get_smiles, set_atommap, enum_assemble, decode_stereo, ) def get_slots(smiles): mol = Chem.MolFromSmiles(smiles) return [ (atom.GetSymbol(), atom.GetFormalCharg...
39002ec3e6111d63d32af728bb67c28314c61cfb399e326ca5d875e062f6df50
Python
4,553
109
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
13343df370adf0098023b7ee0030ca7345cb009f35d5dcedcf59c5b80b84534d
Python
4,569
157
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
1bdac118806eea7a4429e1cfee4644e37b370478df7912630746c2b0d32eb72f
Python
4,577
122
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
ee4ce096e72fdc15dee444f1fc10c96a3fdad0e94060968192b6190b4b2c117c
Python
4,582
152
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
ec4f75b0ae9eeb39c4383422df78f3d2cec0747e562ee83721ee813b15cce439
Python
4,586
159
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
1179801d36c5b24392046083707ccdb3db334f54a5c6b04afe4fcac04d22218a
Python
4,591
133
from importlib import reload import numpy as np import matplotlib import matplotlib.pyplot as plt import matplotlib.colors as colors import matplotlib.cm as cmx import h5py as h5 import sys direc = sys.argv[0].split('scripts')[0] where = sys.argv[1] sys.path.append(direc+'support') import parameters reload(parameters...
4f25ad2f609456f46407609ba89c43425396822b973c43d7b4ac0c3dbf8c4cf4
Python
4,591
145
from os import listdir from os.path import isfile, join import natsort from brainglobe_utils.cells.cells import Cell, UntypedCell class TiffList: """ Represents a list of tiff files output from the cell extractor plugin and used for training and classification. Represents tiff files whose names end ...
419658dbd7a4a165bad06317ce9aaa155185db3676c2f0936e71225e1216fe78
Python
4,595
166
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
2d5241e097bf84d7ae8fa0fa898caafcf99be06a83c95e8d37caf83f4b9c7e7f
Python
4,596
131
import pandas as pd import logging from functools import reduce class ConditionError(Exception): pass def condition_select( df, all_conditions, chosen_condition, column="condition", stability=None ): """ Takes a dataframe, and returns rows based on the conditions in the given 'column'. If a spec...
1d025d2c313dac635be362328f4f465d9a953e5e6049e5dd8677ef8410e18a4a
Python
4,608
157
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
8fdd87359883c6b599bb6a41416b94b5e8f8e046fcae6e1ccd20036c7bff86ba
Python
4,613
117
from ANNarchy import * setup(dt=1.0,seed=101) import matplotlib as mp mp.use('Agg') import numpy as np import os from net import * import scipy.io as sio # Split the natural scenes into single overlapping patches to reconstruct the scenes after wards # R. Larisch, Technische Universitaet Chemnitz # 2020-04-27 #------...
2950c82481884f1de6ee7ec6ca7d999277cc8ae0186c4735e41c3199e84f2173
Python
4,622
153
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
5c8b4459092bebc2e0ea6303dcf2e199cff853bc2710cf40861ec0f077e15368
Python
4,623
157
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
e5fc1c6bdf2b9131169235c9b25050eab42e32ee5d949bc7a6aa4e716ae726c4
Python
4,628
145
#!/usr/bin/python # -*- coding: utf-8 -*- """ UpdateFunction.py: Updates the nodes using the previous state and the message....
b2be7814a90396d075a26bbce97ce5a912f0cacf8b7bd4a758ab4ff6e8bc65f3
Python
4,637
142
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
9c882265ba8d5d17a1e96648088a66caa01e3df73dacb87f056626c103aa9470
Python
4,643
145
import distutils.cmd import sys from pathlib import Path from textwrap import dedent from setuptools import setup ROOT = Path(__file__).parent # Note: In GluonTS we use git tags to manage versions. A new release is created # by creating a new tag on GitHub through their release mechanism. Thus, # `gluonts.__version_...
fda6f137aebbf25638012a836804e629da2bc8d34696efec5f72ae6b0d1a567b
Python
4,647
153
""" 1. This stores many different modification display methods, and all the modification will be got from here. Shorthand: Spectronaut -> SN """ class LossType(object): SN_to_Readable = { 'noloss': 'Noloss', 'H2O': '1,H2O', 'NH3': '1,NH3', 'H3PO4': '1,H3PO4', '1(+H2+O)1...
a440a91b534a459e4e48a4c1bfef2df44e03b8c9322bfadb29f3054092f7c065
Python
4,656
106
#! /usr/bin/env python __author__ = 'heroico' import metax __version__ = metax.__version__ import logging import os from timeit import default_timer as timer from metax import Logging from metax import Utilities from metax import Exceptions from metax.metaxcan import AssociationCalculation from metax.metaxcan import...
c33af46056a265cf4335947844cc03f9740383fac55cb1aebf4673f896780cce
Python
4,661
136
# coding: utf-8 # In[1]: """ create_lmdb.py This script creates databases (in LMDB format) from collections of images. There are two functions, one for creating an LMDB based on RGB-like images and one for creating an LMDB based on a dense ground truth (i.e. 2D labels) """ import numpy as np import lmdb ...
f235e2142bce85f5a88125d2c174651583d1c1d468b2598a5e264397383b0cf5
Python
4,670
148
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
777f5e4e6137f56424205459498b87cca8018e71bc7a3e5c0ca4125dc346205c
Python
4,692
138
import numpy as np # originally from https://github.com/tryolabs/luminoth/blob/master/luminoth/models/fasterrcnn/ def get_bbox_properties(bboxes): """Get bounding boxes width, height and center point. Args: bboxes: Numpy array with bounding boxes of shape (total_boxes, 4). Returns: width...
feaa46cc040639c6432897e11cde7594dc3b1b4a6f91175387353b1ff2c68955
Python
4,693
134
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
7078a3d63a148683f90c541dfd5aa77147a0852ccd61f53e09f6031ce1199469
Python
4,724
137
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
7a9aab638c8aa881cf2fb780f0c0a8e76c79f2da7dc7cb6014a72912090de7eb
Python
4,731
165
import os import keras import pytest from pytest_mock.plugin import MockerFixture from cellfinder.core.classify.tools import model_input_channels from cellfinder.core.train.train_yaml import cli as train_run data_dir = os.path.join( os.getcwd(), "tests", "data", "integration", "training" ) cell_cubes = os.path.j...
e625a06d12f7573ef0aa461c321f3c834f3838f76b1a23a5224387d22276de21
Python
4,738
141
#!/usr/bin/env python # coding: utf-8 # # Author: Kazuto Nakashima # URL: https://kazuto1011.github.io # Date: 08 February 2019 from __future__ import absolute_import, print_function import os.path as osp import cv2 import numpy as np import torch from PIL import Image from torch.utils import data from .base i...
d8d1d88f0ef4026bb968ec1f665d1e49756ebcf8690db5e5952820aa5c214d0b
Python
4,745
157
import numpy as np import tqdm from brainglobe_utils.general.numerical import is_even from cellfinder.core import types from cellfinder.core.tools.tools import get_data_converter def crop_center_2d(img, crop_x=None, crop_y=None): """ Crops the centre of a 2D image, and returns a smaller array. If the desired...
041f2a99d1276fed2e6624526001e85ad8233506dc3eb3b9fadcd56130c489de
Python
4,746
148
'''This code fit an HMM model to a single-session of choice sequence (2-armed restless bandit). The HMM model is 1. not parameter-tied 2. no reseeding 3. randomized initiation T matrix 4. emission matrix is optimized (not fixed), 5. fixed initial distribution. This code is created by Cathy Chen. Date 01/2021.''' imp...
0854b79896516e4c14528567c033d7e27b46181d21448c1d89a9950858fe8df2
Python
4,756
158
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
30dc8e6a60679b9a15bcef39abb4d5bf613c2200c80bb4d23c07214530353a59
Python
4,763
97
import numpy as np import tensorflow as tf import tensorflow_datasets as tfds import matplotlib.pyplot as plt import os from utils import pre_process_AIS import json import pathlib import inputdata #np.set_printoptions(threshold=np.inf) class Dataset(object): def __init__(self, model_name, config_path='conf...
59b37a1d96817c4fb698f0e31debc4a8b436ffa8e06b6692fab02743787e319e
Python
4,773
111
from typing import List import os import random import sys import numpy as np import pandas as pd import tensorflow as tf sys.path.append('.') from src.common import assign_label tma_list_file = r'data\tma_wsi_data.xlsx' tma_sheet_name = 'list' tcga_list_file = r'data\tcga_wsi_data.xlsx' tcga_shee...
6aa2109ec129116c84c7966d0f21b9ba0ee41aa2877d5b43bdd683300b275b28
Python
4,780
155
from ANNarchy import * # Defenition of the complete network in ANNarchy # R. Larisch, Technische Universitaet Chemnitz # 2020-04-27 #------------------------global Variables------------------------------------ patchsize = 12#8 numberOfInputN = patchsize*patchsize*2 numberOfNeurons = patchsize*patchsize# because ON-...
c8d2f55120e4891e95f3bfea81c265c79264ad6bb46e832f59333f2a107319e5
Python
4,784
133
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
1a348e2a346644489689be6819aac83b1d69c550fb503b0228211812ec732b4c
Python
4,789
150
#!/usr/bin/python # -*- coding: utf-8 -*- """ MessageFunction.py: Propagates a message depending on two nodes and their comm...
b65635beeba2c5a4f7dc41fc520743db702315cb1e5b3de0b10b64cef90422d4
Python
4,797
122
import re from itertools import combinations from tqdm import tqdm import pandas as pd from deep_phospho.proteomics_utils import rapid_kit def extract_seq_window(seq, fasta_dict: dict, n=7, ex_pad_symbol='_'): """ TODO fasta dict 可以传入 fasta parser TODO 可以指定蛋白序列 / 指定蛋白 acc """ ext_data = [] f...
ca050e0347a97b9270446cd1290bd19788fc2ce5a33757648dcbb4ce0d258f53
Python
4,798
103
#!/usr/bin/python # Preprocesses tokens from the DSM-5 index import os from nltk.stem import WordNetLemmatizer from nltk.corpus import stopwords import sys reload(sys) sys.setdefaultencoding("utf-8") # Load WordNet lemmatizer from NLTK lemmatizer = WordNetLemmatizer() # Load English stop words from NLTK stops = ...
7eab003a3f49ac2b3ec71f0f643560c48fadad576634009409c4c23455ff942f
Python
4,806
140
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
5e6dc70dc5bfb5e69f51af4ba901abd9d1e67c4cdb0d522520360b975db56c83
Python
4,814
147
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
f3bf371debf4871b50c3fe3e7873e851a18b049bfa0dd74be396c4553056e9d5
Python
4,817
131
import numpy as np from scipy.stats import pearsonr from deep_phospho.proteomics_utils.metric import similarity """ Use all label / Use shared From array / From dict array 或 dict 的上一级,prec 水平 返回值包含所有 prec union 的数量,shared 数量,即两个 n 删除完全没有匹配或给一个默认值 0? """ """ 1. One side: 一边为 benchmark,另一边缺失补零 or other number 2. Two si...