sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
19d9193007c9f079987640f037cdcd9c5218f6d552a78516960d3ec9d3e8e90e | Python | 5,413 | 181 | # 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... |
5e32fe6002aaed185ea5aa74605fedbdd6fe7551c4c0fe7346aa62e42e4223fb | Python | 5,416 | 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... |
827c6470d9f93ed1a39abef5eb92ef1990acc1d7099fd898e938fe309d70438d | Python | 5,418 | 58 | import tensorflow as tf
#Class Description: Create autoencoder models
class Autoencoders:
#Description: Creates autoencoder with single output
#Parameters: originalDim = original dimension of data, bottleneckDim = size of bottleneck dimension, activation = activation function, hiddenLayerDim = dimen... |
f95a68fb065a25e8c3b6f9eec254777647295255877986ae59dcfa00b2fdbabb | Python | 5,418 | 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... |
004665c4356c5638b04968a4bc4445f0ff986685a030df686b2703292cc91f84 | Python | 5,420 | 179 | # 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... |
af2adb16a3d993e0a1e08d0b921e02a947fd35a8565628ce3006581aa3a20558 | Python | 5,432 | 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... |
7985962baf42877cdf8eb2e7b456148747c765644f3142f43866adaff142bd95 | Python | 5,437 | 159 | # module import
import numpy as np
# pyqt5 module import
from PyQt5.QtCore import QRect, Qt
from PyQt5.QtWidgets import QDialog
# custom module import
import analysis_guis.common_func as cf
# font objects
txt_font = cf.create_font_obj()
grp_font = cf.create_font_obj(size=10, is_bold=True, font_weight=75)... |
7f30eb2e2de4ef94a78f7a601160cd3a879553a3fc55f15ae66d8b1e88bf6186 | Python | 5,441 | 114 | import torch
import torch.nn as nn
from models.pytorch.pna.aggregators import AGGREGATORS
from models.pytorch.pna.scalers import SCALERS
from models.layers import FCLayer, MLP
class PNATower(nn.Module):
def __init__(self, in_features, out_features, aggregators, scalers, avg_d, self_loop, pretrans_layers,
... |
fca5b4be54c585c1e78015c1d75c94d5aeb5ab5dc8ad3370a5644589c978f92a | Python | 5,443 | 180 | import argparse
import logging
import math
import sys
import numpy as np
import rdkit
import torch
import torch.nn as nn
import torch.optim as optim
import torch.optim.lr_scheduler as lr_scheduler
from fast_jtnn import *
def main_vae_train(
train,
vocab,
save_dir,
load_epoch=0,
hidden_size=450,
... |
e5fb83ac6e952115fac3728f0e16d3d13911306306fa69f374a480b59f79eab7 | Python | 5,452 | 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... |
dd8d2311248fff7013083fecd6ed6c165713755c2880d45ee008ace46d64b395 | Python | 5,453 | 177 | # 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... |
c6eb5d7fb2d1f4587f7860e64d3a477f435ee7049f26293a3d3366def322f6c4 | Python | 5,456 | 180 | # 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... |
3462a0aae2c57ca72dfcd66fb677db291c8ef84964aa09253c402a39f1ceb78c | Python | 5,471 | 104 | import copy
from models import * # For loading classes specified in config
from models.legacy import * # For loading classes specified in config
from torch.optim import * # For loading optimizer class that was used in the checkpoint
import os
import argparse
import yaml
import torch.nn as nn
from torchvision.transf... |
ce87aa46249d371d7a6ffc36d9ba354560910d4f2292bc3a1778e3839853322e | Python | 5,485 | 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... |
0d56aca873ef160386f0280493ac8b236b1ec89b95827fd68b9ba20f5fbde55f | Python | 5,490 | 176 | # from mpn import atom_features, bond_features, ATOM_FDIM, BOND_FDIM
import rdkit.Chem as Chem
import torch
import torch.nn as nn
from .nnutils import create_var, index_select_ND
ELEM_LIST = [
"C",
"N",
"O",
"S",
"F",
"Si",
"P",
"Cl",
"Br",
"Mg",
"Na",
"Ca",
"Fe",
... |
f9a8326a189c9b272f4de06e3ebeb175c0fd975feee424cbd3ee2433ea058305 | Python | 5,492 | 149 | import numpy as np
import h5py as h5
from scipy.integrate import quad as INT
from scipy.integrate import quad
import scipy.special as sp
import matplotlib.patches as patches
# General
def save_to_group(group,dataset,label):
group.require_dataset(label,dataset.shape,dtype=dataset.dtype)
group[label][...] = data... |
dcf6479be3a7a0b54040e7c85dea229c98660f0bcbb7f8d528c4260c764e7094 | Python | 5,493 | 171 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... |
48fa170090ff72051d46555c974dd6c413df4456396ab5d9a41c8195524ea8ac | Python | 5,496 | 154 | from collections.abc import Sequence
from dataclasses import dataclass
from pathlib import Path
from typing import Optional
from magicgui.types import FileDialogMode
from cellfinder.core.download.download import model_filenames
from cellfinder.core.train.train_yaml import models
from cellfinder.napari.input_container... |
f925c237df7a6b2f4ffcaeb95769cb72f976bea74dc6dd40273504bfc545c1a7 | Python | 5,496 | 80 | # Argument parameters file
import argparse
def parse_args():
def str2bool(v):
assert(v == 'True' or v == 'False')
return v.lower() in ('true')
def none_or_str(value):
if value.lower() == 'none':
return None
return value
parser = argparse.ArgumentParser(descrip... |
336523cd8afa309111a253b158c9f388ff0e7b45867ce875bfcd32c9c711f63b | Python | 5,503 | 163 | from .data_struc_kit import str_mod_to_list
import re
def get_title2idx_dict(title_content: str) -> dict:
title_dict = dict([(__, _) for _, __ in enumerate(
title_content.strip('\n').split('\t'))])
return title_dict
def combine_delimited_text(*sn: str, delimiter=';', keep_order: bool = False) -> st... |
aa46a9ee21b38579561d9cc976eae684a860342db2efc954a86d702ab20169bf | Python | 5,511 | 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... |
cc230b3fa84cdfd499560b1bac3f19c14cff6f8f588e35f7f2a64b6b361eae28 | Python | 5,514 | 193 | # 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... |
c1d12ba4a2a33db68c6ca4dcdfeae1d8e988ee9e1595c0d4ac2128d2b7001365 | Python | 5,516 | 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... |
eedd4d158dc927c4d8d46908c0f9873e7d525230270e9bc6a194ec362e175129 | Python | 5,517 | 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... |
9f1a49862e32876dd0f037f6cb87e89003b6d63d279b178df307c1a4fdf6f79e | Python | 5,531 | 165 | #!/usr/bin/env python
"""
Training on a single process
"""
from __future__ import division
import argparse
import os
import random
import torch
import onmt.opts as opts
from graph_embedding import init_condition_transformer
from onmt.inputters.inputter import build_dataset_iter, lazily_load_dataset, \
_load_... |
1f81b05d0091ee77e73d1b887184e7ac03f388ef1cb705c1796b59ace6413dba | Python | 5,539 | 154 | from zoltpy.quantile_io import json_io_dict_from_quantile_csv_file
from zoltpy import util
from zoltpy.connection import ZoltarConnection
from zoltpy.covid19 import COVID_TARGETS, COVID_ADDL_REQ_COLS, covid19_row_validator, validate_quantile_csv_file
import os
import sys
import glob
from pathlib import Path
import ppr... |
60e11d8f30a3e733c68c68531a61cb1e3e64f20874830687b99638467e1dae41 | Python | 5,541 | 154 | import math
import os
import numpy as np
from file_handling import binary_classes
from margrie_libs.signal_processing.metadata_handling import store_meta_data
def detrend_single_channel(trace):
from scipy.signal import savgol_filter
return trace - savgol_filter(trace, 1001, 3)
def detrend_al... |
257398016b2d0750f153fd360383927d6f9537dfb81f9f8ccbdc0fa16c26b498 | Python | 5,543 | 179 | #!/usr/bin/env python
import numpy as np
import roslib
roslib.load_manifest('robotiq_2f_gripper_control')
import rospy
from robotiq_2f_gripper_control.msg import Robotiq2FGripper_robot_output as outputMsg
from robotiq_2f_gripper_control.msg import Robotiq2FGripper_robot_input as inputMsg
class RobotiqCGripper(objec... |
f81adf02c4f2027ce5d8a78b7a45e99bc08c470f93b479e5554c9d6ab90f0abb | Python | 5,545 | 108 | import pandas as pd
import datetime
import pymmwr as pm
'''
Get the epidemiological year, week and date of a given date.
'''
def get_epi_data(date):
# The format
format_str = '%Y-%m-%d'
dt = datetime.datetime.strptime(date, format_str).date()
epi = pm.date_to_epiweek(dt)
return e... |
7424eacf831aff197a49ad1d86b4e240ebf0bda64b3d2fbedc98677063899d21 | Python | 5,548 | 156 | """ Translation main class """
from __future__ import division, unicode_literals
from __future__ import print_function
import torch
import onmt.inputters as inputters
class TranslationBuilder(object):
"""
Build a word-based translation from the batch output
of translator and the underlying dictionaries.
... |
e97b5305ad4b8ae84ee2b19079f072b3cb00b5587db75a7070ab23e660c8345a | Python | 5,556 | 172 | import os, re, time
import glob
from ini.trakem2 import ControlWindow, Project
from ini.trakem2.display import Display, Patch, LayerSet
from java.awt import Color
from ij import IJ
import math
from ij.process import ImageStatistics as IS
from ij import Prefs
from ij import ImagePlus
argv = getArgument()
arg_array =... |
7af4c1d8553c3b4bad7b853331dc4d8e1be4a4bf0a4b759eede299f836b861d5 | Python | 5,572 | 180 | # 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... |
d5cfe61a15a549433ad9e44d9c9dc92bb6e4aee0fdda9a2649bab8661044e593 | Python | 5,573 | 169 | import os, re, time
import glob
from ij import IJ
from ini.trakem2 import ControlWindow, Project
from ini.trakem2.display import Display, Patch, LayerSet
from java.awt import Color
import math
from ij.process import ImageStatistics as IS
from ij import Prefs
from ij import ImagePlus
argv = getArgument()
arg_array =... |
c99cffacd7285269d43ba954f6c41fa979722a19ce89f54de4efe0b42d915554 | Python | 5,577 | 206 | # 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... |
33e5392fce7c6dc38cab81d21c842092ee938d6870928475f75e4af9f5b2966d | Python | 5,582 | 163 | # 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... |
405362d141be721f24666fb6e1d0eab731244dda353b7cc809d0577ad015016c | Python | 5,586 | 142 | from deep_phospho.proteomics_utils.constants import BasicModification
from deep_phospho.proteomics_utils import rapid_kit
class ModOperation(BasicModification):
def __init__(self):
"""
self._mod_rule stores the mod rule for peptide. Default is pre-defined StandardModRule.
self._mod_rule_di... |
83ab58997ad82d261fdfdc17c2994f6d2fdfa197d2c9a851187cc1607afc1797 | Python | 5,588 | 160 | #!/usr/bin/env python
# coding: utf-8
#
# Author: Kazuto Nakashima
# URL: http://kazuto1011.github.io
# Created: 2017-10-30
from __future__ import absolute_import, print_function
import os.path as osp
from glob import glob
import cv2
import numpy as np
import scipy.io as sio
import torch
from PIL import Imag... |
f6b2e28ef09148002922f392fb9e7b33c52b01886da5b6aa839e8cf77f76f8f3 | Python | 5,596 | 150 | import torch
from typing import Any, Callable, Dict, IO, List, Optional, Tuple, Union
import numpy as np
try:
import od_models as od
except ModuleNotFoundError:
import deepgravity.od_models as od
def my_collate(batch):
data = [item[0] for item in batch]
target = [item[1] for item in batch]
ids = ... |
a458ec778a881cff7b728c0fec0bac18faf6b3242341ad35953ada45dc6b19e3 | Python | 5,601 | 108 | import types
import torch
import torch.nn as nn
import torch.nn.functional as F
from models.layers import GRU, S2SReadout, MLP
class GNN(nn.Module):
def __init__(self, nfeat, nhid, nodes_out, graph_out, dropout, conv_layers=2, fc_layers=3, first_conv_descr=None,
middle_conv_descr=None, final_acti... |
a0df117f0d54925411d4781a3ee140c917e5875a638939efc4e7304a62f2cb42 | Python | 5,611 | 174 | # 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... |
bd92a3db4749ebfb251c9f888bd59653699a964dba9f5014ed24630cd4099d2c | Python | 5,611 | 174 | # 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... |
39b95d282fdefc4e98d601c2a43c617f227b708123d755c2e953bdb50f7f848f | Python | 5,614 | 132 | import os
from mskit.inherited_builtins import NonOverwriteDict
def read_prosit_fragment_result(prosit_result):
"""
'[Oxidation (M)]'
'[Carbamidomethyl (C)]'
"""
with open(os.path.abspath(prosit_result), 'r') as prosit_handle:
prosit_title = prosit_handle.readline()
title_dict = di... |
bafa1a3357aace3f028d1ad2ea88705a4dbd8ce9c42b5a79241bf0bf4a045fd8 | Python | 5,621 | 164 | # 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... |
48c1e39245536213431762353371a152414ddedd977ad4994fb3f2c4302543b8 | Python | 5,626 | 174 | # 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... |
278ec010875498428022fa03658d296738a4fe3f16e55308927ef56f3d9ad693 | Python | 5,628 | 172 | # 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... |
16da3a23215cc8f5f26a76a328791f64c30715213f1fe0b0aee19ac288adb4b7 | Python | 5,646 | 166 | """
Implementation of "Attention is All You Need"
"""
import torch.nn as nn
from numpy.core.multiarray import ndarray
from torch import Tensor
from Graph3dConv import Graph3dConv
from graph_embedding import get_emb
from onmt.GCN import *
from onmt.MYGCN import *
import time
import onmt
from onmt.MPNNs.MPNN import *
i... |
a66d90ba6869532c05863ad311d13534fdee33faf5b002922ac2ae8facdd8952 | Python | 5,667 | 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... |
c9fb6e358704a0d9030951eb0b83b0d492c895aa00bd7d7569a1275597e4fb34 | Python | 5,697 | 184 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... |
37ab939933f9e574b17e5bddf5d984d06908e8468d834b34b3209a9aec09eaf6 | Python | 5,723 | 183 | import csv
import numpy as np
from scipy import signal
import matplotlib.pyplot as plt
from firecracker_time_series import firecracker_time_series
# 6 "Admin2" county (Montgomery)
# 7 "Province_State" (Alabama)
# 9 & 10, latitude and longitude
# 12 to end index series
#
# -1 for corresponding index
# approximate radi... |
0b37184fc4fa1b77f53f0a4962d2780c30ad4b551f159dfdd866a335e9ee5f51 | Python | 5,726 | 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... |
1f9b5522059226cf431e6d00237ab73a8c65decd604274b97f9e839e1778821c | Python | 5,732 | 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... |
33260fdc5456bbce4e934b4ddae561b3298493fb2653e4bbc077fd974f4cf79c | Python | 5,741 | 157 | import math
import os
import h5py
from Bio import SeqIO
from tqdm import tqdm
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
sns.set_theme(style='whitegrid', rc={"xtick.bottom": True}, font_scale=0.9, font='Verdana')
plt.rcParams["figure.figsize"] = (8, 4)
plt.rcParams['... |
e03f5917576fbc80c744a7f4f82e7f7c97e02ff043a1d362828a5a1644f6292d | Python | 5,741 | 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... |
dcbdba7a7ba1d6408bdb673655209cc9adfee8fe23ed1d1967072b3a4a3053ff | Python | 5,757 | 157 | import math
import os
import h5py
from Bio import SeqIO
from tqdm import tqdm
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
sns.set_theme(style='whitegrid', rc={"xtick.bottom": True}, font_scale=0.9, font='Verdana')
plt.rcParams["figure.figsize"] = (8, 4)
plt.rcParams['... |
7fb3459ffc96956b7b703f6ba5e3f6bdf4c1fb13e43361cf4440c629cdd98f98 | Python | 5,761 | 138 | import pygame
import logging
import serial
import numpy as np
import time
import datetime
import simpleaudio as sa
fs = 44100 # 44100 samples per second
seconds = 1 # Generate a note duration of 1 second to be embedded in the video
# Generate array with seconds*sample_rate steps, ranging between 0 and seconds
t = n... |
1d95e4fd7aa7cdaef4ab82a7f2740ef137cc10b341000b81183f3cb913e1c15c | Python | 5,768 | 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... |
4c343ba3966ebd9d6c49e6f0de0dd3440632260a94bf8b1f23e59c8b2cf2b6ba | Python | 5,771 | 203 | # 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... |
f654211bc709139653ead8964926c38024a661af64e9cb8dae57d620b3641921 | Python | 5,776 | 157 |
"""
Visualize torus graphs bootstrap computed by fit_torus_graph.m on Neuropixels data.
Generates Figure 6 B/C from paper.
"""
# %% imports
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import os
import scipy.io
import networkx as nx
import scipy.special
import os.path
root_path = '/'.join(os.pa... |
6d86092729885fc3e5c7d4e8cca75c3e4045613ad1a5cfaa9bf5524ed75d9c4e | Python | 5,784 | 160 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... |
b7c8c778a7d90d20dcbadf65c05cfeee20cdb3109ab33b636ba466b53c5b0ff8 | Python | 5,786 | 157 |
"""
Visualize torus graphs bootstrap computed by fit_torus_graph.m on Neuropixels data.
Generates Figure 6 B/C from paper.
"""
# %% imports
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import os
import scipy.io
import networkx as nx
import scipy.special
import os.path
root_path = '/'.join(os.pa... |
dd7af9c3a3e8bfa0e4369c61e1dcfd8a33afc914f6c22438dc5f6956cb460353 | Python | 5,787 | 236 | # 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... |
c96a2db0a0ac76e5f18f541384a4015b11831836352139d14592c76f0bffd946 | Python | 5,790 | 115 | import matplotlib
from analysis.probe.ctxt_manager_decorator import temp_setattr
matplotlib.use('QT5Agg')
import os
import matplotlib.pyplot as plt
from tqdm import tqdm
from analysis.probe.probe_io.probe_io import TriggerTraceIo, BonsaiIo, IgorIo
from analysis.probe.probe_field_of_view import ProbeF... |
a490a2ed69037e2f64fcf2d181123e30c0ae021ff506a3907ff83b82cdfeacf5 | Python | 5,801 | 162 | # 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... |
f63ae7dfa32246c32fa79eca20e5d3e75a8f7e78ffdecaf91286370279e16b03 | Python | 5,809 | 170 | import re
import pandas as pd
import numpy as np
from .text_kit import substring_finder
def select_row_with_target_col(df, ident, colname, return_col_list=None):
_df = df[df[colname].str.contains(ident)]
if return_col_list:
return _df[return_col_list]
else:
return _df
def extract_df_wit... |
dc859efad3084466908b0579748bb66467cd16becb6d8943e4824d4fd82339b1 | Python | 5,810 | 207 | # 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... |
aeded001aa08d29d44b6f67ebf18f4e05d8e846dac047a584e2ae899b3f59fe7 | Python | 5,832 | 117 | from truth_utils._utils import get_epi_data, read_fips_codes, pre_process_truth, pre_process_epiweek, get_raw_truth_df, extract_raw_us_and_state_truth, extract_raw_county_truth
import pandas as pd
import datetime
import warnings
warnings.simplefilter(action='ignore')
def get_byday (df_truth):
# only output "locatio... |
fa88efce58b06b591462b044222dda6696e5297b61721e31d71616212c8607d6 | Python | 5,837 | 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... |
a7759a8eff758e1d1e89db6fc22dfde20be0ef2f18dbce0a7651d25f709b0e87 | Python | 5,838 | 157 | import os
import numpy as np
import h5py
import tensorflow as tf
import keras
import keras.backend as K
############################################
### Function to load data in h5py format ###
############################################
def load_data(path_to_data):
data = h5py.File(path_to_data,'r')
X_test... |
97c7b297575d451cc2b6443af1bb5c82d4e8a0d505f20f873b21211f40f4cfec | Python | 5,841 | 188 | # 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... |
7063dd8a8d243b02b2f075ab91eca7cab3bbb8e184225a39daaa479115840b91 | Python | 5,850 | 179 | # 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... |
f92fad2e57246bcc12c8795ef1281e25556c9533ab23f0614c6065d76f61b23b | Python | 5,850 | 164 | # 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... |
3907b175ebeb598029da5c85dddf982f0f80f1bb86e1162f4171f1aedfef0be7 | Python | 5,868 | 152 | import math
import torch
EPS = 1e-5
# each aggregator is a function taking as input X (B x N x N x Din), adj (B x N x N), self_loop and device and
# returning the aggregated value of X (B x N x Din) for each dimension
def aggregate_identity(X, adj, self_loop=False, device='cpu'):
# Y is corresponds to the eleme... |
632fdd6c106b3dea6de8fd325df789845c1e1f812efa5eaf3e9d7501d55741b1 | Python | 5,875 | 131 | # -*- 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
-----------... |
83d80227d115800c6d16a8f0a5ccee19262daa963a7b86b3af5791472066bcff | Python | 5,882 | 131 | # -*- 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
----------... |
c69ae03ae24aa6524eab61f2b2fec61c5938822fd225bdd4594406f1d24ec066 | Python | 5,886 | 188 | from gcn.inits import *
import tensorflow as tf
flags = tf.app.flags
FLAGS = flags.FLAGS
# global unique layer ID dictionary for layer name assignment
_LAYER_UIDS = {}
def get_layer_uid(layer_name=''):
"""Helper function, assigns unique layer IDs."""
if layer_name not in _LAYER_UIDS:
_LAYER_UIDS[lay... |
c9ec1d98db44851e7484fdc472a5aeaabbd00394c56dcc0179048f26069ed8ec | Python | 5,888 | 217 | # 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... |
88d268c1e0ef0185d9fa1cadc08d98c971f2f98b7ca32f92f109b519a83ae270 | Python | 5,889 | 133 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 1 20:33:32 2019
@authors:
Luz Santamaría Granados (luzsantamariag@gmail.com)
Juan Francisco Mendoza Moreno (jfmendozam@gmail.com)
"""
from datetime import datetime
class Preprocessing:
""" Consolidates and preprocesses the dataset of... |
159db4e3773c5a3c72d35b104e7814f15eaf0dbe6aef0c4d474f909382929eee | Python | 5,901 | 187 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... |
2a2dedb84697035db97c2438d83f55e84da621f7e68a6df0d3fd6ed49ab37155 | Python | 5,903 | 132 | # 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... |
66c90d7ed445f053030e976556b5c83fabb3b4e68cf1e2657f208c8d170ccaba | Python | 5,908 | 129 | import tensorflow as tf
from helper_functions import *
class DataGenerator(tf.keras.utils.Sequence):
"""
A class to load in data via a DataGenerator and perform PXRD augmentations
"""
def __init__(self, data_directory, list_IDs, labels, X_random=np.zeros((100,9000)), batch_size=64, dimx=... |
547ead1b471bcdf73e0052831166f58a296527a8cee0fceb46115044f4020ac3 | Python | 5,915 | 159 | """
Simulate some data with a simple template CSD (dipole-like with one spatial dimension),
compare GPCSD to traditional CSD and kCSD estimation with and without noise.
Produces Figure 1 in the paper.
"""
# %%
import matplotlib.pyplot as plt
import numpy as np
import time
from gpcsd.gpcsd1d import GPCSD1D
from gp... |
025a289f7ba33e393fb63090023d4b2436ab5cdc1909628c229e5ac36094b881 | Python | 5,920 | 107 | from models import * # For loading classes specified in config
from models.legacy import * # For loading classes specified in config
from torch.optim import * # For loading optimizer class that was used in the checkpoint
import os
import argparse
import yaml
import torch.nn as nn
from torchvision.transforms import t... |
962f60142c56f0b7bff1fedecd4c74d3d97bad6c779f2adc1afb1dd827910c1c | Python | 5,932 | 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... |
c00343dcc50e68670fa533d6258fe2c6a66aea08463be7a7d34cf88ad16a17b9 | Python | 5,937 | 198 | # 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... |
e5fb75458aad2e4ba106ef73dcc2b6fb084f53ed8bf4b364a6512f0baed182eb | Python | 5,937 | 151 | # 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... |
92421338af5ba9a16b6c9dc60a5e711c003859fcaaf67e05b5c5823a02e0f413 | Python | 5,946 | 161 | """
Simulate some data with a simple template CSD (dipole-like with one spatial dimension),
compare GPCSD to traditional CSD and kCSD estimation with and without noise.
Produces Figure 1 in the paper.
"""
# %%
import matplotlib.pyplot as plt
import autograd.numpy as np
import time
from gpcsd.gpcsd1d import GPCSD1... |
a46486792006b19fe7ae8cef09b4b4eee79f2647a2be123f246b5656958f9697 | Python | 5,965 | 205 | # 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... |
df3d6ceb14cf32a42601cbfbfc122dc2923f07a86d716a52697e12d9130e17c9 | Python | 5,968 | 205 | # 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... |
126ba2d23933c96a4814f9adec2c8f1e93e1acb92ed9d4cb9cb6a37da79d8946 | Python | 5,975 | 205 | import ctypes
import ctypes.util
import numpy
import time
import cv2
import hamamatsu_camera as hc
#print "camera 0 model:", hc.getModelInfo(0)
hcam = hc.HamamatsuCameraMR(camera_id=0)
# Set camera parameters.
cam_offset = 100
cam_x = 2048
cam_y = 2048
hcam.setPropertyValue("defect_correct_mode", "O... |
86c2fe9bb2b380bfee500e4cb5751c4fcebbfaf3151fc643b66cd4db68c6d466 | Python | 5,984 | 197 | # 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... |
12243cd432cde9cc073bc6226d2a7d24d57e24b6b3e3e8ba09c801b9deb073a4 | Python | 5,985 | 167 | # 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... |
5e52c38d802f6c08778afb384b5810bc4c3f8d30da04e470f2fc7c72e88fe88d | Python | 5,986 | 196 | #!/usr/bin/python3
# Plots the proportion of articles that use a given set of terms over time
import os, re
import pandas as pd
import numpy as np
def flip_dic(dic):
flipped = {val: [] for val in set(dic.values())}
for key, val in dic.items():
flipped[val].append(key)
return flipped
def load_data_from_re... |
e1b01179e32fbe1b9ae107956b99fe156796ad2e775f1e2279b761f1d93c4084 | Python | 5,990 | 158 | # 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... |
5bf95144981a94729bbe86a63ad45b770b69bd8780d21334ebc0e2a92c3bfa13 | Python | 6,005 | 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... |
1a7ccaee5e1a3724e8eb4451bab71fc70eebc75fe9e37fc10259750d4f6dac22 | Python | 6,008 | 161 | # coding=utf-8
# @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 ... |
ed966605742a755c50ea32198acdb42460544f276fb9d448bb8b53c08b9e4e27 | Python | 6,017 | 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... |
9b5945dbcd3e39b31bc3d750cee7b9f3e9a45539fb36a49b9dc27815352c6164 | Python | 6,022 | 179 | # 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... |
4dbee03ccbf7d34ca74b1630b169ce5e1b9fd0ad3e3e03389525363581bec708 | Python | 6,033 | 188 | import numpy as np
import matplotlib.pyplot as plt
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
from imlib.array.size import pad_with_number_1d
from imlib.general.exceptions import ArgumentError
from imlib.math.trig import sine_min_max, get_scaled_sine
def sine_from_peak(
peak,
num_sa... |
fe2e1ca0319ffb87a7f828bc9d3d26b3f97fb55de968830c10cee5b617a8091b | Python | 6,033 | 159 | # 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... |
c826975cca03f45dbecaec742ab863963ccedf3234f789e0ff05b1a833899d0f | Python | 6,034 | 211 | import multiprocessing as mp
import pytest
from cellfinder.core.tools.threading import (
EOFSignal,
ExceptionWithQueueMixIn,
ExecutionFailure,
ProcessWithException,
ThreadWithException,
ThreadWithExceptionMPSafe,
)
cls_to_test = [ThreadWithException, ProcessWithException]
class ExceptionTes... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.