sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
2b98616c4d338f81991400078340f8546057f327ad8adc03051f3c206e4e63de
Python
26,385
806
"""Sample size predictions based on a linear model.""" import numbers from pkg_resources import resource_filename import numpy as np import xarray as xr from sklearn.linear_model import LinearRegression # from ..sample_analysis import analyze_model_parameters from .interpolation import calc_n_required_all_metrics, ...
3fd1b345f2d53fac58fc4e1383813a9e85acc4d4801576ce5d498bff1feb1ba5
Python
26,394
767
"""Product of manifolds. Lead author: Nicolas Guigui, John Harvey. """ import math import geomstats.backend as gs import geomstats.errors from geomstats.geometry.complex_manifold import ComplexManifold from geomstats.geometry.complex_riemannian_metric import ComplexRiemannianMetric from geomstats.geometry.manifold i...
de082947e786e8014a1d006f500729d6dd48dd7f7ee564bb7ab04a0417c1626f
Python
26,442
823
import tensorflow as tf import pandas as pd import numpy as np import matplotlib.pyplot as plt from matplotlib import cm, gridspec import scipy import seaborn as sns import random import itertools import keras from scipy.sparse.linalg import lsmr import statsmodels.api as sm from scipy.stats import pearsonr, spearma...
33dd2094e16f8b70d50a4fc3bc0357877774014c0f8981848415f23663e286e3
Python
26,471
667
"""Load an intracellular current-clamp NWB file into a SanPy ``bAnalysis``. This standalone development script defines an NWB file-loader subclass and injects it into ``bAnalysis`` without modifying SanPy's installed loader registry. Edit ``NWB_PATH`` in the ``__main__`` block before running it. run with: uv run ...
0e19022b1d251dde6c7b9533450dc27c33059359845023701caa2155055a7384
Python
26,477
693
# 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...
493e5504b21b6bfc6b2ee9a2ed4c5ba47a5a1026040a9c680b0c24e877e67a2d
Python
26,480
815
from typing import TYPE_CHECKING from chromadb import ( CollectionMetadata, Embeddings, GetResult, IDs, Where, WhereDocument, Include, Documents, Metadatas, QueryResult, URIs, ) from chromadb.api import ServerAPI if TYPE_CHECKING: from chromadb.api.models.AttachedFuncti...
34bfc1a260e5abe28bf628d833fd6981409124f53f771d851513509f597e4347
Python
26,539
716
# sys import sys import os import shutil import dill import configparser from pathlib import Path # sci import numpy as np import pandas as pd from sklearn.cluster import KMeans from sklearn.decomposition import PCA import quantities as pq # ephys import neo import elephant as ele # plotting import matplotlib as mpl...
012c98cb09ef5839738c6645f37fe266bc3f4d82cf0b534afaa8797e840b7007
Python
26,540
759
# Script containing the modular version of the code # so far we have only implemented the non_linear_embedding layer # for simplicity we can just use dense layers for the merge operations import numpy as np # import matplotlib.pyplot as plt import torch import h5py import torch.nn as nn from torch.utils import data ...
fe41cb2fe1e7e470ca8ca1700e03d7120a2c3e546f3927658ca23c0c5648f01a
Python
26,559
875
""" Session and experiment management Author: Tal Eisenberg, 2021 Responsible for creating/continuing/deleting sessions and loading, running, and managing the lifecycle of experiment modules. """ from datetime import datetime import inspect import re import json import shutil import pandas as pd from pathlib import ...
1b72060cf028ea4f674b612c2cc45650fcfb0ffb7de328be7227ba91d945c7d4
Python
26,596
764
# -*- 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...
6cb705bfccd7ac836334d4726d39cc8789df9ad6259f432b5c23c0da2ed779d1
Python
26,617
705
# 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. """ RoBERTa: A Robustly Optimized BERT Pretraining Approach. """ import logging import torch import torch.nn as nn import torch.nn.functional...
abffd3309025766fdc0eea28d9a6230ca534a502eea03c83927270fd409c81b9
Python
26,619
688
from typing import Dict, Optional, Sequence, Tuple, TypedDict, Union, cast from uuid import UUID import json import numpy as np from numpy.typing import NDArray import chromadb.proto.chroma_pb2 as chroma_pb import chromadb.proto.query_executor_pb2 as query_pb from chromadb.api.collection_configuration import ( co...
a9731c5177425cf6c350b5d35fbe834a044ca8c33538212bfdb967e40e7e0a36
Python
26,698
691
# 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 logging import os import warnings from argparse import Namespace from typing import Any, Callable, Dict, List import torch from fairse...
6331717b475e71a546c8540f90e4f535ed33c51186e595e6334815b2f0367f68
Python
26,704
581
"""Test suite for basic backend simulation functionalities. """ # external _imports from typing import Union import numpy as np import pytest # pyrates internal _imports from pyrates import integrate # meta infos __author__ = "Richard Gast, Daniel Rose" __status__ = "Development" ########### # Utility # ###########...
93533821541143e14e89f91f42e38ba27eb51805b6961666ccaaa3e46f01d103
Python
26,717
671
import seaborn as sns import numpy as np import scanpy as sc import squidpy as sq from scipy.spatial import distance_matrix from scipy.spatial.distance import * import time import anndata as ad from sklearn.metrics import * from sklearn.ensemble import RandomForestRegressor,RandomForestClassifier from sklearn.multioutp...
ea79bb94fa50526d533339d0e0ef4c9e22759886737bc881d5525a6e3e7a5d32
Python
26,724
748
# 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 copy import logging import math import re from argparse import Namespace from dataclasses import dataclass, field fro...
f981cccab721432ccf535c298a576678823fa674795e4d23f374df242edfc0c2
Python
26,727
673
from PymoNNto.NetworkCore.Network import * import numpy as np import matplotlib.pylab as plt from collections import Counter import scipy.sparse as sp class Reconstruct_Analyze_Label_Network(): def __init__(self, network): self.network = network def get_network_responses(self, pattern_group, target_...
33d2a0ddcc398812022e3b78d8054982dfa1be6817202a9ce0fb84b0b6a4991f
Python
26,793
796
#import matplotlib #matplotlib.use('Qt5Agg') from PyQt5 import QtCore from PyQt5.QtGui import * from PyQt5.QtWidgets import * import pyqtgraph as pg import numpy as np #from Exploration.Visualization.Visualization_Helper import * from PyQt5.QtWidgets import QTabWidget from PyQt5.QtCore import Qt, QPoint, QMimeData fr...
53778db36c080681f8d3d56e0e77e84fda81ee0d5e01a11892a38b57eeebe327
Python
26,793
523
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_GEN_SUPPORT as sup import NALSM_PARALLEL_SAVE as parasaver import NALSM_CONSTRUCTOR_MNIST as construct import NALSM_SIM_SUPPORT as runSupport class run_sim: ...
a8b27b0152a33811d37e8605b3541047395cac587d8651750418cbdf4a1a3a8d
Python
26,798
557
# %% import os import sys import math import numpy as np import time import h5py import pyfftw from scipy import sparse from scipy import signal from scipy import special from scipy.optimize import linear_sum_assignment from scipy.io import savemat, loadmat import multiprocessing as mp from suns.Online.par_online impo...
90b24000fc1e773200625db55772345c2669d60fc36cd96ab4f0df04d12962db
Python
26,804
604
"""ROC (Receiver Operating Characteristic) analysis for single-interval classification. These tools provide the ability to quickly run receiver operating characteristic analyses on the output of machine-learning models applied to imaging data. """ import numpy as np from nltools.plotting import _plot_roc from scipy.s...
bfd17de5cb587f788e74fe2a6efae6d420a144ec78dac2a67624e90a7144ead3
Python
26,821
788
""" Descriptive statistical functions """ from __future__ import absolute_import from functools import wraps import itertools from decorator import decorator import numpy as np from scipy import stats import warnings from . import CI from .iterators import nd_bootstrap from .decorators import mod2pi, swap2zeroaxis ...
7aee3fa029a670a68d29eb2f238c9f0548849e1ea989775060935fc6a8238d73
Python
26,844
870
""" This module is responsible for creating visualizations for images, videos, statistical plots and notebook widgets. Documented more loosely than the other modules, as it's less important Authors: Tal Eisenberg, Itai Turkenish, 2020 """ import os import numpy as np import cv2 as cv import matplotlib.pyplot as plt f...
c7f03e780618209acce7e38ecb69d944b00fa2b9b2be2343cd5b80126835fb25
Python
26,854
948
"""Module exposing the `Matrices` and `MatricesMetric` class.""" import logging import math from functools import reduce import geomstats.backend as gs import geomstats.errors from geomstats.algebra_utils import flip_determinant, from_vector_to_diagonal_matrix from geomstats.geometry.base import MatrixVectorSpace fro...
43f3ad422fe10996e66c0bb80d8269b9cab0c810f10256143fd8d4979fff663b
Python
26,873
842
# 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 argparse import collections import contextlib import copy import importlib import logging import os import sys import warnings from ite...
f5044ccdd389b47c4e9b22982ec57470e015e25a36edaa876ffd3548ef8f845b
Python
26,894
652
import logging import os import pickle import coloredlogs import numpy as np import torch import torch.nn.functional as F from einops import rearrange from torch import nn from adni.models.network import make_network from common.adni.utils import CATEGORICAL_COLS, NUMERICAL_COLS, CATEGORY2CLASSNUM, IMAGING_COLS, remo...
53b92729825fa2e95148671125ca3538e73b989e604803c732f92c2d9962e417
Python
26,922
747
# 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 copy import logging from typing import Dict, List, Optional, Tuple import numpy as np import torch import torch.nn as nn from torch im...
4b795613af2a04058c5b19a4f66ce4c7049266d6380fbbb86655baa22f8a5199
Python
26,923
720
# 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...
f5b077dce7aac75b2250d1f13ffe894a030fb8833d0ee671a89c458cbeb22203
Python
26,926
749
# copyright (c) 2022 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 applicabl...
73aad30520402f62da0b18e9d1df3c90f95f674f5b4db2d738faf5d5dcfa4db9
Python
26,929
588
"""The release comparison, on fixtures small enough to reason about. The comparison is the acceptance gate for every later phase, so its own failure modes matter more than most: one that under-reports would wave a regression through, and one that over-reports would be switched off. """ from __future__ import annotatio...
9915c7afa4ebeecd8b8ef86e2320a8a1710baf20fe84d2f1fb0ab7c9d344f54f
Python
26,949
811
import torch import numpy as np import matplotlib.pyplot as plt import matplotlib from matplotlib import cm from matplotlib.axes import Axes from matplotlib.image import AxesImage from torch.nn.modules.utils import _pair from matplotlib.collections import PathCollection from mpl_toolkits.axes_grid1 import make_axes_lo...
6a690d12df79cbca1fd37d172d279bdc1abe9974698240436a32b242e3437caa
Python
26,954
723
"""MACE TorchSim model interface.""" from __future__ import annotations import logging from pathlib import Path from typing import Any, Callable, Dict, Optional, Union import torch from mace.modules.extensions import PolarMACE from mace.tools import atomic_numbers_to_indices, utils log = logging.getLogger(__name__...
dd90a78aefbdd3d3d1739fdce8130f11a126731d04d33fed1e0e0bf5224db459
Python
26,968
524
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 as construct import NALSM_GEN_SUPPORT as sup import NALSM_PARALLEL_SAVE as parasaver import NALSM_SIM_SUPPORT as runSupport class run_sim...
0679d8dfd96124d1cf5b51032d237fdb2226b18e02d4278e09fb43e07e2c47f5
Python
27,040
604
# Copyright 2020-2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 """Experimental Aggregator module.""" import asyncio import inspect import queue import time from copy import deepcopy from logging import getLogger from threading import Event from typing import Any, Callable, Dict, List, Tuple import di...
0a91f0d3b73111e7b1a38d0dfb1f60fcfdbbf36582fc2799c6e17c100007a622
Python
27,049
884
import itertools import numpy as np import numba as nb from scipy import linalg, signal # ----------------------------------------------------------------------------- # trajectory functions class LazyTrajectories: """Load trajectories lazily from disk. Parameters ---------- filenames : list of str...
ee07ced3abb874bd672b5b16d6ae8752187001fe1f033da8d0ff0e2eae93da29
Python
27,063
842
from __future__ import print_function import os import subprocess import glob import copy import pprint import torch import numpy as np import matplotlib.pyplot as plt import utils import analysis_utils from dataset_learning_trainable import DatasetLearningTrainable import torch.nn as nn import torch.nn.functional ...
9d409e0fc5c6b69a931455e43ca6559c8bf78f7313af84916e807758414e4bd1
Python
27,079
865
# Authors: Carolina Fernandez <cxf418@miami.edu> # Nick Tolley <nicholas_tolley@brown.edu> # Ryan Thorpe <ryan_thorpe@brown.edu> # Mainak Jas <mjas@mgh.harvard.edu> import pickle from hnn_core import simulate_dipole from hnn_core.dipole import _rmse from hnn_core.optimization import Optimiz...
572334c3cb64309261bc921b0f02daac6cdfe4f7e4519081674a7f5b40ff20cf
Python
27,126
638
# 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...
47635ecd549c00e5f67fddebd705adaa8516ea762121818445639961687e5ad0
Python
27,172
868
from __future__ import absolute_import, division, print_function from builtins import range import os import numpy as np import pickle import gzip import math import random import pymatgen as mg import rdkit from rdkit import DataStructs from rdkit.Chem import AllChem as Chem from rdkit.Chem import Crippen, MolFromSmil...
71bd1f016e2e204f39f244ed5bbef28ad51bbfc506f345c36c74e1025dd45aa6
Python
27,186
528
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_...
8f142e4f8b0a0a6172ea49286cdf5c3cfa2a85ecd145f353a65e0442bb1cdc55
Python
27,209
678
import scipy.io import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import to_rgba import os import pandas as pd # ============================================================================= # path configuration <- edit this section before running # ===================================...
f2d5c262bde718952173ffec686aa6e8f664dc84c196a03b24b29cf9d3727858
Python
27,227
546
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_APSTDP_CONSTRUCTOR_N_MNIST as construct import NALSM_PARALLEL_SAVE as parasaver import NALSM_SIM_SUPPORT as runSupport import NALSM_GEN_SUPPORT as sup class ...
416aade3af5ae445bd996fef6efbc68f46204dc93204a5fee41f5a7339f24fef
Python
27,238
666
import logging import os import pickle import coloredlogs import numpy as np import torch import torch.nn.functional as F from einops import rearrange from torch import nn from adni.models.network import make_network from common.adni.utils import CATEGORICAL_COLS, NUMERICAL_COLS, CATEGORY2CLASSNUM, IMAGING_COLS, remo...
44bcc13462a55d227998a055f59d3e1afa071ebd5646ee8d1dac6ca5f14d8d3d
Python
27,273
823
#!/usr/bin/env python # coding: latin-1 """ Shared Response Model (SRM) =========================== The implementations are based on the following publications: Chen, P. H. C., Chen, J., Yeshurun, Y., Hasson, U., Haxby, J., & Ramadge, P. J. (2015). A reduced-dimension fMRI shared response model. In A...
d3f2cc0ee763cecb26d0aac0f0769355db3466da063190cb4d65dee79e654553
Python
27,274
648
"""pfl3_stim.py Analysis and plotting functions for PFL3_LAL_stimulation.ipynb """ import os import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns import scipy as sc import matplotlib as mpl import read_data as rd import analysis_plot as ap import functions as fc import plotti...
8d4a62f703b7f2e6bef63aab7e0900b3db18cb86d7afaa2eb57c3aa3b16990eb
Python
27,290
800
# Copyright 2020-2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 """openfl.experimental.workflow.utilities.metaflow_utils module.""" from __future__ import annotations import ast import fcntl import hashlib import os import tempfile from datetime import datetime from pathlib import Path # getsource on...
457db7b5211788f140d6016d1d7f9fe0799aadbf865456e2645078cad487f2d4
Python
27,326
518
# Copyright 2025 Intel Corporation # SPDX-License-Identifier: Apache-2.0 from hashlib import sha256, sha384 import json from unittest.mock import MagicMock, patch from openfl.federated.data.sources.azure_blob_data_source import AzureBlobDataSource from openfl.federated.data.sources.local_data_source import LocalDataSo...
0cbf933acdbeb02f05721902b231a34ec2fb97bbcbe0889cfa2982a401b165c6
Python
27,335
712
""" Created on Sat September 17 21:15:06 2023 Description: Datasets class implementation 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 mat73 import numpy as np impor...
8a5a8e8066c1997550c3e4c00a2ac6aae289a16fb0a28fa9535bb639a1c1ab05
Python
27,369
595
# Copyright 2025 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import json import os from pathlib import Path from typing import List, Tuple from unittest.mock import MagicMock, patch import pytest import boto3 from moto import mock_aws import torch from torchvision.transforms import ToTensor import io fro...
65fb539ca1501b9b209e13d182edb26549f34d64ae9aa031d14da3c81752e35f
Python
27,372
903
import asyncio import os from typing import Any, Dict, List, Optional, Union from uuid import uuid4 import numpy as np import pytest from chromadb.api import ClientAPI from chromadb.api.client import Client as ClientCreator from chromadb.api.conditional_http import ConditionalHttpTransaction from chromadb.api.models....
deb1a3507dce17b510cd755f2a73817ea1ead5c49b2ab33b8323f4df0dcd117e
Python
27,456
688
""" metrics for the neuron project If you use this code, please cite the following, and read function docs for further info/citations Dalca AV, Guttag J, Sabuncu MR Anatomical Priors in Convolutional Networks for Unsupervised Biomedical Segmentation, CVPR 2018. https://arxiv.org/abs/1903.03148 Copyright 2020 Adrian...
1de7f4112036481de1c629f7568a1e94b5a91fa09929aa00ac021a3d15be0bb0
Python
27,480
678
#!/usr/bin/env python3 # # Sniffles2 # A fast structural variant caller for long-read sequencing data # # Created: 28.05.2021 # Author: Moritz Smolka # Maintainer: Hermann Romanek # Contact: sniffles@romanek.at # import logging import time from dataclasses import dataclass from typing import Optional, Ite...
dfbcd138db1c17c31a73e4178eb95b5fadad6130ab0ccf180ce5fb2c4f6038cf
Python
27,484
768
from PymoNNto.Exploration.UI_Base import * from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5 import QtCore from PyQt5.QtGui import * from PyQt5.QtWidgets import * import pyqtgraph as pg import copy import sys import traceback from PymoNNto.NetworkCore.Neuron_Group import * from PymoNNto.NetworkCore.Synapse_Group im...
f239fb9d06b044662167fc175780217a1aff7ebad1f2b558328d8906131f264a
Python
27,524
558
import numpy as np import math import statistics # If we are given a diagonal matrix D = (d1, ..., d_n) and want to compute the eigenvalues # of D + u u^T, these are up to deflation of trivial eigenvalues given by the solutions of the # so-called secular equation, given by # 1 + \sum_{i = 1}^n u_i^2 / (d_i + \lambda...
17e57cde92654d39f7343a287596719da93786b727be435b248996f1b1f0e4a6
Python
27,557
660
# Copyright (c) 2024 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...
bb2088a1e1895294d51f217fb821319acda40a422c5edfbd14d8ff9b5f9f82f5
Python
27,579
690
import torch import numpy as np from ase import Atoms import ase.build from nequip.data import AtomicDataDict, from_dict, from_ase from nequip.data.transforms import ( VirialToStressTransform, StressSignFlipTransform, NeighborListTransform, SortedNeighborListTransform, ChemicalSpeciesToAtomTypeMap...
163ab876c383b33028a3fb27c6377472d0140235fe6b1d97ce86853c0ea9fb1d
Python
27,592
766
import sys import time from pathlib import Path import h5py import numpy as np import pandas as pd from scipy import signal import Analyses.spatial_functions as spatial_funcs import Utils.filter_functions as filt_funcs import Pre_Processing.pre_process_functions as pp_funcs import matplotlib.pyplot as plt from shape...
3183a6fd46efcf36460dc95ef5b7ad01d315eb00449aece5ad51c054a8f2f2c5
Python
27,599
540
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_APSTDP_CONSTRUCTOR_MNIST as construct import NALSM_PARALLEL_SAVE as parasaver import NALSM_SIM_SUPPORT as runSupport import NALSM_GEN_SUPPORT as sup class ru...
f8a434b6f851967c11c2fc28ee15a653b20de4d53684b091cbcd1a705fd9fe66
Python
27,631
711
import numpy as np import statsmodels.api as sm import pandas as pd import statsmodels.formula.api as smf import scipy.stats as stats import ipywidgets as widgets from ipywidgets import interact, fixed, interact_manual from IPython.display import display import warnings from statsmodels.tools.sm_exceptions import Con...
181ae68a7a8c1c89cfd503a520d76c42f847ababb4adf178d13216159c8e3f80
Python
27,666
765
"""utils.py: Module for general data eeg data operations.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import math import os import numpy as np from scipy.interpolate import interp1d from scipy.signal import ( resample_poly, butter, filtf...
3a3c8c3941798e0da325eb853531017901c32bc3a69fa03edb1aa7ffede8741f
Python
27,694
587
import io import json from datetime import datetime, timedelta import django_rq import pandas as pd from asgiref.sync import async_to_sync from channels.layers import get_channel_layer from django.db.models import Count from django.db.models.functions import TruncDate, TruncDay, TruncWeek from request.models import Re...
f869ebd45ac3f15f78391284811b79d8084aa5f8dac4c5d36b361c35864afdb6
Python
27,718
760
# Copyright 2020-2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 """Plan module.""" from functools import partial from hashlib import sha384 from importlib import import_module from logging import getLogger from os.path import splitext from pathlib import Path from yaml import SafeDumper, dump, safe_lo...
066514a0b3f75ea589d1ec167b4f27e22bb5aa8f6db138e704a41e5980b3131e
Python
27,730
803
"""Utilities for converting Snakemake apps to BIDS apps.""" from __future__ import annotations import json import logging import os import re import warnings from collections import defaultdict from pathlib import Path from typing import ( Any, Iterable, Literal, overload, ) import more_itertools as ...
fd20c6fa9c5e55352b550d38147a7a447396afa06b4ed02866842d07c68a9732
Python
27,777
592
import json import coloredlogs import hydra import pandas as pd from omegaconf import OmegaConf from omegaconf.listconfig import ListConfig from sklearn.metrics import f1_score, roc_auc_score, average_precision_score, balanced_accuracy_score, \ mean_squared_error, accuracy_score, mean_absolute_error from tqdm impo...
50d5e1a2ce062a4c1b8d1cb7d478e473626d5b8dfa8b68ec478c045be91b7d4d
Python
27,782
767
########################################################################################### # Long Range Blocks # Authors: Will Baldwin, Ilyes Batatia # This program is distributed under the MIT License (see MIT.md) ########################################################################################### from __futu...
680015acae0f857c969a7fe5ea46271e8166c81677dcb8fa21ad8c10bf29480c
Python
27,794
797
# # For licensing see accompanying LICENSE file. # Copyright (C) 2022 Apple Inc. All Rights Reserved. # import torch from torch import nn, Tensor from typing import Optional, Union, Tuple import argparse from utils import logger from .base_layer import BaseLayer from .normalization_layers import get_normalization_la...
58a7ab12141d82f68e0ca91b172a5445be8d88d8f4135008d22475cb23b5fbab
Python
27,855
728
# 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 typing import Dict, List, Optional import torch import torch.nn as nn from torch import Tensor from fairseq import utils from fairseq.m...
b78eff9d027cfc2a3ea078a3862406cdfb0f6afc6ee4e3b537d8dcf31131c5ef
Python
27,856
691
"""Model fitting, contrasts, and statistical tests for `BrainData`. GLM and ridge fitting (with cross-validation), contrast computation, one- and two-sample t-tests, and the design-matrix diagnostics `fit` runs before a GLM. `BrainData` methods delegate here. """ import dataclasses import warnings from collections.ab...
9943d46e1f9de50e60301f330d3f524adf84584a2b363fd9a1263596d2e618b6
Python
27,865
662
from typing import Any, Sequence import jax from jax import vmap from jax import numpy as jnp from .jax_utils import val_and_jacrev, val_and_jacfwd from flax import linen as nn Dtype = Any class HelmholtzModel(nn.Module): """ Helmholtz free energy model based on artificial neural networks for the Mie fluid ...
a88cc69b6c283f02ab0ec8d66ff2aa05c86d7629798719f905400f5cbed7f496
Python
27,902
503
from models.rnn import * from models.schnet import * from utils import * from torch import optim import time from sklearn.metrics import r2_score class ReactionCLModel: def __init__(self, args=None): self.args = args multi = 2 if args.rnn_use_bidirectional else 1 self.Projector = MLP(input...
f31f882a0458aa7194a351cbaa2e87fe6393e0dee5f5a59be2d619d056f35f9a
Python
27,923
964
import os import re import openpyxl import csv import pronto import distutils import distutils.util import urllib.request import json import re import requests import traceback BCIOVOCAB_API = "https://api.bciosearch.org/" GET_TERMS_BY_LABEL = "terms?label={}&page={}&itemsPerPage={}" GET_TERMS = "terms/{}" POST_TERM...
fc1b129195e22436379092752093657300326996e0673e59bdb5f952df3026ad
Python
27,928
745
from __future__ import absolute_import import torch import numpy as np import pandas as pd import scipy import copy from pysurvival import HAS_GPU from pysurvival import utils from pysurvival.utils import neural_networks as nn from pysurvival.utils import optimization as opt from pysurvival.models import BaseModel from...
b31d7984f211aad941195e92091cd08591ed6ee4a34c18883d1361f28a7624d7
Python
27,944
669
from pathlib import Path from os import environ import io import itertools import re from contextlib import redirect_stdout from importlib.metadata import PackageNotFoundError, distribution from threading import Thread, Event from time import sleep from urllib.request import urlretrieve import numpy as np from numpy i...
f82148080b8ba512015f0a530554ca793ce10d0b8236b2768971bb3e5787d05a
Python
27,972
663
# Copyright (c) 2025 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...
22bcd99b85942b14bb010d70d4dadfc4ca3c303f978053fe60aaa6155984bcf4
Python
28,015
660
# python function import numpy as np # import matplotlib.pyplot as plt import torch import math import random from sklearn import svm import itertools import os import copy from sklearn.model_selection import StratifiedKFold from sklearn.model_selection import ShuffleSplit from sklearn.metrics import mean_squared_error...
7c128e539637925ec04415e26fdbb0dbd19379126e837f90f68e0b7c54ed61e7
Python
28,031
687
# 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 app...
319b0c678c78a9da8db9d5a261f253614dffed81b1f5fe92a0a69dd78c67ae9c
Python
28,049
723
# import pdb import numpy as np import torch import torch.nn as nn class SampleCNNGA(nn.Module): def __init__(self, n_classes=2, in_channels=42): super(SampleCNNGA, self).__init__() self.in_channels = in_channels # 300 x 42 self.conv1 = nn.Sequential( nn.Conv1d(in_cha...
f400d848c4961d63bc9f51993905f047a2d41ae4ae2c6c409557882595c2b47d
Python
28,049
715
# -*- coding: utf-8 -*- """ Created on Tue Jun 13 09:49:46 2023 @author: Em """ from .utils import get_device from .core import core from torch import (is_tensor, tensor, arange, manual_seed, randperm, zeros, ...
96f9e2eb1919fac1698b08793f7e323afb5e1de7226d63d8f1baa081d802130b
Python
28,056
752
# 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...
5e2233bf8f83b4ca216914b2c90b493177f5c03d1b46d33a0f8cdbf0eba9f1df
Python
28,116
645
"""The differentiable physics glue, characterized against finite differences. **These docstrings are normative.** CORE-3 copies the three sign conventions below verbatim into the rewrite's units module, and every one of them is asserted by a test in this file rather than assumed: * **forces** = -dE/d(positions), in e...
7bbe2c63a820bfd1e2929a3761989ff32d3d4624e489fdb787aa354ad5df9436
Python
28,117
778
import os import sys from pathlib import Path import numpy as np import matplotlib.pyplot as plt import pandas as pd import sssio import sssort.functions as sf import sssort.plotters as sp from functions_post_processing import * import configparser from sssort import sssio logger = sssio.get_logger() # FIXME plt.r...
c5d6227c54d03f5971b7be842ce4e37a0f5d764c7811a1e3a7b13f1f78efd058
Python
28,187
862
# -*- coding: utf-8 -*- """ Functions to facilitate task-based validation. Created on Oct 25 2023 @author: Mohammad Torabi """ import warnings import matplotlib.pyplot as plt import numpy as np from nilearn import glm from scipy import signal from sklearn.mixture import GaussianMixture from statsmodels.tsa.stattools...
0c632f7767b15dbbed3d00f0d141a8f65efe28dd095c2335eb9599d23cdbd16f
Python
28,195
930
"""Estimate statistics on a grid using DGA with memory.""" import numpy as np import scipy as sp __all__ = [ "stationary_distribution", "stationary_distribution_matrices", "stationary_distribution_projection", "stationary_distribution_solution", "forecast", "forecast_matrices", "forecast_p...
31f3326b4639b14a1656bd9815699f118d5879acb08f4c28463c2812bb00cbb1
Python
28,211
645
import numpy as np import os # import tensorflow as tf import tensorflow.compat.v1 as tf tf.disable_v2_behavior() import NALSM_GEN_SUPPORT as sup class run_support: def __init__(self,number_of_networks_IN): self.main_Path = os.getcwd() self.dataPath_TRAIN = self.main_Path + '/train_data...
6907f645504910b16071ae5f222b0fad16c5ac6b0047dba2f5acae472eac86a6
Python
28,231
739
# Copyright 2020-2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 """PyTorchTaskRunner module.""" import logging import os from copy import deepcopy from typing import Iterator, Tuple import numpy as np import torch import torch.nn as nn import tqdm from openfl.federated.task.runner import TaskRunner f...
62d13ec3c24e4c47251ad69e518249a5c8667fdc4092bdc43902f43706379a10
Python
28,234
677
# -*- coding: utf-8 -*- """Provides the abstract reconstructor base class.""" import os from inspect import signature, Parameter import json from warnings import warn from copy import deepcopy class _ReconstructorMeta(type): def __init__(cls, name, bases, dct): def get_fget(k): def fget(self):...
92677d309e48ddd94cff3e78536030d34baa2fecb4dc450830ffc011059bd53d
Python
28,256
657
"""The tiny magnetic anchor reproduces its committed reference. This is the numerical reference the magnetic family did not have. The behavioural suite next door (``tests/extensions/magnetic``, 39 tests) covers rotation equivariance, inversion parity, parameter registration, calculator backends and dtype scoping -- pr...
5cb3fe8ad0f95eeab5b3329e0b9378849640ecc5297cceb160843db29c235755
Python
28,329
875
from typing import Optional, Sequence from types import TracebackType from uuid import UUID from overrides import override import httpx from chromadb.api import AdminAPI, ClientAPI, ServerAPI from chromadb.api.collection_configuration import ( CreateCollectionConfiguration, UpdateCollectionConfiguration, v...
fa211b159f64182854deeb4bfd7e52694aead0df013b6d66071662634dd4effb
Python
28,351
839
from typing import Any, Dict, List, Optional, cast import uuid from hypothesis import example, given, settings, HealthCheck import pytest from typing import cast from chromadb.api import ClientAPI from chromadb.test.property import invariants from chromadb.api.types import ( Document, Documents, Embedding, ...
f1315e3b4e88306063db3e2bd8fb2cb874f83811909c91f6d9bdaf5725e0e8b4
Python
28,363
635
# 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 GridSpecFromSubplotSpec from matplotlib import ticker # TensorPAC from tensorpac import Pac, PreferredPhase from t...
068a9fec461d626af92e91f2626678bf620d7105d88dc1f22b58eae3b8d6c432
Python
28,387
846
# 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 # # Un...
88501b890c8e64c380195e41a8f06699f07d68f7fcf2fb6d6e50f8f18bcb1a7d
Python
28,453
657
import torch import torch.nn.functional as F import torch.nn as nn import ISNetLayersZe as ISNetLayers import ISNetFunctionsZe as ISNetFunctions import LRPDenseNetZe as LRPDenseNet import globalsZe as globals import pytorch_lightning as pl import warnings from collections import OrderedDict import numpy as np from torc...
8c44c61886aa1c48c2619252c7b2cbcb4c27de7f756ade38269814941d3e84f5
Python
28,495
615
import time import os import copy import torch from torch.optim import Adam from tqdm import tqdm from rdkit import Chem from dig.ggraph.method import Generator from dig.ggraph.utils import gen_mol_from_one_shot_tensor from dig.ggraph.utils import qed, calculate_min_plogp, reward_target_molecule_similarity from .en...
1432352df6c03a4b2d356e562894cd7e24d89c0d17569aa9300ee611175d7226
Python
28,502
840
""" NeuroLearn Plotting Tools ========================= Numerous functions to plot data """ __all__ = [ "dist_from_hyperplane_plot", "scatterplot", "probability_plot", "roc_plot", "plot_stacked_adjacency", "plot_mean_label_distance", "plot_between_label_distance", "plot_silhouette", ...
6c7a2beff053c2607b39b7b2700f24287e7df8371e82664b09a19ad52c0f80b4
Python
28,510
855
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 """ Train and evaluate EGGNet models """ from rdkit import Chem from transformers import T5Tokenizer, T5EncoderModel import pytorch_lightning as pl from pytorch_lightning.callbacks.early_stopping import EarlyStopping f...
643894bcd22f8e5e15404777baa50d593664c7adbd0d589dce9d4e097727030b
Python
28,541
685
import logging from pathlib import Path from typing import Literal import numpy as np from idtrackerai import ( Fragment, GlobalFragment, ListOfFragments, ListOfGlobalFragments, conf, ) from ..network import IdentifierBase, get_predictions AccStrategy = Literal["global", "partial"] rng = np.ra...
8508e6cdd364c6c5f89960893dc3df6a596201acd481c9f087234818782d049a
Python
28,560
773
"""Tests for bootstrap inference utilities.""" import tracemalloc import numpy as np import pytest from nltools.algorithms.backends import check_gpu_available from nltools.algorithms.inference.bootstrap import ( _BootstrapAccumulator, _bootstrap_ridge_predict_cpu_parallel, _bootstrap_ridge_weights_cpu_pa...
d77279a8bfa0e2b2baf9c653c69d355dd868c14f6daa40753d8f6feff94e4590
Python
28,602
787
import argparse import inspect import json import os from pathlib import Path from typing import Any, Dict, List, Optional, Sequence, Tuple import numpy as np import pandas as pd from pydfc.ml_utils import ( dFC_feature_extraction_subj_lvl, find_available_subjects, load_dFC, load_task_data, ) def st...
28a6df7bd55513aa904d0f1f3df2c2ec1dafe4f89362935ab0ddc35aae148292
Python
28,618
682
# 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 json import logging import math import os from argparse import Namespace from collections import OrderedDict, default...
5a128d7bf399efc21fba7165dbd3a11ec6d5718c227d497aae2df04dc8caf1b6
Python
28,709
686
# -*- coding: utf-8 -*- """Provides the dataset base classes. """ from itertools import islice from math import ceil import numpy as np from dival.data import DataPairs from dival.util.odl_utility import NoiseOperator class Dataset(): """Dataset base class. Subclasses must either implement :meth:`generator` ...