sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
c97d234e39894600b713c9b5c383cf23aaed5a2a520af9b8ce6c4a4c5050862b
Python
4,824
112
import os import pandas as pd from configobj import ConfigObj class DetectionParams(object): DEFAULT_CONFIG_PATH = os.path.normpath(os.path.expanduser('~/.sepi_analysis.conf')) DEFAULT_CONF = ConfigObj(DEFAULT_CONFIG_PATH, encoding="UTF8", indent_type=' ' * 4, unrepr=True, ...
d7d7179df5ab3e0e378812ee6d27d74a2edcbe2a1bc9793ccb05ae7218d3d328
Python
4,827
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...
3b8d74aea0acd1aa5441d39df9a54d380afcd429a2e8a84c89fdb235b3349daf
Python
4,843
135
# coding: utf-8 # In[1]: """ extract_images.py This script performs a sliding window on the input images and extracts the smaller patches. It can also perform basic data augmentation (rotations and flips). The dataset is expected to be one or several collections of images (at least the input an...
33234f7d36484f3e02f3a02b49079769e17b3758c5b2d3c6bf2be09bf085faf7
Python
4,844
114
# 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...
169d40db31c9919a539b38bb96e5e9e510b20db61b2f2fecbea427dd7ff15850
Python
4,848
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...
c260ef3fba0b4b82c6bdedf04cf2cc58149ab39d25f5e989925c4cb40030cafd
Python
4,849
158
import logging import rdkit import rdkit.Chem as Chem from .chemutils import ( get_clique_mol, tree_decomp, get_mol, get_smiles, set_atommap, enum_assemble, ) from .vocab import * from tqdm import tqdm class MolTreeNode(object): def __init__(self, smiles, clique=[]): self.smiles =...
c8f6541cf92a39e7fcde086cdc62da6623e8e034aa79af6a0ec40093fa70e943
Python
4,854
93
import lifelines import numpy as np import pandas #Class Description: To generate survival statistics and plots class SurvivalAnalysis: def __init__(self, clinical, dataSourceID): self.clinical = clinical self.dataSourceID= dataSourceID #Description: Plot Kaplan-Meier plot for spec...
283e0a5aa820a781f681de7170c5fdb3c614fd336d5806b22322f172eead9bc2
Python
4,858
157
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F class PearsonLoss(nn.Module): def __init__(self, eps=1e-6): super().__init__() self.eps = eps def forward(self, pred_y, y): pred_y = pred_y.reshape(pred_y.shape[0], -1) y = y.reshape(y.shape...
dbade01f11b834de3b44ada33fecfb427e3a38bccae1542bd195d068e02e554d
Python
4,859
112
import os import sys import pickle import numpy as np import pandas as pd from rotation_analysis.analysis.probe.ctxt_manager_decorator import temp_setattr from rotation_analysis.analysis.block import Block np.seterr(divide='ignore', invalid='ignore') # TODO: improve (avoids invalid value in true_divide) ...
0365fd0fd3b634fe51c12b2a39918fd5c004d55189e7ae7435afda3c619b6fab
Python
4,863
154
# 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...
2224226ef58a9d896097d878d787d192557b0b6c59d2f5cd989f6df3d0e162e2
Python
4,863
154
import math from typing import Tuple import torch import torch.nn.functional as F class TileWalker: """ A class to segment a 2D image into tiles, and mark each of the tiles as bright or dark depending on whether the average image value in each tile is above a threshold. The threshold is set usin...
317762482c275e46ac4cde9b8fef9fcbdf4ad0b0ea86349d7f59abb6644369f5
Python
4,880
162
# 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...
695e919369329c5f0f4a00ce0e68d0784148e2ea0560d54f0077334a7cf7ddf1
Python
4,883
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...
f9ee7d4a42c937bf730aae5bbdde7845cb68266b5d315e5761f344a94c889880
Python
4,885
160
# -*- coding: utf-8 -*- # @Author: Weiyue Ji # @Date: 2020-03-27 15:06:33 # @Last Modified by: Weiyue Ji # @Last Modified time: 2021-06-06 17:53:39 import os, datetime global paths, analysis_params_general, matching_info def get_unique_filename(prefix, filename): """ Function: check if a filename e...
26d429beb6f4b0d8250157852c56fe5aabcc4bfbbc8773e46f9f240a0ae82681
Python
4,886
91
import os import argparse from probabilistic_forecast.nn_mc import NN_MC from probabilistic_forecast.ensemble import Deep_Ensemble from probabilistic_forecast.swag import SWAG from probabilistic_forecast.lstm_mc import LSTM_MC from probabilistic_forecast.bnn import BNN from probabilistic_forecast.gnn_mc import GNN_MC ...
6a47e8ebebed1d97e24821f178defc7616f7c35c0a4a37f4cf23faaf9ce4a969
Python
4,887
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...
a38f85024e7ad639df759c11d5b1086906aa35cebb4b0c5394ab8218889ffbad
Python
4,909
176
# -*- coding: utf-8 -*- """ Created on Sun Jun 6 10:56:38 2021 @author: yuyi6 """ from sklearn.base import clone from sklearn.model_selection import cross_val_score, LeaveOneGroupOut import numpy as np from preprocessing import data_pre from skorch import NeuralNetRegressor from skorch.dataset import Dataset from sk...
4ad874aa86c673a15344da1f127e8259ca5834a9241a51b55e44a94ff212b38b
Python
4,915
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...
75a4de261fefa97225215f1a6a987fbc5d7aadef9c041fdc7bdffdc9e0c249ff
Python
4,925
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...
a5abc20484416d3a04e8c32b0c36ea628faa6f0029cb10f0634a1bf47d1d3621
Python
4,928
110
# Created by woochanghwang at 15/07/2021 # Created by woochanghwang at 18/12/2020 import toolbox.data_handler as dh import pandas as pd import numpy as np def get_neighbor(key_proteins, SIP_G): key_proteins = str(key_proteins) if key_proteins == 'nan': return "NA" else: key_proteins = key_...
d76ff3f2a3cac92e5c61a9a057702fef42e181f07db7db97be11a271c3cdb119
Python
4,933
133
"""Test the functions in the yasa/plotting.py file.""" import warnings import matplotlib.pyplot as plt import numpy as np import pandas as pd import pytest from yasa.hypno import simulate_hypnogram from yasa.plotting import plot_hypnogram, topoplot DATA_POS = pd.Series( [4, 8, 7, 1, 2, 3, 5], index=["F4", "F3",...
56d99ece54a5eb0512aae2d4bbc9d13a74baf4de3662b9756f4f349a41782e91
Python
4,936
167
# 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...
11f7c2916b1c0e3d04b16612f9af386d28df844513231245d6b1d2c57203040c
Python
4,939
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...
45db0c2f29df876075d0ceffd36ae8188b415ee171deb409dadcd240680fb55d
Python
4,945
123
# Software License Agreement (BSD License) # # Copyright (c) 2012, Robotiq, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copyr...
64844c5156947b072e82e72bb9972796d1b3a2847be17e706cc2b825014190ff
Python
4,947
182
# 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...
39491764cdc086bb047a7f2b806028e41668d6a67a44d317f49bee866a1646f4
Python
4,949
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...
d3257e048cef68a4af1802794f14dbcb4aec9c377bf0544b512ceedac30a6569
Python
4,950
129
# Created by woochanghwang at 08/07/2021 import pandas as pd from toolbox.data_handler import save_obj, load_obj import networkx as nx import toolbox.visual_utilities as vu def is_in_STRING(gene, graph): if gene in graph: return "IN" else: return "Not_IN" def make_DIP_DEP(): human_Graph =...
504e6c31e36e38752f064e524f5149861b40fe62a0360cd2d44d0ff928b30ea7
Python
4,959
147
# 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...
e64b76f46d507e90420694102a7ad844ff55835d7bad53a95990e4f82f9b9514
Python
4,959
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...
fb6cf14ecb7b12b269b09615fa240c03dd53bfeb2fd6c087cd5329c7f6e51f9a
Python
4,960
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...
afe187eb9a8419c3601e78ac9e2e88231b7b5399dac169ee5b86e7d64e31016f
Python
4,961
124
import pygame import logging import serial import numpy as np import time import datetime import pyxid #get a list of all attached XID devices devices = pyxid.get_xid_devices() dev = devices[0] # get the first device to use dev.reset_base_timer() dev.reset_rt_timer() if dev.is_response_device(): while not dev.ha...
58f7ba959c93379acf3d2c89a8b62635f2dfef1f1fb862fd7768060f2c618263
Python
4,964
119
""" Audio encoder """ import math import torch.nn as nn from torch.nn.utils.rnn import pack_padded_sequence as pack from torch.nn.utils.rnn import pad_packed_sequence as unpack from onmt.utils.rnn_factory import rnn_factory class AudioEncoder(nn.Module): """ A simple encoder convolutional -> recurrent neur...
6055bc192195bc800093e505c96952f7357a45d4c0dc9cc877122660f8d5823c
Python
4,981
133
# 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...
136c608fbb6ebab4301a8a4ae705b1035acc8652ea4354344dd4818f47c090d3
Python
4,982
154
# 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...
5d43d24e0c2a5ed8487b1b3d3a628bbfc36673ae2f792738f6c1e7841f826ef2
Python
4,986
153
import tensorflow as tf # originally from https://github.com/tryolabs/luminoth/blob/master/luminoth/models/fasterrcnn/ def get_width_upright(bboxes): with tf.compat.v1.name_scope('BoundingBoxTransform/get_width_upright'): bboxes = tf.cast(bboxes, tf.float32) x1, y1, x2, y2 = tf.split(bboxes, 4, ax...
71037c1eb7a5dc3219454433fe1617c06a5585c191bc812d55dfed71bef3b2cf
Python
4,998
163
import re import unicodedata from dataclasses import dataclass, asdict, field from typing import Tuple, List, Dict, Optional, Any from rapidfuzz import fuzz, distance @dataclass class EvaluationMetrics: precision: float recall: float f1_score: float f05_score: float f15_score: float true_positi...
5fb91a89eaab1ae7def583f822f5f5533e9aa3279bd43284165fb637345ea163
Python
5,001
119
#!/usr/bin/env python """This is a simple python script to perform an integration test on bam-readcount. It uses a small BAM generated by merging two 1000 Genomes sequencing for NA12878 and NA12892. See https://github.com/genome/somatic-snv-test-data for info on the BAMs and reference. These are subsets of the ones fro...
0995bd2b1a3f8e63b940d5b5b24dc5423993a6e591801a9c65a5be63451c0a8c
Python
5,003
133
# 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...
061c43ae99eced612d15c8bd2c0f694a28c5a8a7384d78da5275f21be130f443
Python
5,012
175
# 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...
366137f7446eb728dca31e5821ccb470348937517db868bd255bbc305b8ce4c1
Python
5,023
168
# 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...
4be0938aa347c993521878cccd7c46fafbc46acb26ac363fd7b1cc306cb28ec8
Python
5,026
173
import logging import os import sys import json from collections import defaultdict, OrderedDict, deque import torch from torch.utils.tensorboard import SummaryWriter class SmoothedValue(object): """Track a series of values and provide access to smoothed values over a window or the global series average. ...
a47a7c1c4da478be04b17e9b5be14a1bb455c60438d4418c023a94e7f7d3354a
Python
5,036
181
# 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...
e39a3bd5212d3788ecd0ca42dcef95863ded4192b04be3fc2bcea493dbe4db1a
Python
5,039
116
import os import time import glob import sys import shutil import datetime import subprocess from cproc import * from reorder import * def z_align(expfolder): exp_folder = os.path.normpath(expfolder) + "\\analysis\\" print(exp_folder) exp_folder_fixed = exp_folder.replace(os.sep, "/") print(exp_folder_...
733be9a42875d958d4486d6ea0c8b6fb5e5e042301d7d8aab8d4ee2a9ee6f153
Python
5,067
151
#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2012, Robotiq, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must...
a1ca5e442e457bf63ea952fb09d2055ace75fb3c86191eb23d332b244a301b41
Python
5,075
224
# 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...
92a2c33d8f484085ec00febaf8c8de72028473f66635615186dcdfe0ffa8a8b9
Python
5,079
139
# 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...
2f29afbd858592cb885a57de639d41bc1a8d9b1f695fdf5b5b6925a36ea87144
Python
5,082
117
import threading import time from Queue import Queue import cv2 # Import OpenCV2 #from opto import Opto # Import modules provided by optotune import hamamatsu_camera as hc import os import numpy as np import sys import multiprocessing import ImageWriterProcess #TRY TO REPLACE THREADING WITH PROCESS: http:/...
c1d1dcf9f7fe1ebaa5bbbf9e386b1d177a820e46d9fa964d7bf66ff141c76e2a
Python
5,089
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...
cb81755d2645e79d8578a7f79bd282c27137bc3918368af6cf08897ebfdbf008
Python
5,100
167
# 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...
0ff82d30572667b844b11a56dd6fdf404a5456f41caaf5b01d12bd55a76935bc
Python
5,109
111
from __future__ import division from __future__ import print_function import torch import torch.nn.functional as F def load_dataset(data_path, loss, only_nodes, only_graph, print_baseline=True): with open(data_path, 'rb') as f: (adj, features, node_labels, graph_labels) = torch.load(f) # normalize l...
a760aedd4a576c6d8a412c6776a2e34f19d12438f19cb7d3ebb6cc7075c87cb8
Python
5,115
145
import numpy as np class WhaleOptimization: """class implements the whale optimization algorithm as found at http://www.alimirjalili.com/WOA.html and https://doi.org/10.1016/j.advengsoft.2016.01.008 """ def __init__(self, opt_func, constraints, nsols, b, a, a_step, maximize=False): se...
1ccac75573f67654da6d6416173cdbee7e6e3f81fb2edc01377f82cbc9f14fee
Python
5,116
183
# 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...
f034584a620336abd3ae2ca0476c0e5dee631989e2a3cc913cc36cced71eb725
Python
5,121
113
""" 1. Heatmap with color blocks (with or without edge lines) 2. With color points not blocks 3. Gap with defined rows or cols """ from deep_phospho.proteomics_utils.drawing_area import remove_xy_ticks from deep_phospho.proteomics_utils.colors.precolors_grad import FavorGradColor from matplotlib import pyplot as plt ...
992e027993d4f99cdb66d279cea698e3e2c9dfd5e575bd3382d4dbeb2d2145d8
Python
5,124
134
import numpy as np import matplotlib.pyplot as plt import scipy.special as sp import h5py as h5 from scipy.integrate import quad as INT from importlib import reload import sys direc = sys.argv[0].split('scripts')[0] where = sys.argv[1] synapse_type = sys.argv[2] if synapse_type=='static': reference_cv = sys.argv[3...
b18ba055eaa97ed28b366c7991667eddc32690938fb09f923c26ff7a0b2058f3
Python
5,137
190
# 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...
24d57c56268f760477384c771c177bcbdbe679fcbe22eb0226d73c178ac7635b
Python
5,149
148
from pathlib import Path from unittest.mock import patch import pytest from cellfinder.napari.train.train import training_widget from cellfinder.napari.train.train_containers import ( MiscTrainingInputs, OptionalNetworkInputs, OptionalTrainingInputs, TrainingDataInputs, ) @pytest.fixture def make_du...
12dc1877787bbb9892db3208b57934d62d397fa98a6e3dd3f5d8741a41064173
Python
5,159
132
import numpy as np import pandas as pd from stytra_config import ConfiguredStytra from stytra.stimulation import Protocol from stytra.stimulation.stimuli import CalibratingClosedLoop1D, \ GratingStimulus, Basic_CL_1D, GainLagClosedLoop1D, GainChangerStimulus from lightparam import Param class ClosedLoop1DProt(Pr...
ef4370f2081eca4555d19bf7f2df2b74094ea5e6676c5b9bf2e1bddd4dfc2f7c
Python
5,160
155
# 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...
abb66c1e78a39ea5ffb99b244bf72d68fe7c3d2fd3c91609576d263dca5311b6
Python
5,165
145
# 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...
b4ce596f1a2f1d9fb8ba4cba0cb85540d5f1fb994e06fe38a525e146214a1b14
Python
5,177
118
import numpy as np import tensorflow as tf import os import cv2 tf2 = tf.compat.v2 # constants AIS_IMG_SIZE_H = 300 AIS_IMG_SIZE_W = 200 AIS_TRAIN_IMAGE_COUNT = 2944 PARALLEL_INPUT_CALLS = 30 # normalize dataset def pre_process(image, label): return (image / 255)[...,None].astype('float32'), tf.keras.utils.to_ca...
07b70d71e8d71ef0777b18bb1b0c0979455c6b5fba0e63523c1f694a60f989f1
Python
5,178
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...
8bd8be5b65ce9e5426599fe7f9aa5f364b27147dbf8b4ebf0f93f1a1206cca9c
Python
5,191
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...
467346ff7bfa678ca02547a5839adc0897d1748ec40a552b574a07cd3251ac43
Python
5,204
160
""" The spherical Bessel Function utility file from the original DimeNet implementation https://github.com/klicperajo/dimenet. Licenced under Hippocratic License 2.1. """ import numpy as np from scipy.optimize import brentq from scipy import special as sp import sympy as sym def Jn(r, n): """ numerical spher...
669fe8168885c5ee096b5768fde3b29ddc0462269e32917b31d57b55251a72cb
Python
5,205
132
import os import re import json import pandas as pd from deep_phospho import proteomics_utils as prot_utils from deep_phospho.proteomics_utils.post_analysis import spectronaut as SN def generate_spec_lib( data_name, output_folder, pred_ion_path, pred_rt_path, min_frag_inten=5...
58a7550a8657f2d10f78f5b500c2576a74d2caf8e7fd10dbd16f9b592bc39f97
Python
5,212
115
import pandas as pd from collections import Counter, defaultdict import numpy as np # import modules.help_functions as help_functions import warnings warnings.filterwarnings("ignore") def return_gene(TU_level_df): TU_level_df = TU_level_df[[0,1,2,4,5,12]] TU_level_df.columns = ['seq-id','feature-start','featu...
7cb13193329adeb33ec5e129f7d5c6a4837710b7a0a2db37209ab5fbc1b37a41
Python
5,215
170
from unittest.mock import MagicMock import numpy as np import pytest from brainglobe_utils.cells.cells import Cell from cellfinder.core.classify import classify from cellfinder.core.classify.resnet import build_model @pytest.mark.parametrize( "dimensions,model_shape,voxel_sizes", [ (3, (50, 50, 20, ...
fe9770a74cb158de02a18d790914c27a8355c70ab074eedd2da6eeeae2445e19
Python
5,218
219
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 = [ "H", "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne", "Na", "Mg", "Al", "Si", "P", "S", "C...
e465a0bef165a06a9338be2cfc36f4d63c6f3717b0541b1d83a7cc0297d5938f
Python
5,221
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...
fd74bd27280b0a239c4226c53ce22d96fba6a6446609f75298c437eb10a321e6
Python
5,227
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...
ea9acc70ebe2c4f3a13d76b94c4da558e99369cdf31c7daac35eec92483336a7
Python
5,234
102
#!/usr/bin/python # Preprocesses raw full texts in the following steps: # (1) Case-folding and punctuation removal # (2) Lemmatization with WordNet import os, re from nltk.stem import WordNetLemmatizer from nltk.corpus import stopwords import pandas as pd # Date of RDoC data download date = 180716 # Load Word...
c0443e9ef4d2744b642c9c89e60b66d320e054ca163b52f4469debdd2fe28055
Python
5,237
185
# 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...
f6677ac418d5fa7175d6685e4840c4c64dedf73be45fbc7acd79946fe008fc87
Python
5,257
140
#!/usr/bin/env python3 import os import re import xml.etree.ElementTree as ET from collections import defaultdict import difflib def extract_notes_from_file(file_path): """Extract headnote and footnote content from a TEI XML file""" try: tree = ET.parse(file_path) root = tree.getroot() ...
eaa0ce5b61f85a701fd683ff24c45fd8478a8216f4bc60721ddd35ed0ee45146
Python
5,259
161
# 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...
b2a06d6276c7375c21bbd93f1457593c04fd4abe45047e50cc818c7608146682
Python
5,266
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...
1cda7a967a20b8c4b8c2f2f4fa54d3da814fffc947be55b64dc5005a4a31d039
Python
5,270
145
# 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...
b940ee1d8ee6a8545a64d4c0161295e0c63b6e0ff00a71f12f7ad8e5132d912a
Python
5,270
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...
e44d10178cb38d82d63847c7aead09b3ec2fd1903e447da8635f4e677be47337
Python
5,285
137
#!/usr/bin/python import os import pandas as pd import numpy as np np.random.seed(42) from sklearn.linear_model import LogisticRegression from sklearn.multiclass import OneVsRestClassifier from sklearn.metrics import roc_auc_score from sklearn.model_selection import ParameterSampler def doc_mean_thres(df): doc_me...
ba28e0e2c0a6a49504fb71ea7f3a526327eb0324eaa7e8aa8382362c638e267b
Python
5,296
112
from sklearn.neighbors import NearestNeighbors import concurrent.futures import pandas as pd import numpy as np def knn(min_class_points, k): nbrs = NearestNeighbors(n_neighbors=k, algorithm='ball_tree').fit(min_class_points) _, indices = nbrs.kneighbors(min_class_points) neighbourhood = [] for i in (i...
abc79d9cc6ede38390645893e1101a8acb53785ce44ddfa6ddb30cdbe6786569
Python
5,299
135
#!/usr/bin/python3 import os, pickle import pandas as pd import numpy as np np.random.seed(42) from sklearn.preprocessing import binarize from sklearn.linear_model import LogisticRegression from sklearn.multiclass import OneVsRestClassifier from sklearn.metrics import roc_auc_score from sklearn.model_selection import...
ab32fb487dba86dae1738f5e7b4ab931d7d57f530780128cc8d6f1011074e059
Python
5,302
153
""" Report manager utility """ from __future__ import print_function import time from datetime import datetime import onmt from onmt.utils.logging import logger def build_report_manager(opt): if opt.tensorboard: from tensorboardX import SummaryWriter writer = SummaryWriter(opt.tensorboard_log_di...
395a69de64959140a2a8975ec6fd38673fd97abbdd9849f1db757b580ce77b4d
Python
5,304
161
""" Simulate some data from 2D GP to test methods and evaluate errors. """ # %% Imports import matplotlib.pyplot as plt import autograd.numpy as np from gpcsd.gpcsd2d import GPCSD2D from gpcsd.covariances import * from gpcsd.utility_functions import normalize from gpcsd.predict_csd import predictcsd_trad_2d np.rand...
b2cb65eb1ab0c8e034365a75a6620358ab464ebdd0c1c47087039a14470d812f
Python
5,305
119
# -*- coding: utf-8 -*- """ VGG-Net for CIFAR-10. Introduction ---------------- VGG is a convolutional neural network model proposed by K. Simonyan and A. Zisserman from the University of Oxford in the paper 鈥淰ery Deep Convolutional Networks for Large-Scale Image Recognition鈥? . Download Pre-trained Model -----------...
be3cf767faa4a0fdd4d71cd389de58c27bdd44edf55fb0f0af31a84d6a2bf244
Python
5,312
119
# -*- coding: utf-8 -*- """ VGG-Net for CIFAR-100. Introduction ---------------- VGG is a convolutional neural network model proposed by K. Simonyan and A. Zisserman from the University of Oxford in the paper 鈥淰ery Deep Convolutional Networks for Large-Scale Image Recognition鈥? . Download Pre-trained Model ----------...
e932304716864e798c4d178200bdc0e47c450ec8f7e481ae1a00aa536d5c7246
Python
5,313
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...
cb1079a64ba9643dbff13502705c1eb4965fb9a18aeff89883a079f8986ffd8d
Python
5,314
194
# 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...
864275adcd104afa7c8e761651cfc991981320a80a2db675f38deba34badfa90
Python
5,326
163
""" Simulate some data from 2D GP to test methods and evaluate errors. """ # %% Imports import matplotlib.pyplot as plt import autograd.numpy as np from gpcsd.gpcsd2d import GPCSD2D from gpcsd.covariances import * from gpcsd.utility_functions import normalize from gpcsd.predict_csd import predictcsd_trad_2d np.rand...
9e0d5a452bd80043561bd343ac8e326c544a5355f08bc99844610e91e7d79459
Python
5,329
169
# 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...
ac64babc60f35e5d91bd1e78b1c227cfcd6a078203e27285b76e6ceeb457f790
Python
5,334
148
from __future__ import print_function import numpy as np from math import ceil, floor def imadjust(x,a,b,c,d,gamma=1): y = (((x - a) / (b - a)) ** gamma) * (d - c) + c; return y; def deriveSizeFromScale(img_shape, scale): output_shape = [] for k in range(2): output_shape.append(int(ceil(scale[...
1b63a9a34af9d3de4cda767bfecf7257192ca021a9cfbb31064174b13b17642c
Python
5,336
134
#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2012, Robotiq, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must...
3ede89f65e60d96ce76bcc9392a4684b2a85047c53ec9cb67831985f8aeeea4d
Python
5,343
149
# 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...
ec63c0680564b19513567ae8ff4e8ed81f543d1a06dec2a78ec2567ffdbf6c2b
Python
5,351
185
# 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...
df7f86fc2e7f26bdad9165bb697309262e5c8a33500e8225f28aa335eafb50c3
Python
5,360
150
import warnings from math import cos, acos, sin, sqrt, radians import numpy as np from matplotlib import pyplot as plt from src.signal_processing.mat_utils import avg, sd warnings.filterwarnings('error') class PolarPlot(object): def __init__(self, data, xData, doOffset=False, dest=None, ext='png', lines=Tr...
55d5ed03e3af375c43da8769e31fc544e010868456c4f2ed85ec4ea1dae9beb6
Python
5,364
188
import glob import os import pickle as pickle import random from os import path import torch from torch.utils.data import DataLoader, Dataset from .jtmpn import JTMPN from .jtnn_enc import JTNNEncoder from .mpn import MPN class PairTreeFolder(object): def __init__( self, data_folder, voc...
9010439c213640a2c5e1e3f289c2d76c47f2f63bb81ccb7962818596959ed2dd
Python
5,371
178
# 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...
d6048b3fed383e10296152e75cdde8c0cccd38e1e872c4283e1ce1049362943d
Python
5,376
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...
13f8abf793a65c4fb2f1bd15c83e41bfc666c9c8255f249e0abbee64ed454115
Python
5,378
139
# 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...
6fb13a351ae5c41d0ba0c93414df78f25cda813d54eee379bf6cccbfa5b2aa2a
Python
5,387
156
""" Implementation of the CNN Decoder part of "Convolutional Sequence to Sequence Learning" """ import torch import torch.nn as nn import onmt.modules from onmt.decoders.decoder import DecoderState from onmt.utils.misc import aeq from onmt.utils.cnn_factory import shape_transform, GatedConv SCALE_WEIGHT = 0.5 ** 0....
0b9767116a57c94ae0c7fccd8910e96b2fc706e506a49c89442c8026b508c913
Python
5,398
142
"""Test the functions in the yasa/sleepstats.py file. The public ``transition_matrix`` and ``sleep_statistics`` functions are deprecated (see ``test_hypno_utils.py::test_deprecated_functions``). These tests check the values of the shared implementation used by :py:meth:`yasa.Hypnogram.transition_matrix`. """ import w...
9cda2eb8273206b0cfe09e9d53946215fda657722ffab3084a6a7b17c9673fdb
Python
5,398
178
# 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...
3fe62369a8224f6b664e0309d774bce3baaa42824c4d3147e6579b1c2961500e
Python
5,399
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...