sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
12fdf271b3ac59957590d32a727558aae166f625d202be032a41868bf6c13f83 | Python | 21,861 | 543 | import multiprocessing as mp
import os
from functools import partial
from typing import Callable, List, Optional, Tuple
import numpy as np
import torch
from brainglobe_utils.cells.cells import Cell
from tifffile import tifffile
from tqdm import tqdm
from cellfinder.core import logger, types
from cellfinder.core.detec... |
3140b326397f7291b7ad7196a7bfa3e94795c9c494a02942f2d95b31bb7d5f52 | Python | 21,953 | 582 | """
Plotting functions of YASA.
"""
import logging
import warnings
import matplotlib.dates as mdates
import matplotlib.pyplot as plt
import mne
import numpy as np
import pandas as pd
import seaborn as sns
from lspopt import spectrogram_lspopt
from matplotlib.colors import ListedColormap, Normalize
from .hypno import... |
005b8037936bc0c9ad9f647de1df250c5bd61489860e84607c11d885f8226469 | Python | 21,971 | 532 | #!/usr/bin/env python
"""Command line utility to generate EO O&M metadata from SAFE files."""
import sys
import argparse
import s2reader
EOOM_TEMPLATE_PRODUCT = """<?xml version="1.0" encoding="UTF-8"?>
<opt:EarthObservation xmlns:opt="http://www.opengis.net/opt/2.1" xmlns:gml="http://www.opengis.net/gml/3.2"
xml... |
6e5474ef440fc5a5aa0d81d84b897d68cbf5de4af31513bae8f1ce079c9a60a5 | Python | 22,000 | 578 | # coding: utf-8
import numpy as np
import pandas as pd
from scipy import stats
from matplotlib import pyplot as plt
from tqdm import trange
DIRECTION_NUMS = {
'clockwise': 1,
'counter_clockwise': 0
}
DEBUG = False
def reset_df(df):
"""
:param pd.DataFrame df:
"""
df.direction = ''
if '... |
b9f1326effbeadedc4974ee5a955f6b88c439d6d237b37b347d05606daa3b3d9 | Python | 22,006 | 357 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'main_pytemplate.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_main(object):
def setupUi(self, main):
main.setObjec... |
bd336d0606341d2220ef58367a970a23864da4647fc0880344efbbeea9582cc6 | Python | 22,023 | 470 | import tifffile as timg;
from tifffile import imsave;
import skimage as skimg;
import scipy
import cv2
from PIL import Image
from py_dftregistration import dftregistration;
from imresize import imresize;
from imresize import imadjust;
arg1 = "C:\\Users\\Colenso\\Desktop\\GUI_XY_test\\";
local_exp = arg1;
rel_conv_i... |
4025960a56547053544b4d3363b4d4cfa57ee454212792331379a9240315b31b | Python | 22,108 | 627 | # 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... |
320dbce4410c7eff9e2349a7f3c113813f32903238867cbfad7952fb48dfb907 | Python | 22,121 | 395 | import argparse
import copy
import datetime
import os
from os.path import join as join_path
from deep_phospho.proteomics_utils import rapid_kit as rk
from deep_phospho.train_pred_utils.runner import DeepPhosphoRunner
HelpMSG = '''
This script integrates all functions of DeepPhospho in one.
To run this, at least two f... |
9697a62985061eaeaa68f92fb9df58c90e5af9cd25d071d027bf1227a4d40aef | Python | 22,136 | 463 | """
Customn implementation of the outstanding DimeNet++ architecture in haiku.
https://github.com/klicperajo/dimenet.
Includes functions computing a sparse edge / angle representation from neighbor lists.
"""
import jax.nn
from sympy import symbols # to setup spherical basis functions
from sympy.utilities.lambdify im... |
d798b21fe3db3bed66d46f2fb9fcac7ac2620105132d5db68dbb27f88a3ac501 | Python | 22,173 | 686 | # 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... |
078546820b42ff02bad40c5cf87b12fa2074da9142c4769bdc5a19c0e4ed1956 | Python | 22,188 | 578 | # 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... |
5a67d0b984e26c8e3cf6417383e978d33e68461c207cf3d71acaf73537b46076 | Python | 22,200 | 637 | # 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... |
d6ca2dc0a94b92c7407b8a5fe3fe5b0bb57e73da560982132a0af4e1eada0dd7 | Python | 22,210 | 580 | # 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... |
5771802ac0381ee822415c22d1ed79f5f989d7e9e6bceac8976765d2e4375dda | Python | 22,253 | 615 | # -*- coding: utf-8 -*-
"""
Defining general functions for inputters
"""
import glob
import os
from collections import Counter, defaultdict, OrderedDict
from itertools import count
import torch
import torchtext.data
import torchtext.vocab
import onmt.myutils as myutils
from onmt.inputters.dataset_base import UNK_... |
ead56b26ca05b72693b963c0b9add5097411eb1f20c1044fd0979dd7f208861a | Python | 22,332 | 585 | # 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... |
d7a1c83b026fb11a3e6f8e8250731a31aa9a82aadd1fc439f0e6182efcb3934e | Python | 22,440 | 604 | #!/usr/bin/env python
"""
s2reader reads and processes Sentinel-2 L1C SAFE archives.
This module implements an easy abstraction to the SAFE data format used by the
Sentinel 2 misson of the European Space Agency (ESA)
"""
import os
import pyproj
import numpy as np
import re
import zipfile
import warnings
from lxml.etr... |
25e0d38cc46b40778ee51b8bcb54bf2f8f756f787e1fd5ec0256e11013e4f2d9 | Python | 22,498 | 614 | # 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... |
257f584360b3c60841a86f3560fcc426cae9709d2a34efe869a18155fce2707c | Python | 22,564 | 517 |
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
... |
ac9e63c2d67348a2b03f038a9301864bd25fb4cab993ea10ac1ac3ece4d48768 | Python | 22,610 | 478 | import numpy as np
import os
import pathlib
import sys
import h5py
from PIL import Image
from analysis_scripts.corr_mols_v8 import corr_mols
# from corr_mols_v8 import corr_mols
import skimage
import skimage.transform
from skimage.transform import (estimate_transform)
import matplotlib.pyplot as plt
def ecdf(data):... |
a2fde7e6818a18928502fe6454863aae623e7f37f2defe915219946d535a1891 | Python | 22,617 | 492 | """Regression tests for EpochByEpochAgreement and SleepStatsAgreement against the SRI Analytical
Pipeline.
Reference values are taken from AnalyticalPipeline_v1.0.0.html (v1.0.0) published at:
https://github.com/SRI-human-sleep/sleep-trackers-performance
https://doi.org/10.1093/sleep/zsaa170
Ground-truth values l... |
285b2d6712e80c0574e782535e4b7d1dffbb685540eb0d089a3d4535ef8d13f9 | Python | 22,640 | 725 | # 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... |
ec20f28c40e28f60dcf8016d3c17f919a3790bffd3372e9f2576ba247fc8f6a1 | Python | 22,670 | 624 | # 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... |
a3cad1569896c71394bfcda31ee7ae4a493b0f9ed1a9c3c1e2754456f9056343 | Python | 22,691 | 549 | # 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... |
bc370407a8ea8538dd458bc693704328aaec0b9279a1493bd9dc22c043b7e5be | Python | 22,708 | 595 | #!/usr/bin/env python
"""
This module 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 from... |
a77d79a4859696ddd933fce7e9df559f8d2affcacad129391473d26209b8c59e | Python | 22,805 | 542 | """Automatic sleep staging of polysomnography data."""
import datetime
import glob
import logging
import os
import re
import joblib
import matplotlib.pyplot as plt
import mne
import numpy as np
import pandas as pd
import scipy.signal as sp_sig
from mne.filter import filter_data
from scipy.integrate import trapezoid
f... |
f546893f4a0beee16dce43dec6d4234017acc2f967b4a8a741e65f62ec622e7a | Python | 22,969 | 621 | # -*- coding: utf-8 -*-
# @Author: Weiyue Ji
# @Date: 2018-10-19 00:59:49
# @Last Modified by: Weiyue Ji
# @Last Modified time: 2021-12-04 14:23:10
import pandas as pd
import numpy as np
from scipy import interpolate
import helper as my_help
import settings as settings
import plotting as my_plot
# ============... |
d753b19b59ed620a39e0a8771d7fc92c52dfae1abbd633851029a390a41fb0b8 | Python | 23,137 | 555 | # 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... |
fdb5cbf3251f3af74153f8d3e9afc2fe2d59b505637f2674e0a7c7dee5ca7c3c | Python | 23,392 | 481 | #!/usr/bin/python3
"""plot_main.py: Generates plots in the main text of 'A computational knowledge engine for human neuroscience'"""
__author__ = "Elizabeth Beam"
__email__ = "ebeam@stanford.edu"
__copyright__ = "Copyright 2021, Elizabeth Beam"
__license__ = "MIT"
__version__ = "1.0.1"
# Version 1.0.1:
# ... |
0c68f6325304bf5a06a82e313d5736ae27d48b8c5d06c775246c39eb30ff937a | Python | 23,569 | 673 | import numpy as np
import pycircstat
import logging
import scipy.ndimage.filters as filters
import scipy.stats as stats
from imlib.radial.misc import opposite_angle
from imlib.array.locate import peak_nd_array
from imlib.array.fit import max_polyfit
from spikey.descriptive.radial import radial_tuning_stability
impo... |
e26df08664f7aa20222e278984042679b842fb8f9250a34b4a3ddfef019a0ac4 | Python | 23,604 | 683 | # 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... |
f34ee01c648f035bf6a31130420d858758a3ed5e4510a18be7a2152c7c14c763 | Python | 23,619 | 654 | # 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... |
20a2e19770c8ea653cb1e2470b93f7881b17f44ed965c46a125627e0bf4fa1c6 | Python | 23,645 | 370 | from collections import Counter
import os
import subprocess
import pandas as pd
import modules.CPAS_processing as CPAS_processing
import modules.help_scripts as helpers
import modules.TSS_processing as TSS_processing
import modules.blocksize_processing as blocksize_processing
import modules.isoform_deconvolution as is... |
73ec9c483f51cf20e892d3e7683ac4c210cff35daa889287aa4bc86ad8096ddf | Python | 23,707 | 641 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 24 2018
@author: kushal
Chatzigeorgiou Group
Sars International Centre for Marine Molecular Biology
GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
"""
import sys
import pandas as pd
import numpy as np
import pickle
import json
from copy impor... |
df2d5983b0d47823ba20320abbc918a33bfd0ad111f895cce655a689f4b6b97b | Python | 23,814 | 630 | import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
from torch.nn import (
TransformerEncoderLayer, LayerNorm,
Linear, Dropout,
Module, ModuleList, MultiheadAttention
)
from .general_transformer import TransformerEncoder
class PositionalEncoding(nn.Module):
def __in... |
e74bce096f2edc03315bccd9c1175cb9c508daf65e625cafbdebe4d8c074b9f3 | Python | 23,848 | 605 | 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... |
2315bc14444ee9b013255f960b35989a7699a0f6510129ec11b8922daddd5d87 | Python | 23,902 | 625 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import LayerNorm
from .auxiliary_loss_transformer import TransformerEncoderLayer, TransformerEncoder
from .ion_model import PositionalEncoding
class LSTMTransformer(nn.Module):
def __init__(self, RT_mode, ntoken, ... |
f3a78a56f3783d9f8c4375c5d67a5782df60c1a94bbd8b49e72999cb742d32fa | Python | 23,909 | 506 | import xgboost as xgb
import scipy
from sklearn.base import BaseEstimator, RegressorMixin
from sklearn.model_selection import GridSearchCV,RandomizedSearchCV
from xgboost.sklearn import XGBRegressor
from sklearn.ensemble import GradientBoostingRegressor
import scipy
from sklearn.metrics import make_scorer
#utils
f... |
16f7bce808c133637a8398cb461a1f7078616ce760d01df7c814b4839b46ad98 | Python | 24,113 | 528 | #!/usr/bin/env python
import sys
import time
import unittest
import re
import rospy
import actionlib
import std_msgs.msg
from control_msgs.msg import (
FollowJointTrajectoryAction,
FollowJointTrajectoryGoal,
FollowJointTrajectoryResult,
JointTolerance)
from ur_dashboard_msgs.msg import SetModeAction, S... |
31598c85506be394993ec67053423165b7fb9bfc7594f982eb40041a7f6191ac | Python | 24,262 | 705 | # 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... |
cf5d4d7a862a43aeca2e246aeb432b738736e73fbf82f6ba8172c927264a5691 | Python | 24,291 | 652 | """ SRU Implementation """
# flake8: noqa
import subprocess
import platform
import os
import re
import argparse
import torch
import torch.nn as nn
from torch.autograd import Function
from collections import namedtuple
# For command-line option parsing
class CheckSRU(argparse.Action):
def __init__(self, option_st... |
b8166337965ee4255433f34ec966d8735bd1f2806b57f5ccd94276c2060ca600 | Python | 24,377 | 641 | #===================================
# 1. pretrained models: 1. effnet
#===================================
# 1) effnet, extract embeddings at fc0
class effnet_model_fc0(nn.Module):
class Identity(nn.Module):
def __init__(self): super().__init__()
def forward(self, x):
return x
def _... |
fd66a861c699d0d8acfbb68064a2cac162dbdc22365cf3fa96123192b917b8d1 | Python | 24,584 | 544 | import os
import numpy as np
resT5HALF = np.array([82.99, 82.99, 82.26, 82.72, 83.27, 83.28, 83.29, 83.22, 82.37, 82.04])
resT5NewTest = np.array([85.96, 84.51, 85.88, 86.25, 86.39, 84.93, 86.38, 85.66, 85.80, 85.95])
ELMO = np.array([75.63, 75.61, 75.47, 75.79])
ELMO_MCC = np.array([0.7059, 0.7041, 0.7026, 0.7079])... |
ffdd427eedece577825faf6e60aebdd6d0a98274bab30ff160b0003f087fdf0e | Python | 24,798 | 704 | # 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... |
7028c7d3bad1f4ea990e1b1ba04ef86840174c4899ffdcf4180c5dc207fb6ea7 | Python | 24,856 | 625 | """
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 tensorflow as tf
from tensorflow import keras
from keras import backend as BK
ARM_ACCURACY_IN_METER = .001
ta ... |
84c1aa47c380deb8ad81e4f3037db7c05cd7e14a75d97c86357b49608f0b5448 | Python | 24,885 | 601 | #!/usr/bin/env python
# @license
# Copyright 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
c6674d243cb12ea2b375793aec7c0b04f23e0718fc5a10995bf084e90cf60abe | Python | 24,984 | 515 | import jax.numpy as jnp
from jax import jit, grad, vmap, lax, jacrev, jacfwd, ops
from functools import partial
from jax_md import space, util, dataclasses, quantity
from DiffTRe import custom_nn
from jax.scipy.stats.norm import cdf as normal_cdf
Array = util.Array
@dataclasses.dataclass
class RDFParams:
"""
... |
5bbc8ccfbbe5f63c4d5accc941ec486ae04710a69cb098d651e07916f9f7271d | Python | 25,159 | 871 | import logging
import pandas as pd
import seaborn as sns
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import matplotlib.colors as colors
from scipy.ndimage.filters import gaussian_filter
from imlib.plotting.colors import get_random_colors
from imlib.plotting.matplotlib impor... |
1cc0a58b9e4db0da8d81236c59bec30bb22d349b97f8d79494ed9cb7ca58bba6 | Python | 25,179 | 573 | import os
os.environ['CUDA_VISIBLE_DEVICES'] = '-1' #-1 = Disable GPU
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
import tensorflow_addons as tfa
from tensorflow.keras import Model
from tensorflow.keras.layers import *
from utils import RelativeReduceLROnPlateau, RelativeEarlyStopping, E... |
37e63f1b9f9d779bbbfe2cfc9acf32cab4e3c38991d6b13176ec3c4ff72802a4 | Python | 25,235 | 801 | # 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... |
23b5fdbefd011464c54616f63a513d42b50bc74dbb6ed788a3bbebff440136d7 | Python | 25,242 | 573 | import os
os.environ['CUDA_VISIBLE_DEVICES'] = '-1' #-1 = Disable GPU
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
import tensorflow_addons as tfa
from tensorflow.keras import Model
from tensorflow.keras.layers import *
from utils import RelativeReduceLROnPlateau, RelativeEarlyStopping, E... |
72cb5a43e4be6ee7e59f3b58c5f4db43466eb63880f85fc0ed6117a9a2fb2be8 | Python | 25,303 | 552 | #!/usr/bin/env python
# coding: utf-8
"""
This file is part of MADIP: Molecular Atlas Data Integration Pipeline
This module provide helper functions for step_2_protein_ids_alignment.ipynb jupyter notebook
Copyright 2021 Blue Brain Project / EPFL
Licensed under the Apache License, Version 2.0 (the "License");
... |
1f9296d31665fb25b17a086fa49dc19f7771f5ed56cd88d3179d7ea77c7f9c98 | Python | 25,514 | 384 | import pandas
import numpy as np
import tensorflow as tf
from sklearn import metrics
import matplotlib.pyplot as plt
import seaborn as sb
from collections import Counter
from matplotlib.patches import Patch
from SurvivalClustering.SurvivalAnalysis import SurvivalAnalysis
from SurvivalClustering.Cluster impor... |
1884340cee18aa51a9682ac832cfacecea2ade9446afd70429b944c0eac22050 | Python | 25,606 | 709 | # # Developer: Vajira Thambawita
# # Last modified date: 18/07/2018
# # ##################################
# # Description ##################
# # pythroch resnet18 training
###########################################
from __future__ import print_function, division
import datetime
# #start = datetime.date... |
2ec70b522eba2680d116131a0eecb85da3e53b102d5dd669324a5f291e4bf358 | Python | 25,920 | 773 | # 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... |
e34a81d02de610d7a42040c3bcae8d09891649109807c3aacb3589d18955a3d2 | Python | 26,072 | 604 | import tensorflow as tf
import tensorflow_probability as tfp
import tensorflow_addons as tfa
import numpy as np
# Make the phase function for even asphere polynomials.
#num_coeffs = 8
#def phase_func(x, a2, a4, a6, a8, a10, a12, a14, a16):
# return a2 * x ** 2 + a4 * x ** 4 + a6 * x ** 6 + a8 * x ** 8 + a10 * x ** 10... |
6974d7b71f4a0af2c1809941ca020808fb489218dbb251e6b4630824f1594967 | Python | 26,413 | 521 | ### functions regarding indentOnGrid
import numpy as np
import numpy.matlib
import matplotlib.pyplot as plt
import scipy.io
import analyzeMEA.rastPSTH
def plotActualPositions(filename, setup='alan', center=True, labelPositions=True, save=False):
"""
Plot locations of grid indentation.
inputs:
fil... |
78b3fe45fb3f9f36bcec65cc32b3076ddee072ccd93ecb45be90deaa940c155c | Python | 26,653 | 709 | # 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... |
fa22ce9776c23be201d3419c7004ea2e706ac7f9d5bfcab866b064cf513fce54 | Python | 27,036 | 725 | #!/usr/bin/env python
# coding: utf-8
# controller module
from config import debug
from config import translations
from datamodel import index_lst, sorted_xs, Model
import view
from bokeh.events import Tap, Pan, MouseWheel
from bokeh.models.callbacks import CustomJS
import numpy as np
import time
def select_language_... |
ee1f2bfcfc6093a7bd52e161126a77ddc4108bf98dc4b88e819f18de50dcd06c | Python | 27,073 | 627 | #!/usr/bin/env python
# @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 applicab... |
511c0536d9166c59a0ce331ed28122e79b2de35adaef4e33f3fd672d45d7e906 | Python | 27,137 | 778 | # 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... |
c2507290bd05967d7475a42c14b88b8df451429ace3278b0d0f31c9fdbef6fcf | Python | 27,468 | 651 | from .sn_constant import *
from .sn_utils import *
import re
import os
from collections import Counter
import prettytable
import pandas as pd
try:
from sklearn.model_selection import train_test_split
except ModuleNotFoundError:
pass
from deep_phospho.proteomics_utils import rapid_kit
from deep_phospho.proteo... |
15e40c7935d2cabc209304c4d87e571baa0e0ebb3074816bd5e253395c058d14 | Python | 27,552 | 644 | #!/usr/bin/env python
# coding: utf-8
import base64
import glob
import gzip
import h5py
import logging
import os
import re
from io import BytesIO
import sys
import innvestigate
import nibabel as nib
import numpy as np
import pandas as pd
import scipy
import tensorflow as tf
from keras.models import l... |
27aaf5b175e7527593c5f1ca87e9e112764d26a6ac9948aa4d117045d78f726d | Python | 27,641 | 1,244 | # 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... |
a7aaa01e38c53803e341c703494b66f20b7e997cdf0f96add62e5bd3c6232fdf | Python | 27,705 | 809 | from functools import partial
from pathlib import Path
from typing import List, Optional, Tuple
import napari
import numpy as np
import tifffile
from brainglobe_napari_io.cellfinder.utils import convert_layer_to_cells
from brainglobe_utils.cells.cells import Cell
from brainglobe_utils.general.system import delete_dire... |
8b39d90a4ca4fd4d0eb1e9a924c778934279160e6790ba8b8f4990bafdf6cc2c | Python | 27,786 | 609 | from ._pdeep_constant import BasicpDeepInfo
from ._pdeep_constant import MOD
import re
import os
from collections import defaultdict
import pandas as pd
from deep_phospho.proteomics_utils import rapid_kit
from deep_phospho.proteomics_utils.post_analysis.spectronaut import SpectronautLibrary
def intprec_to_pdeep_tes... |
5869e40df976dd7f585705f56cb16dd5dd246302260f80651064ff3c36367d4c | Python | 28,081 | 873 | # 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... |
f3c25a410367ac26bff25b211800e39554feef3731e4db93735445900685aedc | Python | 28,100 | 874 | # 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... |
46c5b401c181e13396461ec6323705717d8537a283b3506b35c1aa75f6ada1b0 | Python | 28,480 | 838 | # 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... |
cc43e4ace443e1be5dbaed0df39ec74d6577c7c76bfc471a9c753962120427ac | Python | 28,511 | 551 | import copy
import datetime
import json
import logging
import os
import random
import time
from functools import partial
import ipdb
import numpy as np
import termcolor
import torch
from torch.utils.data import DataLoader
from deep_phospho.model_dataset.dataset import IonDataset, collate_fn, RandomMaskingDataset
from... |
a7a514ea3d47bd1c91a6c74459ca2fbfaa38e8f69b2c1efaad9892e94fd005c5 | Python | 28,533 | 841 | # 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... |
6427a6b39920fd1228c663a976aad5437ca1453714c51dcd9e5123b76029e3df | Python | 29,116 | 824 | """
Hidden Markov Model for a 2-armed restless bandit task.
Identical in structure to hmm_models.py (3-armed version) with the following
differences:
- 3 hidden states instead of 4: 1 explore + 2 exploit
- 2 observations instead of 3: choice 0 and choice 1
- Parameter tying averages over 2 exploit states ins... |
1acdc5d37cc16da5b2d069c99bdc028b6b3a1496812eed23ca79005e8110a9bd | Python | 29,337 | 840 | def validate_family(dataset, family):
for family in families:
members = families[family]
for species in members:
assert len(species) == 2, "%s has no class!" % species
species = species[0]
assert len(dataset[dataset['CNAME'] == species]) >= 1, "%s not found!" % sp... |
026740e90792ca99818462598e35e5bc50234328133a293299b3a136802fe223 | Python | 29,376 | 971 | # 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... |
30a3154bbdaa3f67da3711bf5e79f156abe1cf1ef39dc5f32a01caaa05d2169a | Python | 29,376 | 971 | # 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... |
0bdb48f4a0bdf6b8f1cc55a9c744362ff1d44f0c3111c4ec344af716bd443c39 | Python | 29,762 | 811 | # 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... |
16693bff8a9808b3df35f781890bdfb22c35fd8e322ccd01bc0bc05f7d305670 | Python | 30,037 | 1,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... |
1ce65a8fc021335cd6f70b6cb786bea0d47174b0fb4ac9305dd03c6a4365f332 | Python | 30,053 | 1,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... |
4bcc35c31f96f72e09b70cb5dae74ad44a39f8dcd84d4a70397bcc68964b2777 | Python | 30,104 | 731 | # 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... |
afc4446ec119794635c614a1059d2233d75227ab5c63119502cf98c8894dc526 | Python | 30,130 | 808 | # 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... |
6a0d6f26d6da2d308b581609fc2dd66f4603ca6099001aeb3527fd43dd3045b5 | Python | 30,321 | 894 | # 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... |
5d2c124fdd7e3459cda96c5238e99b3c0159dbb6cc01bcf085505872abd5c723 | Python | 30,553 | 726 | import torch
import glob
from functools import reduce
import pandas as pd, numpy as np
import os
from sklearn.model_selection import train_test_split
from PIL import Image
from torch.utils.data import DataLoader, Dataset
from torchvision import transforms
from torchvision import models
from torch import nn
from torch.n... |
ced85ad4e33de69cdb24e5bdc2c8112d0b0f26729ec0f0caa1dccbba4460d984 | Python | 30,611 | 782 | """
Configuration file for the Sphinx documentation builder.
For the full list of built-in configuration values, see the documentation:
https://www.sphinx-doc.org/en/master/usage/configuration.html
For the full list of extension configuration values, see respective sites.
"""
import inspect
import subprocess
import s... |
caf67b99b4a9ebffc852f74709a6530b45ff5fe46f1fa5c738967143e7f35bd5 | Python | 30,818 | 847 | # 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... |
4a5f55c61f51a4744a84df620aaa383b0dd6cb488c1d7a82e0521639607d4eac | Python | 30,852 | 874 |
import os, sklearn
import pandas as pd
import numpy as np
import sys
sys.path.append("..")
import utilities
from style import style
from prediction.neural_network import prediction
def load_ontology(k, path="", suffix=""):
list_file = "{}lists/lists_k{:02d}_oplen{}.csv".format(path, k, suffix)
lists = pd.read_cs... |
615f4ff03a61ae647fdd9f19e58991f80b43d80343e8abf72b85746055e1c0f5 | Python | 30,907 | 561 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'GUI.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_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.s... |
60b50b7fb418316cfdcc7955c97852fb0d7182b6f7d586a9bb536849613e0307 | Python | 30,916 | 889 | # 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... |
bbd447a3bd5617e223c2c615c8a6ff4bc5e57f8d3585e14dd710a3b61afa6e3e | Python | 30,939 | 1,115 | # 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... |
11aa46c609df3f1320f0ef8f263df3e8ba94b74b490dd718823959b8580d1c3d | Python | 31,008 | 1,116 | # 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... |
2c13d6ca853446cf47b21c6094eeebae82e5acdc6934b9c5d0c328d83eef0dd6 | Python | 31,121 | 702 | # coding: utf8
from collections import Counter, OrderedDict
from itertools import chain
import six
import torch
from tqdm import tqdm
from .dataset import Dataset
from .pipeline import Pipeline
from .utils import get_tokenizer
from ..vocab import Vocab, SubwordVocab
class RawField(object):
""" Defines a general ... |
3a66191f54d73c2e8ad9722c8fb76e12d3521e146a4b8e6ff019f3c5811b47ba | Python | 31,349 | 885 | # 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... |
70a859f0b6ee2fe42db9f69522409b6f5b4f4af424a2ce04d0aa6e01c1c1cbf1 | Python | 31,899 | 782 | # 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... |
9c3d25a76836ec2887b3a7426b88ffd3ad462d781e64957808aedaf732f39e87 | Python | 32,224 | 1,026 | # 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... |
50a12e1019cab919c6e2a51cfdcebd6fc605325ff56f2f31244876f1b8d1d64d | Python | 32,886 | 750 | import os,pickle
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import tensorflow as tf
from tensorflow.keras import layers, Sequential
from tensorflow.keras.callbacks import EarlyStopping
from tensorflow.keras.callbacks import ModelCheckpoint
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import matplotlib.pyplot as plt
import ... |
544321e978a3adac260ddb0fccbed928db3a0dc7614066b19717ab5e88eaa403 | Python | 33,045 | 814 | # -*- coding: utf-8 -*-
# @Author: Weiyue Ji
# @Date: 2018-10-19 00:59:49
# @Last Modified by: Weiyue Ji
# @Last Modified time: 2021-12-04 18:04:19
import os, math, matplotlib
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.colors import BoundaryNorm
from matplotlib.ticker import MaxNLocator... |
40ca533f8e6eb3638fb721083eb42915d8e03165b7a2f454d67d179c60e63e88 | Python | 33,474 | 837 | """
This file contains several helper functions to calculate spectral power from
1D and 2D EEG data.
"""
import fractions
import logging
import warnings
import mne
import numpy as np
import pandas as pd
from scipy import signal
from scipy.integrate import simpson
from scipy.interpolate import RectBivariateSpline
from... |
e6c4e9b8c74f25bf4fb350df27a8ec923d4d1694c9e5c4b3fefe91a0257b156e | Python | 33,799 | 736 | # 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... |
3b221d93eb5d088b9e7e7e88413efcf3d9aa65766574db971ffcfac9cd6da402 | Python | 33,853 | 653 | """ Implementation of all available options """
from __future__ import print_function
import argparse
from onmt.models.sru import CheckSRU
def model_opts(parser):
"""
These options are passed to the construction of the model.
Be careful with these as they will be used during translation.
"""
# E... |
11bc259c38ad7d4838d30dfbf5fa899e0943a6fb60f3c7ad71e18c55cc11eeb9 | Python | 33,863 | 931 | # module import
import os
import re
import copy
import functools
import numpy as np
# pyqt5 module imports
from PyQt5.QtCore import Qt, QSize
from PyQt5.QtGui import QFont, QIcon
from PyQt5.QtWidgets import (QApplication, QDialog, QHBoxLayout, QPushButton, QMessageBox, QComboBox, QTableWidget,
... |
bd06e3905e67c4595a7ac0a0827fbb97e8cf41aec6b93cf482552edb6ad24c6f | Python | 35,531 | 967 | #!/usr/bin/python
#
## @file
#
# A ctypes based interface to Hamamatsu cameras.
# (tested on a sCMOS Flash 4.0).
#
# The documentation is a little confusing to me on this subject..
# I used c_int32 when this is explicitly specified, otherwise I use c_int.
#
# FIXME: I'm using the "old" functions because these... |
354a577c7d0092178485464d7999cc9a644843897576019072e74ac1dae4b4ff | Python | 35,955 | 972 | """Test the class Hypnogram (except upsampling, see test_hypno_resample.py)."""
import datetime
import json
import warnings
import matplotlib.dates as mdates
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pytest
from yasa.evaluation import EpochByEpochAgreement
from yasa.hypno import H... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.