sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
01339d3dbfd0cd381adfa6df8041f69db7fa9790872413bd104e428195489a3c
Python
8,908
309
# 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...
879f9ebeb76aad35371918eb87cec62e9077bfc23449e960457e5fa0a25b1d94
Python
8,925
264
# 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...
61c816290ff00c40a3fb654940558ca79c2dd51b38a8c428041af4ffbdf880d8
Python
8,949
263
""" Collection of generic numpy array functions """ import numpy as np import warnings def _get_decimate_new_n_pnts(trace, window_width, end_method): methods = ("drop", "strict", "pad") n_remaining_points = trace.size % window_width if end_method == 'strict' and n_remaining_points != 0: raise Va...
577f30b29200ceb795f7b2ee56ff3ad0d5931f1f51ac7b857802f7714bd6ccd1
Python
8,959
203
import os import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.optim.lr_scheduler import ExponentialLR from probabilistic_forecast.utils.torch_utils import get_device from probabilistic_forecast.utils.plot_utils import plot_training_curve, plot_regression, plot_classificatio...
9f068b2973f4e65be18f7b3e00d6514977d34a8366e59c71fb5cec0ae09d8419
Python
8,984
172
# Created by woochanghwang at 28/06/2020 # Modified by woochang at 21/07/2021 ''' Count ATC code Draw Bar graph ''' import pandas as pd import matplotlib.pyplot as plt import numpy as np def count_ATC_of_candidate_drugs(): virus = "SARS-CoV-2" # candidate_drug_atc_df = pd.read_excel(f"../result/{virus}/Drug/{...
9db92a2d5c5ee04da2a9adec552c0bf64aa5a80d7fe734902666735be41225ff
Python
8,991
245
# 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...
279e22b7980aa260b32fca3357586a07b1dba64214e80b31c18740e9feb38391
Python
9,005
274
import copy RT_DATA_PREPROCESS_CATALOG = dict( U2OS_RT={ "MIN_RT": -100, "MAX_RT": 200, "MAX_SEQ_LEN": 52, }, DDA_RT={ "MIN_RT": -100, "MAX_RT": 200, "MAX_SEQ_LEN": 74, }, DIA18_RT={ "MIN_RT": -100, "MAX_RT": 200, "MAX_SEQ_LE...
5ed955fcbbf8370538d150639fb906f70828c04740b051007c4da8a3e41505bc
Python
9,015
310
# 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...
307b30a208827238a343040c6ec46b50715c7a3c9c6d9a2d9e1ddffd35358632
Python
9,068
253
# 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...
d8468455992582f0524466b98c405c7507f9381af600256543c9bcd93464d5d0
Python
9,068
245
from __future__ import division import torch from onmt.translate import penalties class Beam(object): """ Class for managing the internals of the beam search process. Takes care of beams, back pointers, and scores. Args: size (int): beam size pad, bos, eos (int): indices of padding, be...
18589e2e282a0fe1b623a282db2066bfdeb9e0da185ee5784d2295eb5b4e28a2
Python
9,071
247
import argparse import glob import joblib import os import subprocess import pandas as pd def get_parser(): parser = argparse.ArgumentParser( formatter_class=argparse.ArgumentDefaultsHelpFormatter ) parser.add_argument( '--output', help="Name of file for CEWAS results", requ...
44c2ff5b318313a1ccb0b1ec4e02b9839c70f865e7930dfce9f5945a7702189e
Python
9,100
260
# 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...
5b0f7f862a94a0e26064b4db97224de6c36e07f1ec9ea30917e1426a33bf19a9
Python
9,101
293
# 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...
fb5063e931d166398105c0df33aaba20dbf40fd82b905065becc5f667e6fe8a2
Python
9,106
234
# 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...
4f570e6dabb9c66e85d42ab81757d7f153d89ed28a2a564f317dd64f7a4af310
Python
9,144
294
# 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...
9f8b95ef7f138d4ee64f159886d96c12105af1b9752227e39787d873fc73cd02
Python
9,144
275
# 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...
ab96a35bdb4a8e4da58bdaf82c002919c9314b54f81c744bf42bd7bd015d7f02
Python
9,144
310
# 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...
e17594beeed319a545fee9b593812b22897757225bbf2d2e27c8b11f65a87491
Python
9,150
219
import torch import torch.nn as nn import torch.nn.functional as F import dgl.function as fn from .aggregators import AGGREGATORS from models.layers import MLP, FCLayer from .scalers import SCALERS """ PNA: Principal Neighbourhood Aggregation Gabriele Corso, Luca Cavalleri, Dominique Beaini, Pietro Lio, Peta...
ec4a9e5368e493a18c2b567c8104c4901fce59d7cea892669e09a4bad59d4e0b
Python
9,156
222
# -*- coding: utf-8 -*- """ Created on Thu Jul 18 12:25:40 2019 @author: Hari - hariteja1992@gmail.com This code implements the state equations for a 2-DOF planar arm with 6 muscle actuators and non-linearities. In the tensor representation, the 3 dimensions represent : time tensor dimension - 1 sample nu...
af981b13a0ee812f1699730fb0e918bf32df5f270d3f322197b4bf362d61241c
Python
9,161
279
# 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...
f4d15e33debce0dbc0602fec5516fc3e508c2ed115d1759159219d643f6d10e8
Python
9,178
331
# 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...
bfe06ac0f4a059a557e54c6cdd7007ab1f0b8223b2be3653b1bc4180f7780741
Python
9,181
293
# 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...
d4e1a69ae05449498bbc5fa608e94c7b743d997d7b3085eeff3bba3024ce6d09
Python
9,193
209
# -*- coding: utf-8 -*- # @Author: Weiyue Ji # @Date: 2018-10-19 00:59:49 # @Last Modified by: Weiyue Ji # @Last Modified time: 2020-10-04 06:50:24 import pandas as pd import numpy as np import helper as my_help import settings as settings ### get bundles with good qc score """ Function: get bundles with good q...
c87ab30d890fc9eb0ecaa600291604d366430ea162c6a944ad1337e38f43cdc7
Python
9,214
271
# 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...
bd37329c83838586c7ec7963d947afda7fc04db362ecb4be270b7e61a0e1226b
Python
9,215
311
# 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...
560990fc16e5c0e18d04b2b80ee33709981db1224886e1830141c8c52ae52b3f
Python
9,223
235
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data import DataLoader from data_structs import MolData, Vocabulary from utils import Variable, decrease_learning_rate from tqdm import tqdm from rdkit import Chem class MultiGRU(nn.Module): """ Implements a thr...
e00a1561fec3902a94b98366ad37c1a18142fddf418aee903224a2c198997202
Python
9,234
249
#!/usr/bin/env python3 """ TEI Note Consistency Checker This script checks TEI files for internal consistency issues where the same content appears as both note place="headnote" and note place="footnote" within the same document. Usage: python check_note_consistency.py <tei_directory> [--verbose] """ import os impor...
9238cfc280a6b8b5625aeee28d41da18d6d20ba595020506c72ae9f476e544a1
Python
9,239
250
from .ted import TED import os import re import numpy as np from deep_phospho.proteomics_utils import rapid_kit class FastaWriter(object): pass class FastaParser(object): """ TODO 传入path,或content,或handle,增加skiprow和commend ident TODO 两个 fasta parser 合并 """ def __init__(self, fasta_path, par...
e7b7680296e1c0b5dd37c9e6ddcc70efb7b970bedca7c198daf1f8d769ed7e9f
Python
9,242
239
import numpy as np import tensorflow as tf from utils.layers import PrimaryCaps, FCCaps, Length from utils.tools import get_callbacks, marginLoss, multiAccuracy ####from utils.dataset import Dataset from utils import pre_process_multimnist from models import efficient_capsnet_graph_mnist, efficient_capsnet_graph_small...
698dabeef1a7f246a72f1b6e170fd53d6ff9ef1700dcb2dfa18dfa44d27a4b61
Python
9,251
228
""" Optimizers class """ import torch import torch.optim as optim from torch.nn.utils import clip_grad_norm_ from onmt.utils import use_gpu def build_optim(model, opt, checkpoint): """ Build optimizer """ saved_optimizer_state_dict = None if opt.train_from: optim = checkpoint['optim'] # ...
a2cfcb4118d365943e49e2b22256be9d7cfa9f9c41e0d7e0180e7639a9dac9ab
Python
9,252
297
# 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...
3bc7bb5efc7af05e6dd3a159ca1698b4bfe9d72b85f2f828ef6e2198fad2f82b
Python
9,274
240
import matplotlib as mp import numpy as np import matplotlib.pyplot as plt #parameters titleSize = 30 labelSize = 24 ticksize = 20 markersize=20 dpi = 100 spaceh = 0.25 markersize=20 figureSize=(20,18) #----------------------------------------------------------------------------- def getTime(data): return(np.arang...
46e13d4e6bb6e97ff0272ba7bca6bed802cbba1d1ef04f0ce08df2f106578aec
Python
9,280
253
#!/usr/bin/env python # coding: utf-8 # # Author: Kazuto Nakashima # URL: http://kazuto1011.github.io # Created: 2017-11-15 from __future__ import absolute_import, division, print_function import re import traceback from collections import Counter, OrderedDict import click import numpy as np import torch fro...
555937f6437035fdf79e59fb18603fe45ab3290695e726d544bebb5be82087cb
Python
9,305
264
# 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...
c13042a125f2f810c84ce8418c587f74ebe443cd0b7ba6ff69ec4ba42278982e
Python
9,312
267
# 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...
2af6ebff5eb909ff5e0490af579cc654246dc8fdcdc17c539a2113690240f55c
Python
9,340
289
# 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...
b77fd3c0227c3711c9f1bc0dfb49ba4dae9f196c084a650cfcef4cb3bce102d2
Python
9,345
329
# 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...
5f899ff496f7cf422a3989f6e4da9f24177f090433b3980f029e37a8fed5b16e
Python
9,373
296
# 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...
4af43032012c250511686a2bddfe5c4593230847bd0dde706c063066a32a8f21
Python
9,376
281
# 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...
8b9c0fe0a9fb088ba1814a1f8f6017571822e6889d06091943b9dd5b93220422
Python
9,378
262
#!/usr/bin/python import os, math import pandas as pd import numpy as np np.random.seed(42) import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable import torch.optim as optim torch.manual_seed(42) from sklearn.metrics import roc_auc_score from sklearn.model_selection i...
14ca7f0cda1c94bd27dc4707bb95e0e8b0000cf56918349b07615f473fe88ac4
Python
9,405
248
# 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...
c6904f5e71aaaa07e88bb58283d84ff799be19387bc9e62bac67c7c5813b684b
Python
9,405
237
import numpy as np import sklearn import pandas as pd import sys from classifiers.inception import Classifier_INCEPTION import subprocess import tensorflow as tf from keras.backend.tensorflow_backend import set_session config = tf.ConfigProto() config.gpu_options.per_process_gpu_memory_fraction = 0.2 set_session(tf.Se...
2528594072ce344a35cf3479778e9052253af73fc61da0ab2fd01f92a7b2a424
Python
9,409
239
#!/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...
bb7f26360828394ba43b1984ff375a4dd2a0191a986c6a814d125c7c62a7406c
Python
9,412
254
# 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...
810026f5bf4cc192538f646424365b32d4f32555c0226c2009c81eea75f0d554
Python
9,430
204
import numpy as np import pandas as pd import matplotlib.pyplot as plt from IPython.display import clear_output import seaborn as sns from matplotlib.colors import ListedColormap from mpl_toolkits.axes_grid1 import make_axes_locatable sns.set_theme() sns.set(font_scale=1.2) sns.set_style("whitegrid", {'grid.linestyle':...
1063199c51cba6856e4f7cc3473aa5decb005534562fd8ba1120446798605ccd
Python
9,434
254
import math import os import numpy as np from cached_property import cached_property from scipy import io from rotation_analysis.analysis.probe.config import FS_probe from rotation_analysis.analysis.stimulus import Stimulus, RotationStimulus, DEGREES_PER_VOLT from rotation_analysis.resample import resampling...
55fe387b948de71ec63b7a96156efe31815d2b3ce9b1338b455e36a92e500f50
Python
9,444
284
# 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...
7486022c201d81b22ee98cb998bc1c1980b1f5fe5e3259c1601ed9a199477a55
Python
9,448
316
# 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...
e7f4d68db95eb8aa99aad58049044e4f20ee383369a7d106d3399d475d761555
Python
9,463
260
import os import re import argparse import copy import shutil from math import sqrt from deep_phospho.model_utils.loss_func import ( RMSELoss, FocalLoss, MaskedLanguageLoss, PearsonLoss, SALoss, SA_Pearson_Loss, SALoss_MSE, L1_SA_Pearson_Loss ) import numpy as np from scipy.stats import pearsonr from scip...
d04f76d17f06d4d9620fe75d8081a4c1badb78df6a83e2afeba29d4afeb43e09
Python
9,467
273
# 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...
120fce56204ef2e849f70d5cb97dd5b8660e7bba8dbc3a383cb6f57967c9ef8b
Python
9,474
372
# 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...
ef4079cd1c8088864b5a4e1c852a4aafa8edd9dfa2735d5e1278e3c1bad8df36
Python
9,480
270
'''This code fit an HMM model to choice sequences (2-armed restless bandit) across sessions. One transition matrix is being optimized across all sessions. The HMM model is 1. parameter-tied 2. reseeded (random initial T matrix) 3. fixed emission matrix, 5. fixed initial distribution. 6. optimization based by observed l...
e2e0d90f18d86e99b38b08db625919fc343cd0bc241fb46ca3d289e40de095e1
Python
9,481
268
####################################################################################### ### Code adoped from https://github.com/c/concise (c) 2016, Žiga Avsec Gagneur lab ### ####################################################################################### import matplotlib.pyplot as plt import numpy as np from...
8b1173ccad1a83bd023cc09329732257ebe5f865862d8f38eb816a95ba3ad8fc
Python
9,482
265
import torch import glob from functools import reduce import pandas as pd, numpy as np import os from sklearn.model_selection import train_test_split from PIL import Image from torch.utils.data import DataLoader, Dataset from torchvision import transforms from torchvision import models from torch import nn import math ...
ba615b615e43086415fdd7bce5ec49e20d74e219976cfe6fdbf0adafccafe5c9
Python
9,483
266
# -*- coding: utf-8 -*- """ ImageDataset """ import codecs import os import torch import torchtext from onmt.inputters.dataset_base import DatasetBase, PAD_WORD, BOS_WORD, \ EOS_WORD class ImageDataset(DatasetBase): """ Dataset for data_type=='img' Build `Example` objects, `Field` objects, and...
e4933679e13a194490b1c55541ed492093f819c99246593cef7b00d3965cf419
Python
9,486
177
# Created by woochanghwang at 10/06/2020 ''' circos make subcellular for generated file from "circos_make_input_files_key_genes" MoA based SOM result #Modified 07/21/2020 Hidden , Sorted by enriched pathways ''' import pandas as pd import numpy as np def main_HPA(): key_genes_in_circos_addr = "/Users/woochanghwa...
a1319f9fcaab65ce57cfddfabaecb9b0e322f9de9c0d207dee9436cf440af179
Python
9,491
271
import numpy as np import numpy.matlib import matplotlib.pyplot as plt import os from scipy.ndimage import rotate from PIL import Image, ImageTk from tkinter import * from tkinter.font import Font from tkinter.filedialog import askopenfilename from matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg, Navigatio...
cea30355750a3ece82045ad997fc32b0008c5632cd2e3647a335018dd5017ed0
Python
9,493
272
# 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...
c6a883332ae6683a4e27c1bbac60d6fbc079b5bb4cdaabc8abb15c13bdbb28a2
Python
9,502
265
# 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...
93e352f229421b7f2598b21086e5c5067388c237693c9644d9d2046efe27101d
Python
9,506
233
#!/usr/bin/env python3 """ Render the Markdown reports of an end-to-end evaluation, optionally against a baseline. compare_reports.py --reports reports/ [--baseline baseline/] > summary.md Both directories hold the `report-<dataset>.md` files written by `jatsEval`, or by score_arxiv.py for the arXiv corpus, in th...
ef891158476e76bb56b6963a12fb54ccb748c38acc02e81a4331b6aa69a1674c
Python
9,575
276
# 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...
87fd6d5253d504c8174804b105eba5f743a55d6778e771135e84ce51f3555004
Python
9,578
297
# 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...
8b96cb1e483da08838e8999fa9430c8d4343c08fc4253a3ae955ff08687611fd
Python
9,581
298
# 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...
4cfd802e582709e73fe6b40bd873087224b515ca48a59d8753dc477fc74272a9
Python
9,605
305
import pickle from .normalization import whole_image_norm, foreground_norm from tqdm import tqdm from os import listdir from PIL import Image import numpy as np from scipy.ndimage.measurements import label from scipy import ndimage import copy b def list_files(directory, extension): return [f for f in listdir(direc...
bb944935ea00916c829f414dc095b1edc258e8d26dde90a12b49a03326c62b24
Python
9,614
230
# 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...
bc2c55fca51547c121c25e4980fa3b0dd5165981f4c8aa98388aeeb193079f8b
Python
9,625
266
# 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...
2f149e20229ef3ca4472f3948139dd8f16e6c7c2365b2c1a62668f0f4c7033ee
Python
9,627
301
# -*- coding: utf-8 -*- import ssl import hashlib import os import tarfile import urllib.request import shutil from tempfile import gettempdir from timeit import default_timer as timer from os.path import join, basename, isfile, isdir, dirname from os import mkdir import requests from .extras import * import subproces...
9a71a2f207b605bd3adfe1f7088518d7d51eeccdc070065dfd991a5d82a3d7e4
Python
9,629
269
# 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...
283e9e5a188238a9e50962323336a517dbe02ecc2ceea868a0eb9881788b7993
Python
9,679
291
from __future__ import annotations import logging import struct from os.path import join from typing import Callable, Tuple, Union import matplotlib.pyplot as plt import numpy as np import scipy from scipy.interpolate import interp1d from scipy.optimize import curve_fit, fmin def DEFAULT_XFORM(s): return s.crop...
e577ae2f24cf5052a26aa4be2f4535b745e33abbe551fc6c33fde32997009158
Python
9,689
212
import os import numpy as np import torch import torch.nn as nn from torch.optim.lr_scheduler import ExponentialLR from probabilistic_forecast.utils.torch_utils import get_device from probabilistic_forecast.utils.plot_utils import plot_training_curve_ensemble, plot_regression, plot_classification class Deep_Ensembl...
c9765c1cccc0a3f299c45f72b9a631d9667a5a2af78799f5b57098430ec98409
Python
9,699
308
# 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...
3e8cad4c879903eeb43417ef64908f9adc5ef183b5889b3f6afc2e518d44b458
Python
9,706
245
# 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...
b60d636429d7505388b026674e722d389d43ae4e1bde870d1be8190f32e433ea
Python
9,758
235
# Created by woochanghwang at 18/07/2021 import pandas as pd import toolbox.data_handler as dh import networkx as nx import matplotlib.pyplot as plt import seaborn as sns from venn import venn import toolbox.visual_utilities as vu def draw_venn_diagram(): virus_list = ['SARS-CoV', 'SARS-CoV-2'] ##########...
fa86265f29146b88fa6da1fa7396e429b487e13bd1e769eaa856eb532f697560
Python
9,761
340
import numpy as np import pytest import torch from pytest_mock.plugin import MockerFixture import cellfinder.core.tools.tools as tools a = [1, "a", 10, 30] b = [30, 10, "c", "d"] test_2d_img = np.array([[1, 2, 10, 100], [5, 25, 300, 1000], [1, 0, 0, 125]]) validate_2d_img = np.array( [ [65.535, 131.07, 6...
900a55cb9a00102ea52f5f5aed1168bf574056d9e153f2ac231c77f470ebd293
Python
9,787
283
# -*- coding: utf-8 -*- """ Created on Sun Jun 6 10:56:38 2021 @author: yuyi6 """ from sklearn.base import clone from sklearn.model_selection import LeaveOneGroupOut import numpy as np from skorch import NeuralNetRegressor, NeuralNetClassifier from skorch.dataset import Dataset from skorch.helper import predefined_s...
4b9cf27f41bf19f3ed0e4c4614bf4ddd56c0050a2e4767676c3a15afcb82f4b5
Python
9,810
265
# 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...
885937645fb2abc3de2e209c86ec3b3d4e1b47173212f417f66da552ca2b4c60
Python
9,821
227
# @license # Copyright 2017 Google Inc. # 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 or agreed to in...
5e3ffecfd1db26f7d1d78662a2b20605cb1c3f07c6eb422a0f7e3a8df6428685
Python
9,824
252
# 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...
8cf71d6cf0e355c98a431d716d43649e7e831185dfd3c04df18a57a67edaab67
Python
9,824
326
# 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...
f4b5b28900bdd018fa5798164936e83905e15e1621e329bb377844964571c05d
Python
9,824
327
# 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...
c67442daa506b79118a5aa621a23f58c72bdf51d123d758110e349ff82ca2965
Python
9,836
252
# 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...
94ccff1b825eab59792a484e426cda1ba892205d4b01f1dae952cbd6df1749ae
Python
9,846
277
# 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...
681237f605aa214e775cb821ae67c8832eb030aa4a91c23bb376eab43f9d35ed
Python
9,859
252
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tuesday Mar 31 22:01:24 2020 @authors: Luz Santamaría Granados (luzsantamariag@gmail.com) Juan Francisco Mendoza Moreno (jfmendozam@gmail.com) """ from RecommenderData import RecommenderData from surprise import AlgoBase from surpris...
23ad6d562ea3316b7b5599079041a7c3e5c34df8cd6d7511e40349665115b00d
Python
9,863
351
# 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...
53dacaf8db772f1d89018dc8a4afacc2b4de0eb7135b94ffbd01f911e28849ea
Python
9,870
267
import copy import logging from collections import * import termcolor from tqdm import tqdm import numpy as np from numpy import linalg as LA from scipy.stats import pearsonr from scipy.stats import spearmanr import torch import torch.nn.functional as F from torch.utils.data import DataLoader def SA(act, pred): ...
4e07e39f21aab2ed6efe91b291c84bb8a2359a63dc0f8ffc0c740b8d29035a79
Python
9,871
246
import os import numpy as np from probez.spike_handling import cluster_exceptions from probez.util import generic_functions from cached_property import cached_property import time class Cluster(object): def __init__(self, spike_io, cluster_id, use_best_only=False): self.spike_io = spike_io ...
9ce75042260b343ee30d55b97cb5f743b493fe3e925a5f7c325db4be90e51169
Python
9,874
261
# 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...
7b93f4d7ccdc74e0d54d42acb96e3be2c193481e70b22e29749c3df808b5b9e7
Python
9,892
254
# 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...
a6e9c8e49da757673c50d685918c707e813b1f17c390e8a378ee7d69ac8de760
Python
9,956
260
# 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...
ab164f6a98cdfff8886d32c5199d3a3629daa192fb82b6203f1c157e87ea7c86
Python
10,000
264
# 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...
8e9f53cf0b3ddda88c2cffb4ea6b003b5faaf5ce80ee91232e608b007161c639
Python
10,017
226
import os import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.nn as nn from torch.autograd import Variable from torch.optim.lr_scheduler import ExponentialLR from probabilistic_forecast.utils.torch_utils import get_device from probabilistic_forecast.utils.plot_utils impor...
86a9093b2e599ad23428f1579fc0d654fbcea4b1e47f6fa8dcda24da78d720ea
Python
10,070
231
import sys import glob import os import numpy as np import matplotlib.pyplot as plt import matplotlib.image as mpimg import scipy import imageio import cv2 import pathlib import skimage import PIL from PIL import Image from interactive_crop import interactive_crop def crop_datastack(exp_folde...
18c6c66f4a9b93873d19dda9196a985988f6852bd02fc2a2d5b7eedd83fee389
Python
10,074
268
from .bases import BaseModel from ..utils import config import tensorflow as tf import numpy as np from skimage import transform from tqdm import tqdm import os from glob import glob from typing import * from ..layers.models import UNET from ..layers.model_RPN import RPN from ..layers.anchor_size import anchor_size fr...
323d6e52bab5be273d6a80cb5841d1a476275c8f32d4a54a0840a86381447483
Python
10,076
264
import os import re import numpy as np from configobj import ConfigObj from file_handling import recording_io from util import detrending class Recording: """ class for dealing with individual files acquired with a probe, specifically for managing all files that are associated with a part...
570a600c39d6e4ab9d312d0bb8a745dc5e9b2c5fb7d769ca0bc6eb1bf68a18d9
Python
10,091
204
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'input_parameters_dialog.ui' # # Created by: PyQt5 UI code generator 5.10.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Dialog(object): def setupUi(self, Dialog): ...
1f30b571dcc54f7a6e84cab4f5ff08960f8efb5290e232676eacd62c173ad462
Python
10,105
318
import argparse import numpy as np from keras import layers, models, utils from keras.datasets import mnist, fashion_mnist import tensorflow as tf from src.whale_optimization import WhaleOptimization from sklearn.model_selection import KFold from keras.datasets import reuters from keras.utils import to_categorical fro...
13b8562f3eed952fad0dc1b01bb8b1ef2dbfa65e23bbd32cba6e5ec693ad1cf8
Python
10,164
268
# 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...
ef696d74621a4bd480a397342beb19af6eb94f34aa9dde95f3943d29797e09db
Python
10,164
266
#!/usr/bin/python3 import os, math import pandas as pd import numpy as np np.random.seed(42) import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable import torch.optim as optim torch.manual_seed(42) from sklearn.preprocessing import binarize from sklearn.metrics import ...
5cadea73fd54522171f5a4b629117242b5bf1739c3b8ea8022fc1f7a4d7c8eab
Python
10,170
327
# 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...
2cc020a378994bca086c18f0e7c21f11fb6b51320ec1e367d7fd6398e21320f8
Python
10,173
276
# 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...