sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
95c7410b0db67532dfeebc503ef5e603dad4c5b4bada0d46205509bf72777d01
Python
2,970
71
import sys from analysis.signal_processing_sepi.filters import box_smooth, diff from matplotlib import pyplot as plt from analysis.event_detection.calcium_trace_handling import load_fluo_profiles from analysis.event_detection.event_detection import detect_trace from analysis.event_detection.event_plot import _...
5ba8cfeb99c37d5cbb9b60210c637bc3ac13c1bf1e2cf29fe49197d78796a981
Python
2,993
95
#!/usr/bin/env python3 # encoding: utf-8 ''' intron_scanner.intron_scanner -- shortdesc intron_scanner.intron_scanner is a description It defines classes_and_methods @author: user_name @copyright: 2020 organization_name. All rights reserved. @license: license @contact: user_email @deffield updated: ...
40fd00974f28debb3d1ef5ce293e28e51801bc4e58ce7631c96c7935c4c4d638
Python
2,994
101
# 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...
b9fe9fd72d0e2e3ee5cffc78d085d7ce51761dee8863fedc4dbbd1b56287f650
Python
2,994
105
#!/usr/bin/python3 import os import pandas as pd import numpy as np def load_docs(dtm, act, words): docs = dtm[words].copy() docs[list(act.columns)] = act.copy() return docs def load_prototypes(lists, circuits, domains, words): structures = sorted(list(set(circuits.index))) prototypes = pd.DataFrame(0.0, i...
f4f1a694232a2cc271a8ea0972651a7c97108651df527548e6fddc8ae6418832
Python
2,994
109
import re import pandas as pd """ 检索结果的导入 1. 每种文件单独 2. 所有文件在一个文件夹中,读入指定文件关联 id """ def mq_modpep_to_intseq_1_6(x): x = x.replace('_', '') if '(Acetyl (Protein N-term))' in x: x = x.replace('(Acetyl (Protein N-term))', '') x = '*' + x else: x = '@' + x x = x.replace('...
3f013120216eec5f64b0b3eeef4a362e472071ba9f9b68851b9b1eae80a549ae
Python
2,995
85
from dataclasses import dataclass from typing import List, Tuple, Dict, Any import numpy as np from scipy.optimize import linear_sum_assignment from evaluation_utils import get_normalized, calculate_similarity, NormalizedCache @dataclass class Match: gt_index: int pred_index: int ground_truth: str pr...
5f0f8ed3c6d52999d5ee9afd29776407b3b342b53d0570c86ef26c58f3f7d501
Python
2,997
94
# 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...
56fd67beb7e61277726f5f734436fe8e19f0daaf2b90011bc81f1299ab6ca8cc
Python
2,998
99
# 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...
848feaf46356aa493e2a6c31b4adb1fdcbc69c2c8261bcc943b23b909512987d
Python
2,998
87
# 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...
4cd0a658e549001ae8398ad1f51047851fa1b92fbca8a36ba4ca7324a5d03a59
Python
3,006
77
#!/usr/bin/python3 # Order of domains for plotting order = {"data-driven": ["MEMORY", "REWARD", "COGNITION", "VISION", "MANIPULATION", "LANGUAGE"], "rdoc": ["NEGATIVE_VALENCE", "POSITIVE_VALENCE", "AROUSAL_REGULATION", "SOCIAL_PROCESSES", "COGNITIVE_SYSTEMS", "SENSORIMOTOR_SYSTEMS"], "dsm": ["DEPR...
ede27513bec12bf8d8e99b25e11cad339cb59ae89a74a84501e41940285cd004
Python
3,006
101
# 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...
f465233b9cabc41257fb85194b13696e0a989bf63b728832efe10c620cd5aef6
Python
3,007
100
# 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...
c55e21472fa4837b0587e3d73be75ba092e9978c509c0e8ce10aa346ebb5ab9e
Python
3,011
101
# 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...
f58655e715aed42460dbd49082afb0cfb5a1981b8aacc4d2bdfdda09851df695
Python
3,011
111
# 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...
06321dffd3b1b41501e3b9a8767a2c239d1db9daeebe250972072d56c12d997c
Python
3,013
96
# encoding=utf-8 import matplotlib #matplotlib.rcParams['backend'] = 'SVG' import matplotlib.pyplot as plt from matplotlib.font_manager import FontProperties import numpy as np from pylab import * #mpl.rcParams['font.sans-serif'] = ['SimHei'] #simsun = FontProperties(fname=r'C:\Windows\Font...
bd92ad79488ee0f1f5dd1e21bbbf5997fc054ffeecce004fda3d465a32f5114a
Python
3,016
97
# encoding=utf-8 import matplotlib #matplotlib.rcParams['backend'] = 'SVG' import matplotlib.pyplot as plt from matplotlib.font_manager import FontProperties import numpy as np from pylab import * #mpl.rcParams['font.sans-serif'] = ['SimHei'] #simsun = FontProperties(fname=r'C:\Windows\Font...
0ab782ec0619943c2b2880431b240066d211bcdc847e84021766751f9dc7b826
Python
3,018
87
# 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...
89d0c36a5e349de59c0d10d45d29ca062a6e434268733f205901d56153acd434
Python
3,018
88
import tensorflow as tf gpus = tf.config.experimental.list_physical_devices("GPU") if gpus: try: # Currently, memory growth needs to be the same across GPUs for gpu in gpus: tf.config.experimental.set_memory_growth(gpu, True) logical_gpus = tf.config.experimental.list_logic...
a24a608712cfa0778110a4c31d4a5b91fb2da8a6bd61651ebf64e25daaa1cd1d
Python
3,029
96
import numpy as np import matplotlib import matplotlib.pyplot as plt from importlib import reload 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) import parameters as par import functions reload(functions) im...
36d8e0daa3fe4c410da23f533b2eb79111138ae5bf485edf88a9e249fba1eb24
Python
3,030
102
# 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...
0079d20e0e584f1f32ab6ab6441b708aaa78b871e838ddf70fa34c36a716d3cc
Python
3,034
100
# 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...
03730fe678ee3b1e12e0a6fe874c5c8d23f21820fed303d2280ca676e16b4cc7
Python
3,036
49
from __future__ import division from __future__ import print_function from models.pytorch.pna.layer import PNALayer from multitask_benchmark.util.train import execute_train, build_arg_parser # Training settings parser = build_arg_parser() parser.add_argument('--self_loop', action='store_true', default=False, help='Wh...
260bd5057d98d57e12f85e00af25822b57c78647e2c9af02d07b2217a3406a28
Python
3,040
104
# 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...
462256abc2fe4f53d9c8337ad8e9cbb27b062ffbcee1dbe4ab4d886bf06898f0
Python
3,040
89
#!/usr/bin/python # -*- coding: utf-8 -*- from .MessageFunction import MessageFunction from .UpdateFunction import UpdateFunction from .ReadoutFunction import ReadoutFunction import torch import torch.nn as nn from torch.autograd import Variable class MPNNv2(nn.Module): """ MPNN as proposed by Battaglia...
5bb7701f66508467786da976427af057ad4d757f81ed10c1566acc8b910cd5c1
Python
3,041
78
# Loss functions import tensorflow as tf # Per-Pixel loss def Norm_loss(G_img, gt_img, args): if args.loss_mode == 'L1': metric = tf.abs elif args.loss_mode == 'L2': metric = tf.square else: assert False, ("Mode needs to be L1 or L2") loss = 0.0 for i, weight in enumerate(args.batch_weights): ...
02e7f1966317e35aa4af611cd56242142f08ec6e7317b109075466e5637b2c72
Python
3,042
102
# 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...
a356661c5ff4cd5ca5e9f584937c9607f62b7dd989c67c804c0cbbfd113b14b7
Python
3,042
85
import gzip import logging import re import io import numpy import pandas from .. import Exceptions def gwas_data_source(path, snps=None, snp_column_name=None, skip_until_header=None, separator=None, handle_empty_columns=False): s = {} def _ogz(p): return io.TextIOWrapper(gzip.open(p, "r"), newline=""...
f894aae3649154da7a9bc70ef9aaf1b4411c9c45c3dff65d88e2e36a2a3ea60b
Python
3,042
93
# 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...
d2d3ca5261078f68f63d996c5be2127961653d29a1e37f6cc48c64cd59e9d89b
Python
3,046
92
# 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...
cd5209f3ec61caeb17230406ae5286a6e8dd36e093b1327878453c6efe231586
Python
3,048
94
# 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...
ee35ede1ccb681131b46593483d88ee11f4e2e33803a7332d18d0b8b754b1c17
Python
3,060
101
# 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...
10ef4b481ffd8376b49c9d9ff51c085da37e28611e0abc0ee799c3bf2bf16e41
Python
3,071
48
from __future__ import division from __future__ import print_function from models.pytorch.pna.layer import PNALayer from multitask_benchmark.util.train import execute_train, build_arg_parser # Training settings parser = build_arg_parser() parser.add_argument('--self_loop', action='store_true', default=False, help='Wh...
250d1593238aa69c59cc84c385a06ee6d2c212fc6baf2698dda4d28b8fa6c54a
Python
3,080
96
""" """ """ ### Description for supported modifications ### DeepPhospho supports phosphorylation and common modifications listed as below: Phospho on S/T/Y Oxidation on M Acetyl at peptide N-term And all C in peptides are regarded as C with Carbamidomethyl ### Description of different modified pepti...
7b885505dfb820c5f97176e0ad28e7d77bade2db423f7666c8c134779eb2999a
Python
3,080
67
import scipy.io import numpy as np import analyzeMEA.rastPSTH def randSingleAnalysis(matFile, samples, spikes, units, window=[0,25], psthSize = 1000, psthBin = 1, sampleRate=20000,verbose=True): """ Generates relative spike rates in analysis window to overall mean to map out receptive f...
09ce44b362baed8c6930f5113d364ceb16c9dfecdadd8f74fdb21cc85bf53d56
Python
3,085
88
# 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...
94d151bd0ff52da19b0c2612ba784d7a4cff3074a7766d1a5f1b0f12105726d7
Python
3,088
77
import bgen_reader import numpy import pandas import logging from ..misc import Genomics def bgen_file_geno_lines(file, variant_mapping = None, force_colon = False, use_rsid=False, whitelist=None, skip_palindromic=False, liftover_conversion=None): logging.log(9, "Processing bgen %s", file) bgen = bgen_reader....
2e995037f33b49b62e6bdb6d40080292c9dedcf4d702e448cd5ec127008f7ead
Python
3,095
62
import torch import torch.nn as nn import torch.nn.functional as F class MultipleAtt3(nn.Module): def __init__(self, embeddings_dim=1024, output_dim=11, dropout=0.25, kernel_size=7, conv_dropout: float = 0.25): super(MultipleAtt3, self).__init__() self.conv1 = nn.Conv1d(embeddings_dim, embeddings...
0b7e0c3f87ca9bc9b6744ca5798e9776fd3d409a84d9a7d378447924c56c89e9
Python
3,096
102
# 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...
f9ac18ec76c20161b622c4f50942ac3a527f6f59130537532c0a53e0c26c4d98
Python
3,097
67
# @license # Copyright 2020 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...
b29d7033ddbfd2673fbc654e40df4ca588e1b3c194339ef30cd78fd76b3798d3
Python
3,098
98
import numpy as np from brainglobe_utils.cells.cells import Cell from cellfinder.napari.utils import ( add_classified_layers, cells_to_array, html_label_widget, napari_array_to_cells, napari_points_axis_order, ) def test_add_classified_layers(make_napari_viewer): """Smoke test for add_classif...
f69b22a4ef6a5e0822a2327fbb76d2e97acc228b92ab781d544d8d01f889bde5
Python
3,098
87
# 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...
ac9f7dd942357046de677ae17aabc7eb795a6a949d8fb0a497f65c6e63de5a4b
Python
3,103
57
# Created by woochanghwang at 16/07/2021 import pandas as pd def main(): # threshold = 5.0e-2 # threshold = 1.0e-12 # virus = "SARS-CoV-2" virus = "SARS-CoV" threshold = 1.0e-13 # fi_matrix_df = pd.read_csv( f"../result/SARS-CoV/Drug/F1/{virus}_drug_to_low_level_pathways_{threshold}_matrix.csv"...
1673754f3906f4bb33d73db32e22c1f76f34d6abebffb7377e91ccc5aa65ae0e
Python
3,111
90
import numpy as np import pandas as pd import matplotlib.pyplot as plt from deep_phospho.proteomics_utils.drawing_area import remove_target_spines from deep_phospho.proteomics_utils.drawing_area import set_thousand_separate def get_exp_ratio_idx(data: pd.Series, exp_ratio): data = data.cumsum() / data.sum() ...
20e8598aec2880ae61081ec1d38e3a8d9c6f9f6037b292381bcdf9dd419618de
Python
3,117
83
from typing import Type import numpy as np import pytest from cellfinder.core.detect.filters.volume.structure_detection import ( CellDetector, ) from cellfinder.core.tools.tools import get_max_possible_int_value @pytest.mark.parametrize( "linear_size, datatype", [ (254, np.uint16), # results in...
c373901df4e5fd1aadabd71f0936a2c8b897ebcb2f2f258d97cba15063e866bb
Python
3,120
101
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Computes average impact of each processing parameter for every analysis """ import itertools from pathlib import Path import numpy as np import pandas as pd REPO_DIR = Path('.').resolve() DATA = pd.read_csv(REPO_DIR / 'data' / 'derivatives' / 'pipelines.csv.gz') \ ...
c08355941364d2a859dc4a1e44becf6e04b851051d54bfee12de0a51238add09
Python
3,122
96
# encoding=utf-8 import matplotlib #matplotlib.rcParams['backend'] = 'SVG' import matplotlib.pyplot as plt from matplotlib.font_manager import FontProperties import numpy as np from pylab import * #mpl.rcParams['font.sans-serif'] = ['SimHei'] #simsun = FontProperties(fname=r'C:\Windows\Fo...
7967ddd482b8aa565d1999598207cf72ae0222a50ab4214ba1d1c24fc38902e5
Python
3,124
98
from typing import Tuple, Union import torch import numpy as np from utils.general import LOCALIZATION, SOLUBILITY class ToTensor(): """ Turn np.array into torch.Tensor. """ def __init__(self): pass def __call__(self, sample: Tuple[np.ndarray, int, int]) -> Tuple[torch.Tensor, torch.Te...
9216bc638422d12b02aa06ff166e166a3942b7c68b0d6fee104c65da7db4f376
Python
3,128
120
# 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...
f33dd620675db16ec64e84f37c8d397c86771d059d1f7132a6b61ed2357c58c0
Python
3,131
78
# @license # Copyright 2020 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...
deb2a00aaf12b9d3d518f2509994d2d7d65ac717d7b59d3ead3c5baeb9b98865
Python
3,145
114
from unittest.mock import patch import numpy as np import pytest from cellfinder.core.main import main @pytest.fixture def signal_array(): return np.empty((5, 50, 50), dtype=np.uint16) @pytest.fixture def background_array(): return np.empty((5, 50, 50), dtype=np.uint16) @patch("cellfinder.core.detect.de...
88158a5636b8ca0b0b7862aea072868933ef4ebb3af5a7fb4f2b3fc831c28821
Python
3,149
112
# 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...
1957d0fa0ab1be5295c303885516447d5983ad7998d9459b2da440582d850146
Python
3,152
88
# 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...
85ba1c6fcebff1adb6eb36a2212c95d1d2856ef922a3777411c88040f401f49c
Python
3,153
93
# 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...
15ffa0f19a3ade829ef6c2703d6786fcb2d2b397df5588e28df562d32090f757
Python
3,155
81
""" Forward models for both 1D and 2D CSDs. """ import autograd.numpy as np import scipy.integrate def b_fwd_1d(r, R): """ Computes forward model weight function b. :param r: vector of differences between spatial coords :param R: cylinder radius parameter R :return: values of b_fwd for elements i...
75dc2db43ce675b20f0ca4bd411a4b32da2e71717a4aaa08e96e3bc883e43227
Python
3,155
104
"""Helper module to expose function parameters as command-line arguments. Uses type annotations and default values for keyword arguments to parse user-provided command-line arguments to the desired type. ```python import argparse from Reactify.util import register_params, retrieve_params def read_input( in_dir...
f48dc6c47544faed38f3ea5f76e0646cdf760378d07536a9a035dd935e08cb59
Python
3,156
105
from unittest.mock import patch import numpy as np import pytest from cellfinder.core.classify import tools from cellfinder.core.classify.resnet import build_model def test_missing_weights(): with pytest.raises( OSError, match="`model_weights` must be provided for inference " "or continu...
7d8f75f0bdc739a15d6cfb0bcc167cf4213e8a4627b69bde1d92487ba8cb441b
Python
3,157
96
# encoding=utf-8 import matplotlib #matplotlib.rcParams['backend'] = 'SVG' import matplotlib.pyplot as plt from matplotlib.font_manager import FontProperties import numpy as np from pylab import * #mpl.rcParams['font.sans-serif'] = ['SimHei'] #simsun = FontProperties(fname=r'C:\Windows\Fo...
95d22384dba6b0d18efec10366f1dd25686f22b29fd55f7264a4b3956cfc0d1e
Python
3,158
96
# encoding=utf-8 import matplotlib #matplotlib.rcParams['backend'] = 'SVG' import matplotlib.pyplot as plt from matplotlib.font_manager import FontProperties import numpy as np from pylab import * #mpl.rcParams['font.sans-serif'] = ['SimHei'] #simsun = FontProperties(fname=r'C:\Windows\Fo...
20ccc156264fdcd5752131e565e5998b387dbcdc645b5179a29067689bcd1a6b
Python
3,165
95
from imlib.plotting.colors import get_n_colors import opendirection.combine.calculate_general as combine_calculate import opendirection.combine.cell_specific as cell_calc import opendirection.stats.stats as stats import opendirection.combine.condition as condition_select import opendirection.combine.cell_select as cel...
f29b97cf310aa79f4e20c50637f8d2849759dd9871fa5e210700edef03780391
Python
3,175
105
import getopt import os import pandas as pd import sys from pathlib import Path def remove_cols_2(df): """ Migration function to extract only the specified columns in teh DataFrame """ cols_to_keep = [ 'location', 'target', 'type', 'quantile', 'forecast_date', ...
62cc4c4190ab2b2680f024ec649e799ff71e0b7b7c7b679c5fecfb2398bd2e1e
Python
3,185
109
# If the work folder defined as Here, the folder will be where the config file in # Else define a specific folder WorkFolder = 'Here' ExpName = '' # TaskPurpose = 'Train' TaskPurpose = 'Predict' PretrainParam = './PretrainParams/IonModel/best_model.pth' Intensity_DATA_PREPROCESS_CFG = { 'MAX_SEQ_LEN': 74, ...
1b13074871ee1be4d14d68ece0d63740202d60488326bd5669d3ec753dd679b7
Python
3,191
132
#!/usr/bin/env python import os,sys import re import matplotlib.pyplot as plt import argparse import subprocess import numpy as np import collections parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter, description="plot likelihood profile for sequence ") p...
0a8948d99d058cb598a23c0b6c61ed7900bfdecf961cd8477be1ff176d839485
Python
3,193
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...
3b0388557ed1bfc912651988e6f32202787b6db8588b7ccfd9d7d675adbc6cb1
Python
3,196
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...
fc6eb0ebbdc79d4aca8a6fd16c890601cabf2a92deb4fed54b7f431919d1545e
Python
3,200
82
from . import rgb_hsl import numpy as np import matplotlib.pyplot as plt import seaborn as sns class PreColor: red_gradient = np.array(rgb_hsl.gradient_hsl((255, 218, 185), (35, 0, 0), 200)) / 256 green_gradient = np.array(rgb_hsl.gradient_hsl((240, 255, 240), (0, 35, 0), 200)) / 256 blue_gradient = np.a...
50c5f78dea1e483239652f6dc09ed28bd9620ed1fdf68d6c0ca63830342fef01
Python
3,207
84
# 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...
9d0e841851030a2df7145c8eaf5020ac2f45d55f31b7707727bb1d773af64e25
Python
3,210
101
"""Helper functions for YASA (e.g. logger)""" import functools import inspect import logging from contextlib import contextmanager LOGGING_TYPES = dict( DEBUG=logging.DEBUG, INFO=logging.INFO, WARNING=logging.WARNING, ERROR=logging.ERROR, CRITICAL=logging.CRITICAL, ) def _parse_log_level(verbose...
c6e84d3d4d2ec0749c9ec2ed363c63f3f28e43abd176ca07bb30b4d9d3090f45
Python
3,210
115
import sys import glob import os import numpy as np import multiprocessing as mp import matplotlib.pyplot as plt import matplotlib.image as mpimg from scipy.interpolate import make_interp_spline,BSpline #from scipy.misc import imresize #from scipy.misc import imsave from PIL import Image from imageio import imwrite d...
63cef7d7d9cc44f605251ad613f2a72bea7b8c92796c742cae86f951d9665be7
Python
3,212
68
# Before executing the script, we need urllib3. Run `pip install urllib3` # A simple script for automatically download the ihme-covid19.zip file and extract it import requests import os import sys import calendar import datetime def download_file_by_date(path, date): # metadata prefix = "https://raw.githubuserc...
b77f4ed5fb31e9ea98eca09df4a4610ad34d5762d08bc66b44e618af2ab32161
Python
3,224
73
import os import numpy as np from matplotlib import pyplot as plt from tqdm import tqdm from analysis.probe.probe_cell import get_cluster, get_all_clusters from analysis.probe.ctxt_manager_decorator import temp_setattr from analysis.probe.probe_field_of_view import ProbeFieldOfView from spike_handling import...
ad71cad99fef56b3805a4427fb10618df4cb50bdfb4cb4c91651e01bf36ae3a3
Python
3,227
65
import torch import torch.nn as nn import torch.nn.functional as F from sparsemax import Sparsemax class LogSparseSoftmax(nn.Module): def __init__(self, embeddings_dim=1024, output_dim=11, dropout=0.25, kernel_size=7, conv_dropout: float = 0.25): super(LogSparseSoftmax, self).__init__() self.conv...
e93de5f4ec9ac138998d7c3d01f0353301602171f71dd5484b4f276c336dc2d9
Python
3,241
90
# 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...
e0448b0ad3dc8f2d8f0f8f2112d10f4abb56f44bd5160fe8ae2ab5ec8b26ac57
Python
3,243
114
# If the work folder defined as Here, the folder will be where the config file in # Else define a specific folder WorkFolder = 'Here' ExpName = '' # TaskPurpose = 'Train' TaskPurpose = 'Predict' PretrainParam = './PretrainParams/RTModel/4.pth' # If use ensembl - A dict with key-value pairs as Encoder layer number:...
752e5ddc9efd32fec5ad47a596dda6232ee482806a5f61f44e110c68244ad75d
Python
3,249
120
# 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...
66549200ce015e5a2daf5a10cda15abb9477555fffdf9cbc4f20cff8a2ab004c
Python
3,253
90
#----------------------imports and environment--------------------------------- ##Neuron - Modell for the analysis## from ANNarchy import * setup(dt=1.0)#,seed=101) import numpy as np import os import scipy.io as sio from net import * # Present random chosen scene patches # R. Larisch, Technische Universitaet Chemnitz...
b45cdb4c1130478f3cb5fbd778e2c8543d3f8bb2e9eee017950a35a2e7c083c5
Python
3,254
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...
4e879668caf42a3a8cab6f0f2c52057a3ef28311a6491006b1e91a1564d7ec91
Python
3,255
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...
837c3b5f2e14a2612f3623a69687870d1667a43427d56ce3ebc0e84cd2ebf606
Python
3,257
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...
671c21b7b0f70f00acc95bb281241232d08c34f81a820a5985774c36dc23c7c4
Python
3,259
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...
7ea51c79e08b9f36b720e6ed1ee066db842f0151c27a811e6d15530fe709256c
Python
3,262
103
# 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...
829d1cbaa370b12cb7f25a203f132c7705582914ceedbc41d98a4913a75ff32e
Python
3,267
68
import cv2 # Import OpenCV2 #from opto import Opto # Import modules provided by optotune import numpy as np import sys import multiprocessing class ImageWriterProcess(multiprocessing.Process): def __init__(self, saveDir): multiprocessing.Process.__init__(self) print " ----------- Starting ...
acb8470be93b1141cc5fad0bcefa1edae3023df4145b06a4751108a8cf359f22
Python
3,276
106
# 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...
c7a2bbfb13c46372d40eaa4174ebf366b2973e1fe995509bf0bddbe78a1d72b0
Python
3,284
101
from PyQt5.QtCore import QSize from PyQt5.QtGui import QPixmap, QImage from PyQt5.QtQuick import QQuickImageProvider import numpy as np import matplotlib.pyplot as plt class PyplotImageProvider(QQuickImageProvider): """ This class implements TrackingImageProvider for pyplot graphs. If supplied...
ceca05cfa22b0c49490516d917dbe59ad3e65fb86224bb85a537e32250ce4dbe
Python
3,289
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...
1f69a57c8c45834498e53ca121f4db1f74725af67dbd6a9a8a2afaf81fdda010
Python
3,297
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...
561ffb5e19103df9ffe03cc87179e1014e0acfc60fe1925b495eb569377f96c9
Python
3,298
106
# 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...
df9867e0b1f9795b27b7587b5b21314657e890eca9b7ff4e7098d77ce52f73ac
Python
3,298
90
# 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...
1284a904985aa3ca3d8fba8eb324f12b486623f3b45a4e7cdf93caa0b678bce5
Python
3,300
104
import numpy as np import pandas as pd from stytra import Stytra from stytra.stimulation import Protocol from stytra.stimulation.stimuli import Basic_CL_1D, GainChangerStimulus from lightparam import Param from stytra.stimulation.stimuli import GratingStimulus, AcuteClosedLoop1D class ClosedLoop1DProtLS(Protocol): ...
13dd0081e40ee9aafc79ca48d462337958d88de4af944c24b78a9e793b3e2c97
Python
3,302
98
# 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...
a76d3d5906c7c703247e33689900dab822f838530503ca42a329675172986df3
Python
3,302
100
# 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...
f7d889d5bf27a88c2aeaa669b77e3e29b6ce5c38cb4dc7a33a11dd0616b41a0f
Python
3,303
106
# @license # Copyright 2016 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...
45a92827a361989d35b564b565286d0280aad8feee3b24a907a7d9ff1f22a991
Python
3,304
73
import matplotlib.pyplot as plt import numpy as np import os #------------------------------------------------------------------------------ # calculate the bit/spike information transmission after Vinje and Galant, 2002 # one time bin = 125 ms long-> every input presentation is one time bin #--------------------------...
9fb6a9398b57b0d25ec4d8b8de3e288acfd6159213d581565a3c395731b5b9c3
Python
3,304
105
# 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...
13606dc0e13ff164c243bc6eae43a3e757161faecd3cf97fa2ee09c8b76f3967
Python
3,306
121
# 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...
a2901fe3735558f0c86464dc042d058797269785cd7ad7f01ecb1bb5cb9f864a
Python
3,316
120
# 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...
273f2b35d0cb5f1b05a33d78d3da388da5731672f34e9fe750174615ded12233
Python
3,321
71
# @license # Copyright 2020 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...
31132d90457b14d6ec50459e941e6ecc7dd3e3c9e6ae5567d0ce8dc2fe581524
Python
3,326
85
from typing import Tuple import torch import torch.nn as nn import torch.nn.functional as F from torch import Tensor class JointCrossEntropy(nn.Module): def __init__(self, weight=None) -> None: super(JointCrossEntropy, self).__init__() self.weight = weight def forward(self, prediction: Tenso...
25add380e03212d9f385f9e933ce8754ca3947491151b98321fa92a98524e1ae
Python
3,334
106
# 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...
4d19bdb80f9b10e6c2f2640b2fc3e3226a42467ebc85186d7c1df2a4199959c8
Python
3,337
73
#! /usr/bin/env python __author__ = 'heroico' import metax __version__ = metax.__version__ import logging import os import copy from metax import Exceptions from metax import Logging from metax.gwas import Utilities as GWASUtilities import M03_betas import M04_zscores def run(args): if not args.overwrite and ...
a68306e4719dd1aa33641fd47799841afc2f73185862a59aefc50bab4a0161e7
Python
3,337
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...