sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
e15d60b1c6fbbb62013acf99861bc0526ab8e27a574e526a024470aef0dd26aa | Python | 16,352 | 356 | import numpy as np
import scipy
def calculateLatencyParameters(eventSamples, baselinePeriod, samples, spikes, units=None, sampleRate=20000, numShuffles=100,
JSwindow=[0,10,0.25],resetRandSeed=True):
"""
Calculating latencies with distribution of first spikes following onset of s... |
456488710fc6715c8fc76d4ead828702dc97dc3475727a88c95c4afcea7e60ef | Python | 16,420 | 476 | from collections import defaultdict
import rdkit
import rdkit.Chem as Chem
from rdkit.Chem.EnumerateStereoisomers import EnumerateStereoisomers
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import minimum_spanning_tree
MST_MAX_WEIGHT = 100
MAX_NCAND = 2000
def set_atommap(mol, num=0):
for atom i... |
757b33255b8f436e24b3bd7959ee8bd30a7f39c6cb285a220a2879103a001256 | Python | 16,468 | 433 | # 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... |
cb78236b89ca269918e1005ac5e9954a3575e808587a6d5c87a1d41999664679 | Python | 16,472 | 488 | import math
import pytest
import torch
from monai.transforms import RandAffine
from cellfinder.core.classify.augment import DataAugmentation
@pytest.fixture
def cube_with_side_dot() -> torch.Tensor:
# DataAugmentation.DIM_ORDER of (c, y, x, z)
data = torch.zeros((2, 11, 11, 7))
# put dot in channel 0 at... |
e427769ec817756cc98f182e6b87ad07a8bba5bbcdc6abb473225861d6ebc995 | Python | 16,517 | 401 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 1 20:33:32 2019
@authors:
Luz Santamaría Granados (luzsantamariag@gmail.com)
Juan Francisco Mendoza Moreno (jfmendozam@gmail.com)
"""
import firebase_admin as fb
from firebase_admin import credentials, db
from pymongo imp... |
1c4d318a69d63d0b4d41bde24d56ae1d42002ed6ff365613c07522b0f8f2f6ae | Python | 16,557 | 448 | # -*- coding: utf-8 -*-
# @Author: sf942274
# @Date: 2020-04-01 08:09:19
# @Last Modified by: Weiyue Ji
# @Last Modified time: 2021-06-06 17:52:02
import os, sys, pickle, datetime, time, warnings
import pandas as pd
import numpy as np
import skimage.io as skiIo
from skimage import exposure, img_as_float, filter... |
451586c9558a6f2e97999fdab17b200e9ddaaa114adcb7676af6eedf3bfe957d | Python | 16,575 | 441 | # 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... |
8fde813bcfeba41f72f3c6a79e890c05295f5e3254f72343dcf034ae3a5deb45 | Python | 16,633 | 583 | import logging
import random
import numpy as np
import multiprocessing as mp
from scipy.stats import percentileofscore
from imlib.general.system import sanitize_num_processes
import opendirection.spikes.tools as spike_tools
import opendirection.tools.tools as tools
MIN_PROCESSES = 1
def apply_random_sign(number):
... |
4180c17bc874b5bea3ac2b0b31cb070e9cb7d07edf016436c4645421062248bd | Python | 16,658 | 458 | """ Base Class and function for Decoders """
from __future__ import division
import torch
import torch.nn as nn
import onmt.models.stacked_rnn
from onmt.utils.misc import aeq
from onmt.utils.rnn_factory import rnn_factory
class RNNDecoderBase(nn.Module):
"""
Base recurrent attention-based decoder class.
... |
72cca5f643041a502bde1db2983470d82f62f9bd3f589877672bdba3f60f4411 | Python | 16,670 | 422 | # 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... |
cefeea9b79fa0436b2b75b37c3a5d2af7c946971b446794648c85ccb94724e8a | Python | 16,685 | 324 | import scipy.io
import numpy as np
import matplotlib.pyplot as plt
import analyzeMEA.rastPSTH
import scipy.ndimage
def extractLaserPositions(matFile, voltageToDistance=3.843750000e+03):
"""
Calculate the positions of the stimulus at each point.
input:
matFile - str, path to file generated from stimulu... |
a910539ff621314f2934dc0db4edf9f2c861f5f47dbc92ddf510284ea3bfe8cb | Python | 16,736 | 434 | """
Written by Dr. Elishai Ezra Tsur
@ The Neuro-Biomorphoc Engineering Lab (NBEL-lab.com)
@ The Open University of Israel
@ 15.9.2020
"""
from enum import Enum
import sympy as sp
import numpy as np
ARM_ACCURACY_IN_METER = .001
class Optimizer(Enum):
""" Designation of an optimization method for inverse kinemat... |
618e8edd6148f99a7fc8b04d289fe3a034b3f9405b716ea62613eac2c9066193 | Python | 16,749 | 489 | # 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... |
399251b2338130d961db18c8b41be83cde56aff60127754d2128d9d36b59caf4 | Python | 16,764 | 418 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 30 19:58:25 2020
@authors:
Luz Santamaría Granados (luzsantamariag@gmail.com)
Juan Francisco Mendoza Moreno (jfmendozam@gmail.com)
"""
import pandas as pd
from pymongo import MongoClient
import json
from OntoTouTraData import Ont... |
1514894902ff28a59f254328722794f0c09649b2c3f2c8baff5b9a4fb9f7c3d3 | Python | 16,765 | 478 | """
Container for all the settings used during 2d/3d filtering and cell detection.
"""
import math
from dataclasses import dataclass
from functools import cached_property
from typing import Callable, Optional, Tuple, Type
import numpy as np
from brainglobe_utils.general.system import get_num_processes
from cellfinde... |
dd3f359e34816ec778fe2ae07fc88a54809a7282c75a1eb4d9679bdae5246d4f | Python | 16,799 | 300 | import copy
import inspect
import os
import shutil
from typing import Tuple
import pyaml
import torch
import numpy as np
from models import *
import warnings
from sklearn.metrics import matthews_corrcoef, confusion_matrix, f1_score
from torch.utils.data import DataLoader, RandomSampler, Dataset, Subset
from torch.util... |
a4daf03472149b59c592cc34eeba8fc09c89ea5c84b9d422995e86d05337c5c3 | Python | 16,843 | 341 | import scipy.io
import numpy as np
import re
import glob
import os
import pandas as pd
def importJRCLUST(filepath, annotation='single', depth=250):
"""
Imports the features of the JrClust output I use most.
inputs:
filepath - str with path to S0 filename
annotation - str that indicates whi... |
74ff5035665b83708affce58fab8db95c1a4a04ba835ca57ed9126cfef3348a1 | Python | 16,847 | 492 | # 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... |
354c80fd47ddf3018359d3e0ad061f6c7957f259c78951e4e4fb7b7320e8e856 | Python | 16,857 | 460 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#@author: kushal
#Chatzigeorgiou Group
#Sars International Centre for Marine Molecular Biology
#GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
"""
A bunch of functions from various Mesmerize modules that are used
in the notebooks that the entire Mesmerize package ... |
1c31df83a49052820ee932ca92d4b9433c82df36f5f2d3afd538181887d4cba5 | Python | 16,859 | 642 | # 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... |
3fdd89b0e17f453441f02f0a9ad5dfdfb10ff77eadf3e4737603c2dbc5907a7f | Python | 16,892 | 377 | import copy
import datetime
import json
import logging
import os
import random
import time
from functools import partial
import dill
import numpy as np
import termcolor
import torch
from torch.utils.data import DataLoader
from deep_phospho.model_dataset.dataset import IonDataset, collate_fn
from deep_phospho.model_da... |
322a95b3ce0b9e1462099b1326cc33bb9b9b94561d7b8720f11bc684c573a757 | Python | 16,920 | 434 | import os
import warnings
import numpy as np
from cached_property import cached_property
from configobj import ConfigObj
from margrie_libs.margrie_libs.signal_processing import mat_utils
from margrie_libs.margrie_libs.utils.print_utils import print_rule
from scipy import io
from rotation_analysis.resample i... |
b7248ecab4b9df2d34eb44b3dfc810319d4493f0d81802a260d1ef045b05abd6 | Python | 16,960 | 263 | import torch
import torch.nn as nn
import numpy as np
from muscularArmClass import muscular_arm
from torch.distributions import normal
'''Modifications from the manuscript simulation settings for reach task:
To enable relatively faster optimization, time durations have been reduced
from the original artic... |
3efad0cd6f7596bb4f6203a73494d5c766db6d0a48aa8c5ffd038d5e05d5b688 | Python | 17,026 | 377 | import torch
import torch.nn.functional as F
from torch.nn.init import xavier_uniform_
from torch.nn import (
LayerNorm, Linear, Dropout,
Module, ModuleList, MultiheadAttention
)
from deep_phospho.model_utils.utils_functions import get_clones
# 从pytorch 1.4里 copy出来的transformer的实现
class Transformer(Module):
... |
9e037e86f347d3b2107ebcb2892ba36b95413503d76239843fc32dbdf89a41c3 | Python | 17,099 | 493 | #!/usr/bin/env python
""" REST Translation server """
from __future__ import print_function
import sys
import os
import argparse
import time
import json
import threading
import re
import torch
import onmt.opts
from onmt.utils.logging import init_logger
from onmt.translate.translator import build_translator
class Ti... |
95e741f7c9fdafc0dfb56513423206640dd2992d13d17a970cad7b80346d7f57 | Python | 17,138 | 444 | #!/usr/bin/env python
"""
This modules uses three files:
1) *_confounds.tsv
2) *_preproc.nii.gz
3) *_brainmask.nii.gz
The confounds signals are regressed from the original fmri data.
Optionally, the user can ask for the scrubbing mask to be calculated
AND the contaminated volumes to be removed fro... |
4f991015e22825a1c67949a63504aaa25598730d4a94e16f283ccaa8c114ae3a | Python | 17,173 | 419 | # 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... |
f69fb3cbd7545e3bc3f22937f015d086d64cd3bc37f0827bdea6b5a7cfd2584b | Python | 17,183 | 497 | # 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... |
12a70e171a284fd54173193553eff203967f8bfec07b7f47b574766f6e9ea0f1 | Python | 17,214 | 482 | # 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... |
1294450aba911f38ca5257660cfb4ccc94461944d725e51644f81fcf251f9d01 | Python | 17,239 | 337 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'advanced_settings_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):
... |
c8eb9b39e010c13a6b6640a598e1b3cfd114a52071aa38621de1f3ed8246b503 | Python | 17,281 | 489 | # module imports
import copy
import functools
import numpy as np
# pyqt5 module import
from PyQt5.QtCore import QRect, Qt
from PyQt5.QtWidgets import (QCheckBox, QDialog, QHBoxLayout, QPushButton, QGridLayout, QGroupBox, QComboBox,
QLineEdit, QCheckBox)
# custom module import
import analy... |
7b3431b3b44720fabd61507b8c2db4cc03e7d0ee87484236722e17b3948ab724 | Python | 17,291 | 518 | # 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... |
9088352487b226e88839fb5c47e42e6bbe4a87ae517e29d2ab7801865704da1b | Python | 17,340 | 394 | """
IMPORTING LIBS
"""
import numpy as np
import os
import time
import random
import argparse, json
import torch
import torch.optim as optim
from torch.utils.data import DataLoader
from tensorboardX import SummaryWriter
from tqdm import tqdm
class DotDict(dict):
def __init__(self, **kwds):
self.up... |
26d271599f050b7fff3f88950025751d2b381862a2381c5b64669f690a7719cd | Python | 17,371 | 437 | """Test the functions in the yasa/others.py file."""
import logging
import numpy as np
import pandas as pd
import pytest
from mne.filter import filter_data
import yasa
from yasa._validation import _check_data, _check_hypno_include
from yasa.hypno import Hypnogram
from yasa.others import (
_index_to_events,
_... |
dca8ee5a272565bef3c5c74c7828590ade1ab2ab608eb1bde1353e42c25d2310 | Python | 17,672 | 496 | import math
from functools import lru_cache
from typing import Optional
import numpy as np
import torch
import torch.nn.functional as F
from cellfinder.core.tools.array_operations import bin_mean_3d
from cellfinder.core.tools.geometry import make_sphere
class InvalidVolume(ValueError):
"""
Raised when the v... |
c94847e95fd9e6fa94361048c736bc6509d7d3e87de5075887657c18b0c7aa3b | Python | 17,690 | 598 | # 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... |
1e9f7ce62086227e4798b4de57637e7c82f4b7570dd97f55d92b3afe2f58d0d6 | Python | 17,707 | 493 | # 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... |
a30f6d96552e27fdfc9a243c0de6157f4e1b505f3f6bebcbfd96881c3d499c1c | Python | 17,709 | 493 | # 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... |
0c12f495688a82a1708a5795998943dfd08b38439379e9134c3482afa56d445a | Python | 17,870 | 441 | # 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... |
0cbd3031efed3033f9b665b0f3b3f07e8b558d8ee61f5076a1627ec2ed7ad2cd | Python | 17,883 | 484 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 1 20:33:32 2019
@authors:
Luz Santamaría Granados (luzsantamariag@gmail.com)
Juan Francisco Mendoza Moreno (jfmendozam@gmail.com)
"""
from collections import Counter
from scipy import signal
import numpy as np
import matplotlib.pyplot as ... |
41e609a3ca2b12e819def90c1ca29f2d9bf544e664e2005a59638a7ef688aaa9 | Python | 17,891 | 490 | # 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... |
e5d7938a7a112dab2843a6702dec4ca0f97c0e177efbbc28b01cd5b131a2f643 | Python | 17,895 | 490 | # 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... |
d31057dd0443a920b89b959e770817ef01f70304954e078a19c65203eeb5c7aa | Python | 17,916 | 347 | import jax.numpy as jnp
from jax import value_and_grad, checkpoint, jit, lax
import optax
import time
import warnings
from jax_md import util, dataclasses
from DiffTRe import custom_simulator
def compute_energy_trajectory(trajectory, fixed_reference_nbrs, neighbor_fn, energy_fn):
"""
Computes potential energ... |
2e14fd06ac5fd0c671e89773414c114f3d5a27a84100c1b929a8397d3943b8a4 | Python | 18,024 | 495 | # 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... |
a85381630fccd22e5c47dca049e205a3efb3c6bb0597f9eff7e695a77691e637 | Python | 18,055 | 528 | import logging
from collections import defaultdict
import rdkit
import rdkit.Chem as Chem
from rdkit.Chem.EnumerateStereoisomers import EnumerateStereoisomers
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import minimum_spanning_tree
from .vocab import Vocab
MST_MAX_WEIGHT = 100
MAX_NCAND = 2000
de... |
c3061a9ac6f9dd8f26c1a66138c75130104c7d0d6ff47e40acb49596f9394e24 | Python | 18,111 | 491 | import configparser
import os.path
from imlib.general.list import unique_elements_lists, strip_spaces_list
class GetOptions:
def __init__(self, options_path):
if os.path.isdir(options_path):
options_config = os.path.join(options_path, "options.ini")
else:
options_config = ... |
bd323517e451d28434a0c94e7975e50295802f6846d5750c1261cf61ec1f816d | Python | 18,221 | 362 | """
Class for 2D GPCSD model, fitting, and prediction.
"""
import autograd.numpy as np
np.seterr(all='ignore')
from autograd import grad
import scipy
from tqdm import tqdm
from gpcsd.priors import GPCSDHalfNormalPrior, GPCSDInvGammaPrior
from gpcsd.covariances import GPCSD2DSpatialCovSE, GPCSDTemporalCovSE, GPCSDTem... |
02446cf01d668c7fb2680fc864a7404f340b536717329d5aaf23dc9f44d4c308 | Python | 18,257 | 363 | """
Class for 2D GPCSD model, fitting, and prediction.
"""
import autograd.numpy as np
np.seterr(all='ignore')
from autograd import grad
import scipy
from tqdm import tqdm
from gpcsd.priors import GPCSDHalfNormalPrior, GPCSDInvGammaPrior
from gpcsd.covariances import GPCSD2DSpatialCovSE, GPCSDTemporalCovSE, GPCSDTem... |
fd53a731ab20106552b12ec3c3a4805d64d7fd81fb0b122ee27a664de4175327 | Python | 18,289 | 530 | """
This file contains several helper functions to manipulate 1D and 2D EEG data.
"""
import numpy as np
from numpy.lib.stride_tricks import as_strided
from scipy.interpolate import interp1d
__all__ = ["moving_transform", "sliding_window"]
def _merge_close(index, min_distance_ms, sf):
"""Merge events that are t... |
53d0c7e3e7344c22b84ae9992705ba1301ea67e34a777511ba8545ad0969613a | Python | 18,408 | 414 | """
IMPORTING LIBS
"""
import numpy as np
import os
import socket
import time
import random
import glob
import argparse, json
import pickle
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.data import DataLoader
from tensorboardX import SummaryWrite... |
fe6226b33f746df70ffeaab1ee5e80834983e94c4c2bfcda7843db6a558340d0 | Python | 18,492 | 496 | # 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... |
55db16fbdff28bd82324ef85ab0209b4d6c97e3745ea2c5aee1325f6dfa51ca0 | Python | 18,558 | 533 | # 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... |
449b11c3da46e905318be95c14fac25a5a1f0eeda4fcd3d8597de6225ab01ffc | Python | 18,655 | 402 | import os
import numpy as np
import pandas as pd
import torch
from scipy import special
from sklearn.metrics import (brier_score_loss, precision_score, recall_score, f1_score)
from argparse import Namespace
from probabilistic_forecast.utils.data_utils import data_loader
from probabilistic_forecast.utils.torch_utils im... |
ea9622daa36abacf81bbbd5261459bdb7fed656b1ad42c25358c9e370f452347 | Python | 18,768 | 474 | #!/usr/bin/env python
# @license
# Copyright 2018 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 applicab... |
e1fdc712eca3dcfc250ab2f043a5ef46696c5b1705969e357fb0db143fa8dc19 | Python | 18,894 | 491 | # 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... |
9c66a34b2b3978cfaf833f5c00e193f9c0b880990761493957bb4acf74a2807a | Python | 18,904 | 600 | # 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... |
dc32482f062a32f9142b4d69ad6093b9ddee8d9133c9768ad4a337bbce1f0d22 | Python | 18,918 | 439 | import glob
import os
import sys
from PIL import Image, ImageFilter, ImageOps
import sa_library.datareader as daxspereader
import numpy
import subprocess
from scipy import misc, ndimage
import re
import sa_library.arraytoimage as arraytoimage
import sa_library.i3togrid as i3togrid
import math
import time
import subproc... |
86b4459073e605d8396f0b2e585458057c2c99d19e4a3e0a6375ecd8fb405b76 | Python | 18,919 | 472 | from typing import Dict, List, Any, Optional, Tuple
from evaluation_utils import (
NormalizedCache,
DocumentEvaluationResult,
EvaluationMetrics,
get_normalized,
resolve_entity_category_key,
)
from matcher import StrictMatcher, FuzzyMatcher, Match
class GenericEvaluator:
def __init__(
... |
859f0deee3f299988b236abb71d6ca874db04e7d23f0cc019af81e2359ba98f0 | Python | 18,969 | 587 | #!/usr/bin/python3
import pandas as pd
import numpy as np
from style import style
names = {"data-driven": "Data-Driven", "rdoc": "RDoC", "dsm": "DSM"}
suffix = {"data-driven": "", "rdoc": "_opsim", "dsm": "_opsim"}
def doc_mean_thres(df):
doc_mean = df.mean()
df_bin = 1.0 * (df.values > doc_mean.values)
df_bin... |
08cd451784c68c6f82de11588039887b70d310f322ac434bf7e4ba2827b53581 | Python | 19,034 | 505 | # 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... |
41deb4aa2684df73e8e7f6cd18550bf2bdc26ee674d508e03a7e837ea4804a6f | Python | 19,041 | 503 | # 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... |
16aa5efaceab0f0cc2f2633d40e28747ab1f73f9034e6c54b93989d4b9bc3882 | Python | 19,099 | 508 | # 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... |
d8820ba47cdd7cdc4cc5bda1a7086fde086f357e114b7f755dc50edd186a33d2 | Python | 19,302 | 761 | # 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... |
2ac739ae8142fc767c01237bf8881c7c6bf53817cc56ff7ffa75839bcdea6680 | Python | 19,326 | 562 | from dataclasses import dataclass
from typing import Dict, Optional, Tuple, TypeVar, Union
import numba.typed
import numpy as np
import numpy.typing as npt
from numba import njit, objmode, typed
from numba.core import types
from numba.experimental import jitclass
from cellfinder.core.tools.tools import get_max_possib... |
0eb52c389fab8709b75d5f7ac5ee94fd2d783f0d2d056b6fa9d996b7f4d809dc | Python | 19,327 | 763 | # 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... |
98d0ed71da1c9fd706a351e71bce4dc9449c48899391f196eb28f110a194a638 | Python | 19,338 | 424 | import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
import seaborn as sns
sns.set_theme()
sns.set(font_scale=1.2)
sns.set_style("whitegrid", {'grid.linestyle': '--'})
import numpy as np
import pandas as pd
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
from matplotlib.ticker import... |
9f35ff75a94b701f5f8bef52081c6ba6c3557c4b2c0a7ba6f0609d6adc4454a1 | Python | 19,406 | 493 | import os
os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
import csv
import math
import random
from datetime import datetime
from packaging import version
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
import sklearn
from tensorflow import keras
from keras import backend as BK
from ke... |
46b117c23b2a70632a9fa028339e7feed96605510771f8c669997cf45ec31dde | Python | 19,415 | 365 | import copy
import datetime
import json
import os
import sys
import traceback
from os.path import join as join_path
from typing import Union
import torch
from deep_phospho import proteomics_utils as prot_utils
from deep_phospho.model_utils.logger import setup_logger
from deep_phospho.model_utils.param_config_load imp... |
fb0f207cf41ac5f4cff8069d3e027bcf6bc6dc0d32bda7fe0878998a1df61692 | Python | 19,458 | 477 | import matplotlib.pyplot as plt
import numpy as np
import os.path
def estimateOrientationBandwidth(relativTCExc,minAngle,maxAngle,path):
# algorithm to estimate the OBW:
# get the index of the first point, what is over 1/sqrt(2)
# get the index of the first pont, what is below 1/sqrt(2)
# calculate the... |
61c35bea7bbb4e9063a99272d04867e059a708dff829759c5182741223c092d2 | Python | 19,467 | 549 | from functools import partial
from pathlib import Path
from typing import Any, Callable, Dict, Optional, Tuple
import napari
import napari.layers
from brainglobe_utils.cells.cells import Cell
from magicgui import magicgui
from magicgui.widgets import FunctionGui, ProgressBar
from napari.utils.notifications import show... |
9fea2ff6e0f9b0627c0e630dfc0f3d6c43060105ab0986401db875281cd27173 | Python | 19,468 | 652 | """
main
===============
Trains a network based on a yaml file specifying cubes of cells/non cells.
"""
import os
from argparse import (
ArgumentDefaultsHelpFormatter,
ArgumentParser,
ArgumentTypeError,
)
from datetime import datetime
from functools import partial
from pathlib import Path
from typing impo... |
0f790832a6c2aadb464881ff2ac167dd743b5ced0387abc92a16b3110426cd94 | Python | 19,510 | 498 | import nengo_loihi
import os
import time
os.environ["SLURM"] = "1"
nengo_loihi.set_defaults()
os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
import csv
import math
import random
from datetime import datetime
from packaging import version
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as... |
85e61d350c17aef1697ee6718dbfc60719c0bcf202a50a8a9ec7ff7b8bf50fb0 | Python | 19,535 | 555 | # 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... |
ced62ef31066d63709bb081a90a5c2028d09921e4302d29cc82d6e09ae35d756 | Python | 19,716 | 624 | # 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... |
f628162109212e2a10a5e5771d13f0ba99bd25d01296e4f03f3765569c9ece39 | Python | 19,717 | 486 | from typing import Literal, Sequence
import torch
import torch.nn.functional as F
from monai.transforms import RandAffine
from cellfinder.core.tools.tools import get_axis_reordering, random_bool
DIM = Literal["x", "y", "z", "c"]
AXIS = Literal["x", "y", "z"]
RandRange = Sequence[float] | Sequence[tuple[float, float]... |
ac46567d8b0c472306bbac8cab8468bd94645502a3dc1049a77fc1819586100e | Python | 19,905 | 531 | #----------------------imports and environment---------------------------------
import matplotlib as mp
mp.use('Agg')
from ANNarchy import *
setup(dt=1.0)#,seed=1)
from time import *
import plots as plt
import numpy as np
import scipy.io as sio
#------------------------global Variables----------------------------------... |
86fd7d9cfef1281794a3b9fd998ce2e14ca13b285c9c6434c7382323e4abb50a | Python | 20,159 | 484 | """
Estimate evoked CSD, segment into independent components, and estimate per-trial time shifts.
Produces Figures 4 and 5 from the paper.
"""
# %% Imports
import numpy as np
np.seterr(all='ignore')
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.patches import ConnectionPatch, ConnectionStyle
impor... |
238fee45cbe29d550cb775ac57cfb9d315226d189a609b551c18e7da890c3949 | Python | 20,176 | 541 | # 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... |
608cad9b08c0340dd296d0ac533720a2967b275a887b75e75c5dc6006293c54f | Python | 20,201 | 369 | import numpy as np
import scipy.io
import matplotlib.pyplot as plt
import analyzeMEA.rastPSTH
def importSineData(sineFile):
"""
Import key features of the stimulus from the matlab file generated during experiment.
Inputs:
sineFile - str, path to matlab file generated during experiment
Outputs:... |
0e769dabba857e600dbb9c91362a327c759edf32dbf1d8a4232532bbebe3b7e3 | Python | 20,216 | 477 | """
Estimate evoked CSD, segment into independent components, and estimate per-trial time shifts.
Produces Figures 4 and 5 from the paper.
"""
# %% Imports
import numpy as np
np.seterr(all='ignore')
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.patches import ConnectionPatch, ConnectionStyle
impor... |
26a874c4e0e46f00eec61c74b9a1809b7c20d1fe33b8f7dfcb2a53ff9c36cec3 | Python | 20,398 | 493 | # 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... |
b69306969554f69212f58ae655e01e8bec3356769c29fad75298054d6897938b | Python | 20,608 | 616 | # 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... |
e503e1a3ee0a74e90441e1e8037f0d2fb6adc076a3be3f2485c0f15db8881662 | Python | 20,622 | 504 | """Test the functions in the yasa/spectral.py file."""
import logging
from types import SimpleNamespace
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pytest
from scipy.signal import welch
from yasa.hypno import Hypnogram
from yasa.plotting import plot_spectrogram
from yasa.spectral im... |
bdecb2b185a174f11203f5e20d69162e9a5e7d231ba01ed64625a7c71413bfeb | Python | 20,805 | 575 | # 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... |
da8410f78cda85c38f2f840981a2be9ea1f26fab9cc16af116f074f69e2fe267 | Python | 20,840 | 582 | # 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... |
c9db9c9f5f94b7218c08f21a0739bd7989f613878ca1263db001edf0cad8511e | Python | 20,847 | 573 | # 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... |
dac05a6418e4d6d99c19df9a49252d43a3f92385dc0b3374c9577cb73d1f9932 | Python | 20,875 | 548 | from typing import Tuple, List
import concurrent.futures
import glob
import math
import os
import pathlib
import random
import time
import xml.etree.ElementTree
import numpy as np
import pandas as pd
import PIL.Image
import PIL.ImageFilter
import PIL.ImageEnhance
dll_path = pathlib.Path(r'lib\opensl... |
b1ba0d938ff9b7b457972817b003ad320bfec237bf12de867df3cdad5cddb132 | Python | 21,075 | 454 | import jax
from jax import lax, vmap
import jax.numpy as jnp
import haiku as hk
from jax_md import space, partition, nn, util, energy, smap
from jax_md.energy import multiplicative_isotropic_cutoff, _sw_radial_interaction, _sw_angle_interaction
from DiffTRe import custom_nn, custom_interpolate
from functools import par... |
72f48a1ec3daad5b9b8225d83f7442cc585db234f9672a48739f80f9208a913e | Python | 21,091 | 870 | # 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... |
f45fba41eccce5047eea8376c1026ec2e6dcd83ffff6133582658bd7b353273c | Python | 21,098 | 592 | # 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... |
33dd7b28e013d56f2953a69e38c55884a1ad2fd859809215ab35360707d16f82 | Python | 21,150 | 693 | # 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... |
e9c9134690a51f81a48823712e2ffee95a33af258aa9e90a723ab8e1e97fa0d8 | Python | 21,287 | 521 | # 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... |
c72ff6a536f9c8cb05e03f7d00a197048668acbd9976688331419851c3e3a612 | Python | 21,329 | 414 | import os
import numpy as np
import pandas as pd
import torch
from scipy import special
from sklearn.metrics import (brier_score_loss, precision_score, recall_score, f1_score)
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
import seaborn as sns
sns.set_theme()
sns.set(font_scale=1.2)
sns.set_style... |
f26cc4423f423533376f8d7a5a07d6db2df6b77deaff85c6ffe28e80f779d333 | Python | 21,341 | 643 | # 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... |
1db1cc377c8baef53511154ce11e50b7126b5d083fa0cc1471530e9a4ef895b7 | Python | 21,361 | 532 | # 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... |
a361f05b02ad5a305c37cb345df5dfbd4df3f5e97c1e534364e2d3dbeca01326 | Python | 21,395 | 511 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 8 20:33:32 2019
@authors:
Luz Santamaría Granados (luzsantamariag@gmail.com)
Juan Francisco Mendoza Moreno (jfmendozam@gmail.com)
"""
import numpy as np
import pandas as pd
from imblearn.over_sampling import KMeansSMOTE
from imblearn.unde... |
017cfe94e2619b7a84a709385103f4f686efb6810a2bd9c21456ed727e5ab04e | Python | 21,409 | 562 | # 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... |
ef3e97136d0a68ee3ce40a79de2dbda453e7b84044fe65df1d887105e6820eac | Python | 21,661 | 561 | """
Written by Dr. Elishai Ezra Tsur
@ The Neuro-Biomorphoc Engineering Lab (NBEL-lab.com)
@ The Open University of Israel
@ 15.9.2020
"""
from enum import Enum
import sympy as sp
import numpy as np
import random
ARM_ACCURACY_IN_METER = .001
class Optimizer(Enum):
""" Designation of an optimization method for i... |
d099e96bd75f81ae74b8dd8c43a0a9caf479209592ac6693d5953038bdc3daad | Python | 21,717 | 701 | # 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... |
85791865e4f9f96c8075284db069167ca3391e9e7e6f3998e6a86b96a27fc9d6 | Python | 21,853 | 622 | # 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.