sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
5658e9431520575aa204377cfc5b1dfdda1b746dd73f9af7511637c68dad0250
Python
16,742
361
# script to sample from proteinMPNN for defined positions # this code is adapted from https://github.com/dauparas/ProteinMPNN import sys import importlib sys.path.append('../ProteinMPNN/') sys.path.append('../ProteinMPNN/vanilla_proteinmpnn') sys.path.append('../../../../src/') from regressionTools import hamming ...
cc1a63762a3f5f60307697317910d7418d58b4e98678d49dfbf1b80fa8a6f9ab
Python
16,761
478
# copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. # # 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 applica...
f81d71ec14b38de059d46ba7f354ca0ccde4f3988c6d851538612ef06b624fc8
Python
16,768
477
import numpy as np # import matplotlib.pyplot as plt import torch import h5py import torch.nn as nn from torch.utils import data import itertools import json import sys from os import path import gc gc.collect() nameScript = sys.argv[0].split('/')[-1] # we are going to give all the arguments using a Json file nameJso...
63c24e67abd3a91f5442068431be53032510a16cab13651d5bc5d35affb597c4
Python
16,774
508
# coding: utf8 # Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserve. # # 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 requ...
45e18b439746310f68f15bd5a1d2d76bf87912d8cd77fe254a93039254e2ac8b
Python
16,780
412
# Copyright (c) 2021 PaddlePaddle Authors. 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. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
7a65c6ecbf0e9b19abfb6b9bca93a63fc37309e90b3f2638da220d8cf4f42d1c
Python
16,790
432
from collections.abc import Sequence from pathlib import Path import cv2 import numpy as np from qtpy.QtCore import QRect, Qt from qtpy.QtGui import QIcon, QImage, QPixmap from qtpy.QtWidgets import ( QApplication, QFileDialog, QHBoxLayout, QLabel, QMessageBox, QProgressDialog, QPushButton,...
e814b81560c51be17dd7d745e152b6ca4e9f41ca31080f87c9ae5bd9885ffda4
Python
16,802
415
"""Test suite for CircuitTemplate.get_jacobian_func.""" import numpy as np import pytest from pyrates import CircuitTemplate, OperatorTemplate, clear from pyrates.ir.node import clear_ir_caches def setup_module(): print("\n") print("================================") print("| Test Suite: Jacobian Functio...
47b7e51bb80c8911c5e064ff1c9650291862db99c4b913faff6c68ec0f1b6b4d
Python
16,804
362
""" ManifestHandler """ import os from python.glassfunc import locate SOURCE_FASTQ_TYPE = "FASTQ" SOURCE_BAM_TYPE = "uBAM" ALIGNED_BAM_TYPE = "aligned BAM" class ManifestHandler: """ Class that defines the GLASS manifest It should not be implemented directly, but either as a JSONManifest using JSON ...
0da0bfe17af583d176267d1588050f047c2447f68cf4c3a186f97d0ef054f87b
Python
16,822
441
# -*- coding: utf-8 -*- """ SimilarityAssessment class functions to assess similarity between dFC results Created on Jun 29 2023 @author: Mohammad Torabi """ from copy import deepcopy import numpy as np from joblib import Parallel, delayed from scipy import stats from ..dfc_utils import ( TR_intersection, c...
ef5dc97f1d4095e210ddd862c43389e9ecd1831421e605a68b1849a9202a96e1
Python
16,850
473
""" This is an implementation of ProNet model """ from torch_geometric.nn import inits, MessagePassing from torch_geometric.nn import radius_graph from .features import d_angle_emb, d_theta_phi_emb from torch_scatter import scatter from torch_sparse import matmul import torch from torch import nn from torch.nn imp...
8bdf81be7510c9d364c2e8afa561ccd683b7ae1507eccf426c3c9c1252ddb3ca
Python
16,855
395
import os import itertools import collections import numpy as np from numpy.random import default_rng import librosa from pydub import AudioSegment from common import normalise from common.tfrecord_creator import TFRecordCreator from common.data_sample import Sample def make_tfrecords(data_folder, ...
271268d61d84e9de305286698c7d0652fa29e7d946c4d316b58fcb759c4679e6
Python
16,919
468
import numpy as np import pytest from reinvent.scoring.pumas_support import have_pumas from reinvent.scoring.scorer import Scorer from numpy.testing import assert_array_almost_equal USE_PUMAS = [ pytest.param( True, marks=pytest.mark.skipif(not have_pumas, reason="optional 'pumas' package not insta...
1c397491d23cda454c474f386c656a3ff12ccc37973b034f8b28f6e0310bf30a
Python
16,938
433
# Copyright (c) 2020 PaddlePaddle Authors. 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. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
fb69f5f6d8482813d0778e8190afab317cb11fd149d2c43889d21f4abe138aaf
Python
16,952
434
import pytest import renderapi from test_data import ( render_params, rough_parameters) from bigfeta import bigfeta, utils from marshmallow import ValidationError import json import os import copy import numpy as np dname = os.path.dirname(os.path.abspath(__file__)) FILE_ROUGH_TILES = os.path.join( ...
e0d8126d30632432cf67385cd74cec36faad74f0ffdde74c8caa4f40bb99c82d
Python
16,970
421
# -*- coding: utf-8 -*- """ Created on Fr Sep 30 11:30 2022 @author: Jacqueline Cornean Here are the functions used in the expansion microscopy analysis. """ from tqdm.notebook import tqdm from scipy.spatial.distance import cdist import pandas as pd import numpy as np from skimage.feature import mat...
2cba448a5adebab6b91b9caaccc9e95c2270f403c6fae73dea0b7275cb50f0ca
Python
16,990
509
"""Loading toy datasets. Refer to notebook: `geomstats/notebooks/01_data_on_manifolds.ipynb` to visualize these datasets. Lead author: Nina Miolane. """ import csv import json import os import zipfile import numpy as np import pandas as pd import geomstats.backend as gs from geomstats.datasets._base import Figshar...
e0e70233a77d6dee5b2fdf1f5328dba6f8363a9babc2beb226d5dce353dae058
Python
16,997
353
# Copyright (c) 2021 PaddlePaddle Authors. 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. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
dd3961a8a8c199bc556c265308d7c82ffc517a2d3e14674913b63f20e8386c41
Python
17,006
426
#!/usr/bin/env python3 # # Sniffles2 # A fast structural variant caller for long-read sequencing data # # Created: 27.08.2021 # Author: Moritz Smolka # Contact: moritz.g.smolka@gmail.com # from dataclasses import dataclass import collections from sniffles import sv from sniffles import util from sniffles import con...
dcd87ea38a2e25083933b5ccabca4d486d45f797dc9f38880a210e292dc65099
Python
17,008
337
import numpy as np import pandas as pd import pytorch_lightning as pl import torch from torch.utils.data import random_split, DataLoader import sklearn from modules.dataset import RealFlashPatterns class FireflyDataModule(pl.LightningDataModule): def __init__(self, data_dir, augmentations, class_limit, batch_siz...
7f9efa809c420611b8caff9d5ca246126e5590f0c974c3e20b601a9662b3a6e7
Python
17,053
485
#!/usr/bin/env python3 import math import torch import torch.nn as nn from fairseq.data.data_utils import compute_mask_indices from fairseq.models import FairseqEncoder from fairseq.models.wav2vec import ConvFeatureExtractionModel from fairseq.modules import GradMultiply, LayerNorm, SamePad, TransformerEncoderLayer ...
eb1786362d4e802a1e9d83bd6d3dc18db0478545016575a587e03f3c171b4506
Python
17,067
398
import torch import torch.nn.functional as F import torch.nn as nn import ISNetFunctions import LRPDenseNet import pytorch_lightning as pl import warnings from collections import OrderedDict import numpy as np from torch.autograd import Variable import torch.autograd as ag import torchvision import torch.multiprocessi...
337bdf51630900432b21096e16b1ad89042696e097bb9f93970371f51f956d0e
Python
17,090
459
"""Cluster reports — peak/cluster geometry plus atlas labels. The peak/sub-peak geometry comes from `get_clusters_table`; the cluster masks and mass-weighted labels are computed locally so we can attribute every voxel of every cluster to one or more atlases. """ from collections.abc import Sequence from dataclasses i...
2431ab787b5797dc68144d943777d6349987da39a2bc8e8598909476e4701957
Python
17,141
430
# Copyright (c) 2021 PaddlePaddle Authors. 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. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
20c552dffef10f6abaf6198d463fce5dfcc90f3b9188427a678c463795d56fa7
Python
17,164
520
"""Classes for the pullback metric. Lead author: Nina Miolane. """ import geomstats.backend as gs from geomstats.geometry.riemannian_metric import RiemannianMetric from geomstats.numerics.geodesic import ExpODESolver, LogShootingSolver from geomstats.numerics.ivp import GSIVPIntegrator from geomstats.vectorization im...
b54a84d5fb8494cd0c1ff5720073e4c76ad2b02fc7f31e69105431a43a86e21d
Python
17,197
551
#!/opt/conda/bin/python import argparse import dask.dataframe as dd import json import matplotlib.pyplot as plt import numpy as np import os import os.path as op import pandas as pd import re import s3fs import seaborn as sns from matplotlib.lines import Line2D from matplotlib.markers import MarkerStyle from plot_for...
0ac49dca35840dc074a4444e87fe7771a68b0906366418ebf3807fad82aea5ca
Python
17,207
489
""" Created on Mon October 23 11:05:36 2023 Description: Visualization functions for Paper url: https://www.biorxiv.org/content/10.1101/2023.09.11.557230v2 @author: Ekaterina Kuzmina, ekaterina.kuzmina@skoltech.ru @author: Dmitrii Kriukov, dmitrii.kriukov@skoltech.ru """ import matplotlib.pyplot as plt import numpy ...
67d883756eb06a5e9de07f468bfc5127a60d0b5a0b31af2c1518cdb5be6f2822
Python
17,207
551
# Copyright (c) 2021 PaddlePaddle Authors. 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. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
0ebc0f8f8776f274bc67073ce43720a59eda14e5b6ee564c13c7ee28175070c8
Python
17,216
315
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # This work is licensed under the Creative Commons Attribution-NonCommercial # 4.0 International License. To view a copy of this license, visit # http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to # Creative Commons, PO Box 1866, Mountain ...
8a5a2a7192c174fcf8b31e4d22b7bac657e615bf92db5d8820e3d838df0c6f0b
Python
17,228
494
# Copyright (c) 2019 PaddlePaddle Authors. 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. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
6b048200086824d608c9bb7fc9ff126b7353deaee97aa48a42f5e97c893c5fcd
Python
17,238
514
# in this script to fellow fairly closely Zou et al # but the create a equivariant descriptor for each type # of tree topology from the beggining # We use a an embedding "across sequences" instead to # within sequences. # this is an optimized version of the lstm network import numpy as np # added random seed for re...
b5c675be78ee099942356cfeacff58e572a4c9b244e21370801e48458021fb3f
Python
17,238
399
import numpy as np # import tensorflow as tf import tensorflow.compat.v1 as tf tf.disable_v2_behavior() import os import sys import time import LSM_STDP_CONSTRUCTOR_N_MNIST as construct import NALSM_PARALLEL_SAVE as parasaver import NALSM_SIM_SUPPORT as runSupport import NALSM_GEN_SUPPORT as sup class ru...
c27f40145e384efc8d52ee5dd83a814c92950f242bdba836ae46fa471677442a
Python
17,256
365
# -*- coding: utf-8 -*- """ """ import scipy.stats as stats import matplotlib.pyplot as plt from scipy.io import loadmat, savemat from statsmodels.stats import multitest as mtest import pickle import numpy as np import pdb import os from plotting_functions import figure_layout, set_size from library_plot import im_ma...
0fcb2fecd07e39f97d52eb871018d273df08d6eab0fb7fd9dc7bd41b106f57f0
Python
17,274
406
import os import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.utils.rnn as rnn_utils from torch.utils.data import Dataset, DataLoader import numpy as np import dgl import shutil import random import logging import argparse from typing import List, Union from rdkit import Chem from rdkit i...
06d4f53527243e2158c2b3842d30b828a070164d815dcaf6f22259efdf329ad4
Python
17,300
709
"""Pytorch based computation backend.""" from collections.abc import Iterable as _Iterable import numpy as _np import torch as _torch from torch import ( arange, argmin, asarray, clip, complex64, complex128, conj, empty, empty_like, erf, eye, flatten, float32, f...
abffbf39b80dda4855441fcfa883bf4bd5ba7ea2c1605e54635a8a4542359367
Python
17,307
482
import rdkit import rdkit.Chem as Chem from scipy.sparse import csr_matrix from scipy.sparse.csgraph import minimum_spanning_tree from collections import defaultdict from rdkit.Chem.EnumerateStereoisomers import EnumerateStereoisomers, StereoEnumerationOptions from .vocab import Vocab MST_MAX_WEIGHT = 100 MAX_NCAND = ...
ffcac6e40c630c7334dc3a3ba8e54668744c288800fddc8a267d454816c817ec
Python
17,337
484
# Author: Guoqing Bao # School of Computer Science, The University of Sydney # Date: 2019-12-12 # GitHub Project Link: https://github.com/guoqingbao/Pathofusion # Please cite our work if you found it is useful for your research or clinical practice # from IPython import get_ipython # %% import os # os.environ["CUDA_V...
c92247b1251f093189e644a19c1b4e3e1dc59d8926f313629d1aff0facb4abd5
Python
17,340
458
import torch from torch.autograd import Variable import torch.nn.functional as F from torch.utils import data from torch.utils.data import SequentialSampler from torch import nn from tqdm import tqdm import matplotlib.pyplot as plt import numpy as np import pandas as pd from time import time from sklearn.metrics impor...
f261f14b994db96d3068c57232ed4ce2fcaa1c823d42fdafec19a4a43f455cef
Python
17,354
367
import tensorflow as tf from variational.layers import DenseReparameterisation def dice_sorensen_coefficient(x_avg, x): dsc = 2 * tf.divide(tf.multiply(x_avg, x), (tf.pow(x_avg, 2.0) + tf.pow(x, 2.0))) return dsc class AdaPool2D(tf.keras.layers.Layer): def __init__(self, pool_size, ...
85f5597dda8e44bdda1168f3cc23b61f9e26797d7c182f0078cfd3322d8a0284
Python
17,366
331
"""The spellings this repository's ASE calculators use for their results. The golden harness is deliberately framework-agnostic: it knows what a channel *is* -- its shape and its unit -- but not what any particular implementation calls it. That knowledge lives here (for the calculator surface) and in ``model_keys`` (f...
223e50eb3eac23be87c8012208040a462985bef502251812bbf1d20b15e69c3e
Python
17,373
452
"""Structural and cross-resource validation for SanPy Zarr collections.""" from __future__ import annotations import json from datetime import datetime from importlib.resources import files from pathlib import Path from typing import Any import pandas as pd import numpy as np import zarr from jsonschema import Draft...
ee0e8a68e2db5011814765b48b9f329ee84ce049f153f5a5dfab7a6c12ec4e67
Python
17,385
523
r"""Geodesic Regression. Lead author: Nicolas Guigui. The generative model of the data is: :math:`Z = Exp_{\beta_0}(\beta_1.X)` and :math:`Y = Exp_Z(\epsilon)` where: - :math:`Exp` denotes the Riemannian exponential, - :math:`\beta_0` is called the intercept, and is a point on the manifold, - :math:`\beta_1` is ca...
eab0dad618c601925e032e45ff316b2a3addefebc662d38cc400a7d6ac792d3f
Python
17,393
426
import os import re import collections import numpy as np import pydub from pydub import AudioSegment from pydub.utils import mediainfo import librosa import osa.configuration as configuration from common.data_sample import Sample def get_features_and_stats(waveform, orig_sr=48000, verbose=False): waveform = li...
e6697a77bcf9c047c5f4e2bcdeb200dd4fb68ec196caeff043167f5b08b91965
Python
17,401
488
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import csv import io import logging import re from collections import defaultdict from dataclasses import dataclass from pathlib import Path f...
f4631cd847107fcc296fdc6b916f77286c97a8be0782d4edfb0a723fda510d18
Python
17,411
377
r""" This is an official implementation of `FlowX: Towards Explainable Graph Neural Networks via Message Flows <https://arxiv.org/abs/2206.12987>`_. """ from itertools import combinations from typing import List, Tuple, Union, Dict import torch import torch.nn as nn from torch import Tensor from torch.nn.functional i...
8f9c23b14f371cf609bfcea05d42bbbd0c5571c57dc7ac4ead0aea513b41ff66
Python
17,424
519
import logging from collections.abc import Callable, Sequence from io import BytesIO from multiprocessing import Pool from pathlib import Path import cv2 import h5py import numpy as np from idtrackerai import Blob, Session from idtrackerai.start.arg_parser import pair_of_ints from idtrackerai.utils import ( LOGGI...
787b0dc73a4ab952f42bf8e63ec43890e635390fc3c3b36e03212a3f0eff7c73
Python
17,435
390
# -*- coding: utf-8 -*- # # # PyRates software framework for flexible implementation of neural # network model_templates and simulations. See also: # https://github.com/pyrates-neuroscience/PyRates # # Copyright (C) 2017-2018 the original authors (Richard Gast and # Daniel Rose), the Max-Planck-Institute for Human Cogn...
d7d1dc8f6f7f98159ab7315f7e3e90c6440335ff017000b0e1063326eb135d93
Python
17,440
384
"""Structural result records returned by fitting, decoding and resampling.""" from __future__ import annotations from copy import deepcopy from dataclasses import asdict as dataclass_asdict from dataclasses import dataclass, field from typing import TYPE_CHECKING, Any, Generic import numpy as np from nltools.models...
9b07fda867112276fc3c96c699c186826fd981563034ca0123799becd5951728
Python
17,449
282
# -*- coding: utf-8 -*- """ Created on Tue Aug 6 12:23:53 2019 @author: danilo """ import matplotlib.pyplot as plt import numpy as np import os from plotting_functions import figure_layout, set_size def table_plot(str_all, filename_tosave='example', pwd_tosave=None, hem_sep=True, mouse_name=None): ###############...
065615e54cea1d48aac9de7e79075340e0b5e712da18177ca39a3acfcb37fbc8
Python
17,452
480
# Copyright (c) 2022 PaddlePaddle Authors. 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. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
aa2938d842c104882aa4ca52fc016c9fb510086f3ff37d70b85e42f8ad76e544
Python
17,459
565
import numpy as np import cv2 import copy def decode_image(img_path): with open(img_path, 'rb') as f: im_read = f.read() data = np.frombuffer(im_read, dtype='uint8') im = cv2.imdecode(data, 1) # BGR mode, but need RGB mode im = cv2.cvtColor(im, cv2.COLOR_BGR2RGB) img_info = { "im_...
a46e78e0296578c16dd8f9e945154b2b408bed9118da81890320bec089421b0e
Python
17,465
293
"""CDR3 markup and repair, via ``arda.cdr3fix``. Replaces the k-mer scanner vendored from the Groovy-era build (``annotate/_legacy_fixer/``). ``arda`` aligns the germline-templated run with a semi-global Needleman-Wunsch anchored at [FW]118 with free end gaps, where the legacy used a longest-hit k-mer scan, so it exte...
4692993cfab51ac39f1a8739b0d2b2b0be600b53a15bb628bd1aca21c15e4aac
Python
17,485
510
from __future__ import annotations import argparse import copy import tempfile from pathlib import Path from typing import Any, Mapping, Sequence import pytest from hypothesis import given from hypothesis import strategies as st from pytest_mock import MockerFixture from pytest_mock.plugin import MockType from snake...
9971acff773c4a5ffba51e3aa671731aa8dbc011fce46f340f0dcb306cd4a21e
Python
17,560
403
import numpy as np # import tensorflow as tf import tensorflow.compat.v1 as tf tf.disable_v2_behavior() import os import sys import time import NALSM_CONSTRUCTOR_N_MNIST_NOISE as construct import NALSM_PARALLEL_SAVE as parasaver import NALSM_SIM_SUPPORT as runSupport import NALSM_GEN_SUPPORT as sup class...
cffbd3414c297ef3f1ab77e698d2dd0c1930d9cf2ebfae1f0fd44c3e88e22370
Python
17,561
467
# -*- coding: utf-8 -*- """ Created on Sun Aug 3 15:18:38 2014 @author: Dan Denman and Josh Siegle Loads .continuous, .events, and .spikes files saved from the Open Ephys GUI Usage: import OpenEphys data = OpenEphys.load(pathToFile) # returns a dict with data, timestamps, etc. """ import os import numpy a...
39ae6fd597dd51b09fdafbebda06b80e0e3787ee0cf64d8a569576f4d1fc91a2
Python
17,567
481
########################################################################################### # Script for evaluating configurations contained in an xyz file with a trained model # Authors: Ilyes Batatia, Gregor Simm # This program is distributed under the MIT License (see MIT.md) ########################################...
d9bb95a76a99e4f036d92808fde95764f30ba78cecd7f262218f606d794ed8fb
Python
17,568
422
import time import os import torch import torch.nn.functional as F from torch.optim import Adam from torch_geometric.data import DataLoader from metric import compute_cla_metric, compute_reg_metric import numpy as np from libauc.losses import APLoss_SH, AUCMLoss from libauc.optimizers import SOAP_ADAM, PESG from libauc...
e87e39955249b4c3a858e95616c3c1a65961f97017aa21f29bbe45d6c22e2d0a
Python
17,575
322
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # This work is licensed under the Creative Commons Attribution-NonCommercial # 4.0 International License. To view a copy of this license, visit # http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to # Creative Commons, PO Box 1866, Mountain ...
b0495954e3a28a952707adc6237b358c9332745307f7393d517e66ef4a94b9da
Python
17,580
537
# %% """ #### ## ## ######## ####### ######## ######## ###### ## ### ### ## ## ## ## ## ## ## ## ## ## #### #### ## ## ## ## ## ## ## ## ## ## ### ## ######## ## ## ######## ## ###### ## ## ## ## ## ## ## ## ...
b25cb10ff7dd8e52cb30c26279e98c949f2d53b0c3890cb8605a2f82041c6f57
Python
17,592
422
"""Intersubject correlation, functional connectivity, and phase synchrony.""" import numpy as np import polars as pl from scipy.signal import hilbert from .isc import _isc_permutation_test from .matrix import _compute_cross_correlation from .utils import _maybe_tqdm from ..signal import ( _butter_bandpass_filter...
5a3db2cf740e0f14bf86a549d172be0f189b6738cfc0c8f8e3495aa419820660
Python
17,652
443
################################################################################ # Import, Set up MPI Variables, Load Necessary Files ################################################################################ import os from os.path import join import sys import matplotlib import matplotlib.pyplot as plt from matp...
9a5e869d68d9f261866be4ace055a3397563235257ec70d973e1af591e8860b5
Python
17,656
443
import io import multiprocessing as mp import os import queue import tarfile import time from multiprocessing.shared_memory import SharedMemory from os import PathLike from pathlib import Path from typing import Optional, TypedDict import warnings import numpy as np from PIL import Image from ppafm.ocl.field import El...
07107d1b7ec81ad28672e4f90c639b90d5231cede2bd7e7a563ce8d671a73cc0
Python
17,667
463
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # OS stuff import os import sys import warnings from pathlib import Path # Computational stuff import numpy as np import matplotlib as mplb import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec, GridSpecFromSubplotSpec from matplotlib import font_manag...
7d357a60a618b41d3cbc14f68edd9568141429d8767450dbf3cb0ed33a2abc23
Python
17,667
502
# Copyright (c) 2021 PaddlePaddle Authors. 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. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
202445a680891688656ba86abd325b465ee3d8c42a892863e00d0510291d5dbc
Python
17,681
462
import argparse import json import os import sys import time import numpy as np import psutil from .history import History from .optimizer import Optimizer, make_optimizer g_log_file = sys.stderr # File used by printlog() g_log_echo = False # True if printlog() should print to stderr. def assert_equal(first, sec...
6d226b12af4211653fb5a19fb447c8f03f08274aa4cfa51a1a4e99e498637063
Python
17,684
459
import pytest from geomstats.test.vectorization import generate_vectorization_data from geomstats.test_cases.geometry.riemannian_metric import RiemannianMetricTestCase from geomstats.vectorization import repeat_point # TODO: more random tests (e.g. inner product) # TODO: add lie algebra related tests class _Invari...
09a7a874b9be7d95db2b1fb57dd28cff5f0fca6c3d0c7ef96fa198c79b75c82d
Python
17,690
363
import numpy as np import os import sys import NALSM_GEN_SUPPORT as sup import GEN_NET_LIF as cLIF class create_network: def __init__(self,seed_IN): self.main_Path = os.getcwd() self.codePath = self.main_Path self.dataPath = self.main_Path + '/networks' np.random.seed...
3071c96b57c31652b4cc04b66f55ac3d48ac40e543d458df61749af69d37c07d
Python
17,691
480
"""Shared helpers for BrainData submodules. These are internal utilities used by the facade and submodules — not part of the public API. """ import gc import os import threading from contextlib import contextmanager import numpy as np from numpy.typing import ArrayLike from ..ownership import _copy_graph #: Guard...
36dc22e4ed873b1acd69c523e53ce0234b2b840370c672ab842b911b3728a39e
Python
17,706
489
""" Integration test for the Collection statistics wrapper methods """ import json import time from typing import Any import pytest from chromadb.api.client import Client as ClientCreator from chromadb.base_types import SparseVector from chromadb.config import System from chromadb.test.conftest import skip_if_not_cl...
db51d84dc30180532e24b3a201aa2f22cb7f5684aa2b74c797edfd1fbec5f34d
Python
17,708
435
# Copyright (c) 2023 PaddlePaddle Authors. 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. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
3c4d94816ad89cfc627cb5b9d3a0680ceab31cccc7e72e63a2cc678631da0eae
Python
17,719
461
# Method signatures differ between Qt bindings, so overrides can't match them all # pyright: reportIncompatibleMethodOverride=false import logging from collections.abc import Iterable, Sequence from contextlib import suppress from pathlib import Path import numpy as np import toml from qtpy.QtCore import Signal # typ...
aa59a832187b0ef8fa0758f464e00c32a0464ddbb86fb3044a91a1582109ca1b
Python
17,720
467
# Copyright (c) 2023 PaddlePaddle Authors. 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. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
f0dbc619a2b79de8b9ee0fb97723385e2410fed481b78c7947b1596f8a980411
Python
17,749
443
################################################################################ # Import, Set up MPI Variables, Load Necessary Files ################################################################################ import os from os.path import join import sys import matplotlib import matplotlib.pyplot as plt from matp...
e9f3a55822aca01eca2b76fe60ee9d006a7bebe595f724af5dfc8efa3dc9d3aa
Python
17,760
450
# Method signatures differ between Qt bindings, so overrides can't match them all # pyright: reportIncompatibleMethodOverride=false import logging from collections.abc import Sequence from pathlib import Path from typing import Any import cv2 import toml from qtpy.QtCore import Qt, QTimer from qtpy.QtGui import QKeyEv...
2ded00f9971360aafee73ecc87c41a3ac4a2d57bf484cfe35620c8c316da15e5
Python
17,761
475
import logging import os import warnings import json from pathlib import Path from datetime import datetime import numpy as np from ScanImageTiffReader import ScanImageTiffReader with warnings.catch_warnings(): warnings.simplefilter('ignore', category=FutureWarning) import caiman as cm from caiman.source_...
939bca5bbd623287fb44d329aa9c103df13e64e916a76aabd5982006839e7335
Python
17,765
516
"""CCA and PLS estimators. """ import warnings import numpy as np from scipy.linalg import svd from scipy.stats import pearsonr from scipy.spatial.distance import cdist from sklearn.base import BaseEstimator from sklearn.utils import check_array, check_consistent_length from sklearn.utils.validation import check_is_...
485fa83a9e373c5a96fe4382f23630e438d4dc061fe091f155cbb93ae3bc0446
Python
17,777
318
import haiku as hk import jax from jax import numpy as jnp from deeperwin.configuration import MLPConfig, TransferableAtomicOrbitalsConfig, OrbFeatureDenseGNNConfig from deeperwin.model import MLP, antisymmetrize, symmetrize, DiffAndDistances, Embeddings from deeperwin.model.mlp import get_rbf_features from deeperwin.m...
62c8d5bbbb9ce67130a30e830ab2f678bfb08131499329baa3d4eed7cd58a8ef
Python
17,794
485
#!/usr/bin/env python3 import collections.abc import math import warnings from itertools import repeat from typing import List, Optional, Tuple import torch import torch.nn as nn import torch.nn.functional as F try: from torch import _assert except ImportError: def _assert(condition: bool, message: str): ...
55da8850bf4e19dcb85bae994a9c8bdc4bcc5516f64e2a777bb776bf7eb8a1f4
Python
17,830
334
"""Small discrete Bayesian evidence classifier with exact missing-value inference. Install the ``confidence`` extra for fitting. Missing fields are marginalized at prediction; no evidence returns the fitted network prior. Fitted artifacts contain no receptor identities. """ from __future__ import annotations import m...
528464b2c04a6a3ed06c828a93fa879b2956fe9b14807621a0d06b97e5c83a1d
Python
17,839
426
import os import torch from tqdm import trange import torch.nn as nn from torch_geometric.data import Batch, Data from dig.sslgraph.method.contrastive.objectives import NCE_loss, JSE_loss class Contrastive(nn.Module): r""" Base class for creating contrastive learning models for either graph-level or node...
2f023c467bec24f15b92eaa19a037db07f71546ea78064876c3b8570f12aec09
Python
17,846
485
from configparser import ConfigParser import numpy as np import zipfile import time from subprocess import call import os import pickle import imageio import sys import shutil import glob #import matplotlib.pylab as plt #storage_manager_folder = '../../Data/StorageManager/' def create_folder_if_not_exist(path): ...
9606d455557c003985cb91141c7bf630a379b18699a09ec2a1ff7e94831d3a52
Python
17,851
449
''' Description: Author: voicebeer Date: 2020-09-09 00:06:57 LastEditTime: 2021-03-25 03:27:41 ''' import torch.nn as nn import torch.nn.functional as F import torch import numpy as np import utils class CFE(nn.Module): def __init__(self): super(CFE, self).__init__() self.module = nn.Sequential...
d5579d44bb02a76a2840ce17a12114fa765d0f8b3a3721d5dfd14a7d51858fcf
Python
17,878
460
# -*- coding: utf-8 -*- import os from warnings import warn from importlib import import_module import requests from dival import get_standard_dataset from dival.reconstructors import LearnedReconstructor from dival.config import CONFIG from dival.util.input import input_yes_no from dival.util.download import download_...
4fe215f1bea138c6d75b28734f3b520191b5fe895527510d19ffe190072aafb5
Python
17,887
358
import numpy as np from orientation_reconstruction_utilities import * import statistics import matplotlib.pyplot as plt import matplotlib as mpl import pickle from matplotlib.lines import Line2D ################################# # input data ################################# eeg_lf = np.load('data/V5_eeg_lf.npy') meg...
b855d053e4d41406dbaef3cfcc1db09fc5ba3ce1fd066773cbb6aaeb1a223aae
Python
17,899
425
# Copyright (c) 2022 PaddlePaddle Authors. 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. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
3414ed967fbbfbf3cb6a5983d6a55681a17f67e0f189f568e0d9bbc86df4152b
Python
17,924
381
# This file is a part of the `nequip` package. Please see LICENSE and README at the root for information on using it. import torch from .. import AtomicDataDict from nequip.utils.logger import RankedLogger import lightning from omegaconf import OmegaConf, DictConfig, ListConfig from hydra.utils import instantiate impo...
be1b575d8f33371e1e7ab3dab6ec345cb46db749273f977fe4bb75176249b43d
Python
17,938
497
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from dataclasses import dataclass, field import itertools import json import logging import os from typing import Optional from argparse impor...
e9c429ac3ae0bc195f65c12337ee99708dd7b273595b8fe3f267dfb23f101250
Python
17,947
400
import numpy as np # import tensorflow as tf import tensorflow.compat.v1 as tf tf.disable_v2_behavior() import os import sys import time import LSM_STDP_CONSTRUCTOR_MNIST as construct import NALSM_PARALLEL_SAVE as parasaver import NALSM_SIM_SUPPORT as runSupport import NALSM_GEN_SUPPORT as sup class run_...
d365af19ff2e8d6cfa71843caf526ecd6dca0b1316b33090ac47a0c2ee72aa2f
Python
17,971
514
import sys import json from tqdm import tqdm import pickle sys.path.append('../') from utils import * from processing import * import numpy as np import random from sklearn.utils.extmath import randomized_svd from sklearn.decomposition import TruncatedSVD from joblib import Parallel, delayed class Subs...
3ac3a7c1ff6ce0da480c4c7625da5daf6645d1b71fdbf0660c1569877d09579a
Python
17,982
481
# Copyright (c) 2021 PaddlePaddle Authors. 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. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unl...
3efba631859e5f411a09b77c8524ac17dd8829e74bc803c7b82066fd305afd3d
Python
17,992
503
import torch from torch.autograd import Variable import torch.nn.functional as F from torch.utils import data from torch.utils.data import SequentialSampler from torch import nn from tqdm import tqdm import matplotlib.pyplot as plt import numpy as np import pandas as pd from time import time from sklearn.metrics impo...
dde96f1646839a75fb077ebd453bfe6c28575d5500fe69c973d3c97e92efbff9
Python
17,993
574
import lightning as L import numpy as np import torch from lightning.pytorch.callbacks import ModelCheckpoint from lightning.pytorch.callbacks.early_stopping import EarlyStopping from .linear import LinearIVAC, LinearVAC class NonlinearIVAC: """Solve nonlinear IVAC using a neural network basis. Parameters ...
ffe2dcf26f396881fde1eab51012d8465b0fe9a0ceee3fb5df0f1e04db446043
Python
18,022
550
"Saving and loading of trajectory files in all supported formats and versions" import json import logging import pickle from argparse import ArgumentParser from collections.abc import Iterable from contextlib import suppress from pathlib import Path from typing import Literal import numpy as np from h5py import Datas...
1aa44f1afef6e8e7c3950089cc9201f8ffd3f792d90b6f41963d993f23178da2
Python
18,040
457
import sys import os sys.path.append(os.path.abspath('')) sys.path.append(os.path.abspath('..')) import time import datetime import torch.nn as nn from torchnet import meter import pickle import argparse from torch_geometric.loader import DataLoader from data_io_guassian import NeighResidue3DPoint from GN_model_guass...
0713d463be05835cfa83a2e80626474cd817722cbc05a134e3e515c319e4f089
Python
18,041
358
"""The interactive dashboard: one self-contained HTML file, served from GitHub Pages. An **additive** artifact. The R document stays the shipped dashboard - `vdjdb-web` injects its fragment into `/overview` and `summary/check_summary.py` gates it - and nothing here feeds that path. This is the version you can interrog...
37e2a8fde9c3e461d8a58300776d943614ef1ed0e4d11dd94fce576fcafa0f9f
Python
18,047
468
''' Utilities for the construction of the reduced version of a Neural Network. ''' import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from sklearn import decomposition from scipy import linalg if torch.cuda.is_available(): device = torch.device('cuda') else: device = torch...
4c50606bdbb34392f66fabf879413da6337d5da5c252320e7fd218d1e921de16
Python
18,091
485
import argparse import json import os import sys import matplotlib.pyplot as plt import nibabel as nib import numpy as np import pandas as pd import seaborn as sns from matplotlib.colors import to_rgba from nilearn import datasets, plotting from pydfc import data_loader from pydfc.ml_utils import find_available_subje...
cce198bd3b6c90c126a86707479e255dfc0f3d7cf8cb3603b373f3807565dc5f
Python
18,131
454
import numpy as np import polars as pl import pytest from nltools.data import BrainData, Adjacency class TestBrainDataCore: """Test BrainData dunders, properties, arithmetic, stats, indexing, append, copy, and distance.""" # ==================== Properties & Statistics ==================== def test_sha...
7c1109752706096e33c20e8daac995014a020b6a41d1a655edead7b20fc28ccb
Python
18,165
462
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import contextlib import logging import os from collections import OrderedDict from argparse import ArgumentError import torch from fairseq i...
7f2e509580c7bba5da93b5d8537184d389761b6ebad8f872a3ef13e986d68434
Python
18,193
567
#! /usr/bin/env python3 # igraph library # Copyright (C) 2005-2021 The igraph development team # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or #...
28b3175f7a2499e56066f4dab87e63e3f0257c35fa751468b33e5da6171e414f
Python
18,219
405
import numpy as np # import tensorflow as tf import tensorflow.compat.v1 as tf tf.disable_v2_behavior() import os import sys import time import NALSM_CONSTRUCTOR_MNIST_NOISE as construct import NALSM_PARALLEL_SAVE as parasaver import NALSM_SIM_SUPPORT as runSupport import NALSM_GEN_SUPPORT as sup class r...