sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
b9d87183292b56c3b4c0ca2cbbd187e0bd596a71cedbd6b8251e7f163e6280a6 | Python | 51,791 | 1,250 | import json
from copy import deepcopy
from pathlib import Path
import ase.build
import h5py
import numpy as np
import pytest
from tests.helpers import REPO_ROOT
from tests.neighbour_oracle import (
assert_neighbourhoods_match,
brute_force_neighborhood,
canonical_edges,
canonical_edges_from_shifts,
)
i... |
d4f2acdabdec29f63138e5f9052526e84fb18b981b574ebb9dd39fdc9c03cf58 | Python | 52,006 | 1,246 | # 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... |
57fc7ea95ef7450b9c0e71abc5d1b59c49cb7bd75a722ef88c053a6759ab5c56 | Python | 52,116 | 1,535 | from dataclasses import dataclass, field
from typing import Optional, List, Dict, Set, Any, Union, cast
from chromadb.base_types import LiteralValue
import numpy as np
from numpy.typing import NDArray
from chromadb.api.types import (
Embeddings,
IDs,
Include,
OneOrMany,
SparseVector,
TYPE_KEY,... |
b576658b065663f08c6052c7a9d81519ce5a29528a8f308411fac72cf99be616 | Python | 52,220 | 1,563 | # pylint: disable=too-many-lines
import json
import os
import subprocess
from pathlib import Path
import ase.io
import numpy as np
import pytest
import torch
from ase.atoms import Atoms
from ase.calculators.singlepoint import SinglePointCalculator
from mace.calculators import MACECalculator, mace_mp
from tests.helpe... |
edd6ddb29ddff6a2b9c9d2226e798eebd38e3ab0a152761eb8f418d6b70b3546 | Python | 52,857 | 1,473 | from __future__ import annotations
import argparse
import json
import math
import os
import subprocess
import sys
from pathlib import Path
import ase.io
import numpy as np
import pytest
import torch
from ase import Atoms
from ase.calculators.calculator import Calculator
from ase.io import read
from e3nn import o3
fro... |
4f9b0c677a09ba9f5235af28d0bd684fcf79fa8f6cdb6fe7ab2bd49ffa7ea0fe | Python | 52,940 | 1,171 | # -*- 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... |
ab27640be10479028fe0d32976effb6a766517c25eb6e58bcb2199121f378c23 | Python | 52,980 | 1,027 | # %%
import sys
import os
import cv2
import math
import numpy as np
import time
import h5py
import pyfftw
from scipy import sparse
from cpuinfo import get_cpu_info
from scipy.io import savemat, loadmat
import multiprocessing as mp
os.environ['KERAS_BACKEND'] = 'tensorflow'
# os.environ['CUDA_VISIBLE_DEVICES'] = '0' #... |
e571b640c820e0a4dc1380eeb2ace34de79874fa89e1968ec8a4cf2831497956 | Python | 53,505 | 843 | import numpy as np
import time
import NALSM_ASTRO as astrocyte
import NALSM_LIF_v1 as neuron
import NALSM_STDP as plasticity
import NALSM_SIM_SUPPORT as runSupport
import NALSM_OUTPUT_LAYER as out_lin_csfr
import NALSM_GEN_SUPPORT as sup
class simulation_constructor:
def __init__(self
... |
93bb587d19a8f28559f4a6515bc905bb46336f6bc333408cad6d4f4ce9d64903 | Python | 53,511 | 1,725 | """
Vast majority of this file comes from
http://github.com/deepmind/alphafold/blob/main/alphafold/common/residue_constants.py
Nucleotides come from
https://github.com/uw-ipd/RoseTTAFold2NA/blob/main/network/chemical.py
"""
import functools
import os
from collections import namedtuple
from typing import List, Mapping... |
4aa514ea58c352f728a176c38e58cd5fc8b3e265c024698ccaa046165b674667 | Python | 53,683 | 1,530 | import numpy as np
from PyQt5.QtWidgets import QApplication, QMainWindow, QWidget, \
QMessageBox, QFileDialog, QGridLayout, QLabel, QPushButton, \
QProgressBar, QDialog, QTableWidget, QTableWidgetItem, QHeaderView, \
QLineEdit, QAction, QGraphicsPathItem, QCheckBox, QFrame, QComboBox, \
QSlider, QGraphi... |
a6b8b7e35ef187f56da65d6caea451cdd4fc8d524f5ed0a0d88862b5e796fed7 | Python | 53,705 | 1,286 | # 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... |
a1ed3b66484cddcdfab7a1a7ec0163cb63625128e045d5f762bd24a26f823331 | Python | 54,046 | 849 | import numpy as np
import time
import NALSM_LIF_v1 as neuron
import LSM_APSTDP_STDP as plasticity
import NALSM_SIM_SUPPORT as runSupport
import NALSM_OUTPUT_LAYER as out_lin_csfr
import NALSM_GEN_SUPPORT as sup
class simulation_constructor:
def __init__(self
, network_name
... |
dd9c0dcdd0c1fe9a25b59e791dc7640a289f164d90c262fbe21c27d7c91ead67 | Python | 54,334 | 1,340 | """Parallel backends"""
# Authors: Blake Caldwell <blake_caldwell@brown.edu>
# Mainak Jas <mainakjas@gmail.com>
import os
import sys
import re
import shlex
import pickle
import base64
import time
from warnings import warn
from subprocess import Popen, PIPE, TimeoutExpired
from queue import Queue, Empty
from ... |
eaf86a25028c36d7f53828c6805f6975ddc1e967b0cad8326946f0b9331ec19c | Python | 54,855 | 875 | import numpy as np
import time
import NALSM_LIF_v2 as neuron
import LSM_APSTDP_STDP as plasticity
import NALSM_SIM_SUPPORT as runSupport
import NALSM_OUTPUT_LAYER as out_lin_csfr
import NALSM_GEN_SUPPORT as sup
class simulation_constructor:
def __init__(self
, network_name
... |
6a69cbae239e41a81a5a5bfb2662c729ae17417ddbed04cf84e697eff423a7b4 | Python | 54,902 | 1,266 | #!/usr/bin/env python3
"""Gate `feature_inventory.md` against the sources it claims to inventory (P0-0).
The inventory is the completeness contract of the rewrite: a feature that has
no row in it is a feature nobody decided about, and the absence of a row is a
bug rather than a decision. Prose cannot enforce that, so ... |
56928947db96c8cd4269becf650d50ced304fe45e4b14032f2bd2bfdbf961d5e | Python | 54,946 | 1,363 | # Copyright 2020-2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Aggregator module."""
import json
import logging
import queue
import time
from threading import Lock
from typing import List, Optional
import numpy as np
import openfl.callbacks as callbacks_module
from openfl.component.aggregator.stra... |
f2d1d98c3af442b8e92c9f5d9a9246d45028f5e3aac722fd768fb9890966efbd | Python | 55,034 | 1,136 | ################################################################################
# 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... |
247519885988eb883936504c4b685dffef6f91f50d900a718e846edbd7406b29 | Python | 55,223 | 1,434 | """Bootstrap resampling for simple statistics and fitted-model outputs.
Resamples observations with replacement `n_samples` times and summarizes the
resulting distribution with `_BootstrapAccumulator`, a streaming aggregator that
keeps a running Welford variance plus a bounded per-element tail — enough order
statistic... |
13d51b9f616b9d361e8ee25cab3899c5de2e45958f678a0160f856beb9837a61 | Python | 55,253 | 1,449 | """Analysis operations on `BrainData`.
Functions for similarity, distance, masking, ROI extraction, filtering,
thresholding, decomposition, alignment, smoothing, and related operations.
Each takes a `BrainData` as its first argument; the corresponding
`BrainData` methods delegate here.
"""
from pathlib import Path
i... |
26e384b985bea51c033a863d383bc054954ff680cf97579d0c3d0517d04ad4bc | Python | 55,299 | 1,550 | import argparse
import json
import os
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from nilearn import image, masking, plotting
from nilearn.glm.first_level import FirstLevelModel
from sklearn.cluster import KMeans
from sklearn.decomposition import PCA
from sklearn.prepr... |
7b319485203c7ada992aded27bd86fe6cb700cf28fb894d7638c034cc7acf418 | Python | 55,308 | 1,035 | from .SharedTrees import cstr, get_fmt, Description, AmplifierState_v9, LockInParams_v9, get_data_kind, UserParamDescrType
from .SharedTrees import \
get_segment_class, \
get_data_kind, \
get_seg_store_type, \
get_leak_comp_type, \
get_break_type, \
get_leak_hold_type, \
get_leak_store_type... |
00f7084086026417fb18141fce8ab47853d33a4fa472180e0d7a1f855a8ca5a9 | Python | 55,455 | 867 | """The field registry -- the single declaration every column order is projected from.
Before this module, the column set was written out in nine places (``ChunkQC.py``,
``DefaultDBGenerator.py``, ``SlimDBGenerator.py``, ``ScoreFactory.py``, the two static
``*.meta.txt`` files, ``BuildDatabase.groovy``, the README and ... |
084149aefac3632f535afc1bc894f7e9640683fe741c802e1aca552f4c047e2d | Python | 55,551 | 1,608 | import hypothesis.stateful
import hypothesis.strategies
from overrides import overrides
import pytest
import logging
import os
import hypothesis
import hypothesis.strategies as st
from hypothesis import given, settings, HealthCheck
from typing import Dict, Set, cast, Union, DefaultDict, Any, List
from dataclasses impor... |
dc831be0685d6f24b67613043a8a24b32024165130b6a8fd898884d86529b005 | Python | 55,774 | 1,392 | """Functionality to estimate CCA/PLS models and analyze outcomes."""
import numbers
import warnings
from datetime import datetime
import numpy as np
import xarray as xr
import pandas as pd
from scipy.stats import pearsonr
from scipy.spatial.distance import cdist
from sklearn.utils import check_random_state
from tqdm... |
ee061d9c5bc783cffa63ecd0998c547b41ee90c8ad5cdeff333817463af07abb | Python | 56,007 | 1,501 | import os
import sys
from copy import deepcopy
import matplotlib.pyplot as plt
import numpy as np
# sys.path.append('./BIC_codes/')
from functions.dFC_funcs import *
from functions.post_analysis_funcs import *
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
print(
"#######################... |
3fb01e846de879a4461ec0d2d9bc5d6c3bb07205f70455643e5eddfcf5e8dac6 | Python | 56,145 | 1,321 | # 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... |
3ef5c58492360d860c2a1b8ecc75290fe01484b31aefca00276de769c97a7c28 | Python | 56,150 | 1,571 | """Interactive scatter plotting for SanPy spike statistics."""
import math
from typing import Any, Union, Dict, List, Tuple, Optional, Sequence
import numpy as np
import pandas as pd
from PyQt5 import QtCore, QtWidgets, QtGui
from matplotlib.backends.backend_qtagg import FigureCanvasQTAgg
import matplotlib as mpl
... |
b14d16cdd7589a3a9136b6aaaa2f902cdabd0fe675421e041956984fe88f856f | Python | 56,258 | 1,368 | # -*- 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 C... |
680cd7b54946c5850a4efdd410458085aef6dbd2c2f15000867fc4ba32968da0 | Python | 56,683 | 1,639 | """HNN GUI visualization management tool"""
# Authors: Huzi Cheng <hzcheng15@icloud.com>
import copy
import io
from functools import partial, wraps
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from IPython.display import display
from ipywidgets import (
HTML,
BoundedFloatText,
But... |
37d4c9a0d5362ca1bb440fa03bc4662b4b0d9083537375d5bb650cdb79ed7d81 | Python | 57,169 | 1,253 | #!/usr/bin/env python
"""Provides classes for the detection, classification and analysis of dentate spikes (DSs).
'signal' defines functions for reading, resampling and plotting the local field potential (LFP).
'detection' defines functions to detect DSs.
'classification' defines the CSDbC and WFbC methods, and functio... |
28d01d393130b03707484b79805e83c8e2516582a213d36a0d6bd794cda1f086 | Python | 57,182 | 1,217 | import argparse
import logging
import math
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import random
import time
import numpy as np
import torch
from torch.cuda import amp
from torch import nn
from torch.nn import functional as F
from torch import optim
from torch.optim.lr_scheduler import LambdaLR
from torch.u... |
9f1edc4de3a99afcf21ccf378c38da35c3c6adaaaa459aed0a69f0226a491bfe | Python | 57,698 | 1,315 | ###########################################################################################
# Training script for MACE
# Authors: Ilyes Batatia, Gregor Simm, David Kovacs
# This program is distributed under the MIT License (see MIT.md)
####################################################################################... |
bb1b646b49aa390ab37f0b099383cca5325f2dfb9de273e6cceaedaaf691b34d | Python | 57,866 | 1,335 | """fc2_stim.py
Analysis and plotting functions for FC2_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 plotting_hel... |
913d4fd218b014af653f34fd42ff40611b063d2ab70695970f38c8c305677961 | Python | 58,125 | 1,466 | ###########################################################################################
# Implementation of MACE models and other models based E(3)-Equivariant MPNNs
# Authors: Ilyes Batatia, Gregor Simm
# This program is distributed under the MIT License (see MIT.md)
###############################################... |
fc898ec7b9bb9076e2e04f92f6a41912886aaa9d9ac05557c0bba2affc42fb99 | Python | 58,541 | 1,278 |
import os, sys, argparse
import serial, string, sys, struct, datetime, time
from transitions import Machine, State
from transitions.extensions.states import add_state_features, Timeout
#from transitions import Machine
#from transitions.extensions.states import add_state_features, Timeout, State
import random, copy
imp... |
c1fa05c2b0f88aa8851001933becd719323949fb251eb34a9aaa7a8f04f95d9a | Python | 59,118 | 1,551 | import math
import pickle
import numpy as np
from . import core_min
from .backend import ModTensorflow
from .util import assert_equal
class Domain:
def __init__(
self,
cshape,
dimnames=None,
lower=0.0,
upper=1.0,
dtype=None,
multigrid=False,
mg_con... |
3950eae07367aced2ba1d41678db5a8d139598b516e8e57bd26194b5a4dba31c | Python | 59,380 | 1,669 | """Represent a published DANDI dandiset as lazily streamed NWB assets."""
from __future__ import annotations
import re
from dataclasses import dataclass, fields
from typing import Optional
import h5py
import numpy as np
import pandas as pd
from dandi.dandiapi import RemoteAsset
from dandi.dandiarchive import Dandise... |
29d7db1162a74b4dadf6392d91f8a43d8ef278f0dd451cecba70588f815c0fd8 | Python | 60,523 | 1,257 | ################################################################################
# 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... |
3d03c55ad3a54d9fd983901139cd570464a77a5c3cd974741d09ef1f82575d00 | Python | 60,778 | 1,257 | ################################################################################
# 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... |
b017b44d8794e43288499b73ea8227020afa7a69b76fec3509189f65da0c7f78 | Python | 60,793 | 1,720 | #
# For licensing see accompanying LICENSE file.
# Copyright (C) 2022 Apple Inc. All Rights Reserved.
#
import cv2
from typing import Optional
import numpy as np
import random
import torch
import math
import argparse
from typing import Sequence, Dict, Any, Union, Tuple
from utils import logger
from .utils import jac... |
f0ed4e6b86b5a9ff5cbc47b35198df48b28a7005ed39718bccba6fe7b21c1515 | Python | 60,819 | 1,261 | ################################################################################
# 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... |
f7ec9acfc5083505b6bdb8916acff25cf4e87490a14d1648f01f0eaf78697763 | Python | 60,856 | 1,567 | """
SMI: Standard Model Imaging class
"""
import os
import sys
from math import comb
import numpy as np
import itertools
import scipy.ndimage as snd
import scipy.cluster.hierarchy as sch
import scipy.special as scp
import scipy.linalg as scl
import scipy.io as sio
import scipy.optimize as sco
import warnings
import m... |
05717129522fafff36e2ca2d7e6a4567dafffc5874e3944f0d1da96da7f66b08 | Python | 61,037 | 1,743 | import pytest
from typing import Dict, Any, cast, List
import numpy as np
import warnings
from chromadb.api.types import (
EmbeddingFunction,
Embeddings,
Space,
Embeddable,
)
from chromadb.api import ClientAPI
from chromadb.api.collection_configuration import (
CreateCollectionConfiguration,
Upd... |
e6a62461afb11b4d3fa0e3c10f3c0d11a1f4972025a9a8dbc136e45affcdbd0d | Python | 62,014 | 996 | import numpy as np
import time
import NALSM_ASTRO as astrocyte
import NALSM_LIF_v2 as neuron
import NALSM_STDP as plasticity
import NALSM_SIM_SUPPORT as runSupport
import NALSM_OUTPUT_LAYER as out_lin_csfr
import NALSM_GEN_SUPPORT as sup
class simulation_constructor:
def __init__(self
... |
0974962103f2a2a3796e8b034140959050b1a989311222ba5b3b294cab23d5d3 | Python | 63,127 | 1,430 |
import os, sys, argparse
import serial, string, sys, struct, datetime, time
from transitions import Machine, State
from transitions.extensions.states import add_state_features, Timeout
#from transitions import Machine
#from transitions.extensions.states import add_state_features, Timeout, State
import random, copy
imp... |
3148e56307eafd692b0cd4d51bdd6857f53a419b05162aa2271e7cbd19657376 | Python | 63,187 | 1,677 | """
This data class is for working with similarity/dissimilarity matrices
"""
__author__ = ["Luke Chang"]
__license__ = "MIT"
import os
import pandas as pd
import numpy as np
import deepdish as dd
from copy import deepcopy
from sklearn.metrics.pairwise import pairwise_distances
from sklearn.manifold import MDS
from s... |
4110c74ff392b13bc29b0a2f4ef569ce22ad43741ba86f37b397bc457f212ed7 | Python | 63,204 | 1,570 | # -*- 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... |
3a1f9857a06d8d1adeb223d40e8e6dbee0e6f750f7012d3c6c7e4996dedb6bff | Python | 63,252 | 1,578 | import torch
import torch.nn.functional as F
import torch.nn as nn
import globalsZe as globals
import warnings
from collections import OrderedDict
from torch.autograd import Variable
import torch.autograd as ag
import warnings
import copy
class ISNetFlex(nn.Module):
def __init__(self,model=None,architecture='dens... |
01a25c2a1eb484047feae55de01d5ef5dbe588bc1b04e7678121ca827eabaeb5 | Python | 63,347 | 2,048 | #!/usr/bin/env python
# coding: utf-8
# # --- FlexiTerm: multi-word term recognition
# --- dependencies ---
import csv
import jellyfish
import json
import math
import numpy as np
import os
import pprint
import random
import re
import spacy
import sqlite3
import sys
import time
from nltk.stem.porter import PorterS... |
74332ae3ee02ed18e4bd2677b35fae946582231782448aeb579d382168d9cac5 | Python | 63,608 | 1,388 | # hybrid temporary script between old _PyCMD and new but non-functional v2
import os, sys, argparse
import serial, string, sys, struct, datetime, time
from transitions import Machine, State
from transitions.extensions.states import add_state_features, Timeout
import random, copy
import numpy as np
import PyCmdMessenge... |
163d3169bc00bdd6f9bec77ba9ce2805bf08e635f9195537b105f3a13ba125ac | Python | 63,638 | 1,722 | """wind_task.py
Analysis and plotting functions for Wind_task.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 plotting_help as ... |
a4c6e030ccb0f402d6b2c3896c34a3457495e3a47ed8761cd6f19e21ff4badb3 | Python | 63,884 | 1,747 | #
# For licensing see accompanying LICENSE file.
# Copyright (C) 2022 Apple Inc. All Rights Reserved.
#
import copy
from PIL import Image, ImageFilter
from utils import logger
import numpy as np
import random
import torch
import math
import argparse
from torchvision import transforms as T
from torchvision.transforms i... |
dcebfa8facc86cb2ffbed73950acb071f70189d13935cdd308f3d39590ddd920 | Python | 64,140 | 1,221 | """The ``vdjdb`` command.
Every subcommand is implemented; ``vdjdb --help`` lists them all.
"""
from __future__ import annotations
from pathlib import Path
import typer
from . import __version__
from .config import Paths
app = typer.Typer(
name="vdjdb",
help="Build, proofread and release the VDJdb database... |
7f3d78d00a4d0e753b05b8b43680c3205f1a35a39eced1f17140d7601083a082 | Python | 65,062 | 1,488 | # -*- 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 C... |
6d855a61034bb344322cb7a03fab284ca049dd7a1b396f3fd0ae7b6f8fb607bd | Python | 65,344 | 1,753 | """Main SanPy analysis window and its Qt lifecycle helpers."""
import os
import platform
from functools import partial
from typing import List, Optional
import webbrowser # to open online help
import pandas as pd
import tables
from qtpy import QtCore, QtWidgets, QtGui
import sanpy
from sanpy.sanpyLogger import ge... |
b07641d936ac0d1852b4edda8ee80e7d34e896c502e73810acba56e677b1417d | Python | 65,456 | 1,327 | ################################################################################
# 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... |
94c03725096ad86c5081f235c1b371d38d6caa095711af6141c24315aab66c03 | Python | 65,545 | 1,821 | """Parameterized curves on any given manifold.
Lead author: Alice Le Brigant.
"""
import logging
import math
from scipy.interpolate import CubicSpline
import geomstats.backend as gs
from geomstats._scipygs.interpolate import PchipInterpolator
from geomstats.algebra_utils import from_vector_to_diagonal_matrix
from g... |
534c752944834b963dfde246a0c4dacf9d8b271ee3a8f36fedbc712c03104bc4 | Python | 65,622 | 1,586 | # 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... |
50424d39b8022d15b3454a5b0c7c0e6238ca5ce601ed9acfff029f6746038410 | Python | 65,747 | 1,591 | # 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.
"""
Train a network across multiple GPUs.
"""
import contextlib
import logging
import os
import sys
import time
from argparse import Namespac... |
a8de20814ed518de22bd5668832b408f9250b818b8c1fa9d3272c94f2be44c81 | Python | 66,140 | 1,742 | # 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... |
9b3a026d54d790b58b60ae306d644a9ed989a1937c303cf33b95246e396f50d1 | Python | 66,556 | 1,677 | import numpy as np
import pandas as pd
from rdkit import Chem, DataStructs
from rdkit.Chem import AllChem
from rdkit.Chem.Fingerprints import FingerprintMols
from rdkit.Chem.rdReducedGraphs import GetErGFingerprint
from DeepPurpose.pybiomed_helper import _GetPseudoAAC, CalculateAADipeptideComposition, \
calcPubChemFing... |
05536293b84ab90b9e18ae0e6450dad854ca8db577508e970ca09ba74a94ca89 | Python | 67,192 | 1,667 | import torch
import torch.nn as nn
import ISNetFunctionsZe as f
import LRPDenseNetZe as LRPDenseNet
import globalsZe as globals
import re
#Transform function in ISNetFunctions in DNN layers:
class LRPDenseReLU (nn.Module):
def __init__(self, layer,e,rule,alpha=2,beta=-1):
super().__init__()
self.e... |
1cc1c799e7e56100c93395700b140f9a970636018fac3e586c1ca165d69a54be | Python | 67,893 | 1,641 | """Ridge and banded Ridge regression, with the numerics delegated to Himalaya.
`_Ridge` owns argument names, validation, named feature-space alignment, device
and memory policy, and fitted-state normalization. Himalaya owns decomposition,
the cross-validation loss, alpha selection, the Dirichlet search, and
coefficien... |
db2ee5e6a3cd005cf8ebc67500f2f45a8b0b415b570807a3e80ef858a744e56b | Python | 67,921 | 1,684 | """Intersubject correlation (ISC) with permutation and bootstrap inference.
Computes leave-one-out and pairwise ISC and tests it with the subject-wise
bootstrap of Chen et al. (2016) or surrogate time series (circular shift,
phase randomization), plus a two-group ISC difference test. Resamples run on
joblib workers; `... |
6de7976a50ae8fa601745a219cdf7dee1e92255d2925786131e703dd23050025 | Python | 68,081 | 1,163 |
# let's get what we need together
# using python 3
import numpy as np
import numpy.matlib
import scipy as sp
from scipy import stats
import pandas
import brian2
from adjustText import adjust_text
import pickle
import os
import matplotlib.pyplot as plt
import json
from modelHelper import current_to_frequency, NMDA_de... |
286015c9fca629ac9fdf3d6cba3e77680ad5fb75f2592d1e5dc670c5af97d3be | Python | 68,623 | 1,632 | # 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... |
a1b5c43a6b438f9a845cae7bd27b7e49567f4bd54c5d0c91eea2a38210d6f218 | Python | 68,780 | 1,310 | __author__ = 'Brian M Anderson'
# Created on 12/31/2020
import os
from datetime import date
from datetime import datetime
from tqdm import tqdm
import typing
from glob import glob
import pydicom
import numpy as np
from pydicom.tag import Tag
import SimpleITK as sitk
from skimage.measure import label, regionprops, find... |
c1db5d548c5814dbf73ba8e3eeaad898e5019af9366aa3b7fc2ec9d7df93e8f1 | Python | 68,974 | 1,913 | from abc import ABC, abstractmethod
from functools import reduce
from operator import mul
from typing import Iterable, Optional, Union
import torch
class Nodes(torch.nn.Module):
# language=rst
"""
Abstract base class for groups of neurons.
"""
def __init__(
self,
n: Optional[int]... |
c14d6b1b386ff665003abcc4fb05fef6ed50b4daba3b6ab0f7b9e4328857d341 | Python | 70,275 | 1,609 | """Tests for the golden harness itself.
Everything here runs on numpy/ase/json only -- no model, no torch -- because
the harness is the one piece of machinery both the current stack and its
replacement have to share, and a test that needed the current stack to prove
that would be proving the opposite.
"""
import json... |
cad7448d438468cf044c340c976b435ccadaf3250d8432bcd77310d2662df842 | Python | 70,849 | 1,704 | ###########################################################################################
# pylint: disable=too-many-lines
# The ASE Calculator for MACE
# Authors: Ilyes Batatia, David Kovacs
# This program is distributed under the MIT License (see MIT.md)
#############################################################... |
2e2914a16657f65c5345bc58b945d32a127fdaf4b5d1bce5264da16b096a0192 | Python | 70,987 | 2,067 | # ruff: noqa: PLR2004
from __future__ import annotations
import filecmp
import functools as ft
import itertools as it
import keyword
import os
import re
import shutil
import sys
import tempfile
import warnings
from collections import defaultdict
from pathlib import Path, PosixPath
from typing import Any, Iterable, Lit... |
a07632e605a41cf2a41502627140a441b346defc452fd3ad8be04409d4566a84 | Python | 72,049 | 1,647 | # -*- 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 C... |
b8341751fad069dba026239a186b9d900239fc46fbebcb19ddde4213dbb5cb18 | Python | 72,078 | 1,570 | import sys
import time
import copy
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
import scipy.signal as signal
from scipy.signal import filtfilt
from types import SimpleNamespace
from sklearn import linear_model as lm
import Analy... |
d665245539c18043c5d209970230e61483f7c47ff1772c20d903a30c84006a38 | Python | 72,205 | 1,670 | # 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... |
46c16d5d1e6b857b4638d2e9ab268fe00ee85b541b539f81d7ec7a87ee3e76e0 | Python | 72,667 | 1,744 | """read_data.py
Module for reading ABF files and TIFF images
"""
import glob
import os
from collections import namedtuple
import re
from neo.io import AxonIO
from neo.io import WinEdrIO
import pyabf
import pandas as pd
import numpy as np
import skimage.external.tifffile as tifffile
import joblib
from sklearn.cluster ... |
312a6bab7df76aac4ec117bdcc2f398c8bec8de3f07fe02b4ae69cfae79c8a4a | Python | 72,727 | 1,758 | 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 matplotlib.gridspec as gridspec
import read_data as rd
import analysis_plot as ap
import functions as fc
import plotting_help as ph
# ------------------ Plotting pa... |
d66fbf4a6c5389e87d8faafa5ec369662e9d7bd72e9b33da130a3b49d78df569 | Python | 73,720 | 1,202 | import torch
import torch.nn as nn
import numpy as np
from rdkit import Chem
from dig.ggraph.utils import check_chemical_validity, check_valency, calculate_min_plogp, reward_target_molecule_similarity
from dig.ggraph.utils import convert_radical_electrons_to_hydrogens, steric_strain_filter, zinc_molecule_filter
from .d... |
5e466140fecc6562bddcd04b7046fd8f8d0d9f36bf16def9efbd876ddeb74b08 | Python | 73,895 | 1,192 | import numpy as np
import time
# updated
import NALSM_GEN_SUPPORT as sup
import NALSM_SIM_SUPPORT as runSupport
import NALSM_OUTPUT_LAYER as out_lin_csfr
import NALSM_STDP as plasticity
import NALSM_ASTRO as astrocyte
import NALSM_LIF_v1 as neuron
class simulation_constructor:
def __init__(self
... |
1a61fafd51e5006afb344a644702abb1257cd2c8f70260cf0258f602b1c731c7 | Python | 74,974 | 1,215 | import numpy as np
import time
# updated
import NALSM_GEN_SUPPORT as sup
import NALSM_SIM_SUPPORT as runSupport
import NALSM_OUTPUT_LAYER as out_lin_csfr
import NALSM_STDP as plasticity
import NALSM_ASTRO as astrocyte
import NALSM_LIF_v2 as neuron
class simulation_constructor:
def __init__(self
... |
03bea76b79ea4bc598d1d7f5ecef7cbf49284a301c6f077a20e520f8cfac62d7 | Python | 76,844 | 1,731 | # -*- 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 C... |
1f9166d250d06f954b39a20835aea31a545d8fe58a3aac34c4116a7fe6c3f5f6 | Python | 76,980 | 2,168 | # pylint: disable=too-many-lines
###########################################################################################
# Elementary Block for Building O(3) Equivariant Higher Order Message Passing Neural Network
# Authors: Ilyes Batatia, Gregor Simm
# This program is distributed under the MIT License (see MIT.md)... |
c871cda9bb69b617281e14805f8f22322fe472f4fe2e70e30a033a844929a754 | Python | 77,642 | 2,235 | # -*- coding: utf-8 -*-
"""
Functions to facilitate applying ML algorithms to dFC.
Created on Aug 8 2024
@author: Mohammad Torabi
"""
import os
import warnings
import numpy as np
from scipy.spatial import procrustes
from sklearn.base import BaseEstimator, TransformerMixin, clone
from sklearn.cluster import KMeans
fro... |
7ea472b18afd8139d91da0f63e38e7b8771c0cf16b60e98a495aa46fe34af95f | Python | 78,659 | 2,411 | from typing import (
Any,
Callable,
cast,
Dict,
Sequence,
Optional,
Type,
TypeVar,
Tuple,
)
import fastapi
import orjson
from anyio import (
to_thread,
CapacityLimiter,
)
from fastapi import FastAPI as _FastAPI, Response, Request
from fastapi.openapi.utils import get_openapi
... |
bdf5d9961fb453042447a242f02a3b85d4439f05085fdeb8a887c9e9a1555114 | Python | 79,160 | 1,963 | """
DeepErwin hyperparameter and configuration management.
"""
import copy
from typing import Union, Optional, List, Tuple, Iterable, Any, Dict
from typing_extensions import Literal
import ruamel.yaml.comments
from pydantic import BaseModel, validator, root_validator
import numpy as np
import pathlib
import ruamel.yaml... |
6569ad9031cce91660e7559fd89701e41020bf967f87eaf10e8787976c189785 | Python | 80,551 | 1,577 | """
Functions to run designer preprocessing steps
Includes:
run_denoising:
run_degibbs:
run_eddy:
run_b1correct:
create_brainmask:
run_rice_bias_correct:
run_normalization:
"""
import time
import shutil
from pathlib import Path
from lib.utils import run_fsl_eddy, run_topup_and_prepare_for_eddy, write_rpe_all_p... |
6ce29a3dec1efdaa7ae87726c24c92b1db3ddde521982c1a1e5ac5ab2162a9df | Python | 81,929 | 1,849 | """Framework-agnostic golden harness.
This module is the single machine both the legacy stack and the rewritten one
are allowed to share, so it deliberately depends on nothing but the standard
library, numpy and ase. It must never import the package under test: the
parity suites that consume it live outside the legacy... |
3a110051450065b177a9ca446e663b29d3237b964009ac94f9853af43a48010d | Python | 84,772 | 2,264 | """
NeuroLearn Statistics Tools
===========================
Tools to help with statistical analyses.
"""
__all__ = [
"pearson",
"zscore",
"fdr",
"holm_bonf",
"threshold",
"multi_threshold",
"winsorize",
"trim",
"calc_bpm",
"downsample",
"upsample",
"fisher_r_to_z",
... |
f2311c402f8ce51c0493226bb7e4b78dc6fa8f11f93b2a79d4b05b15aa44c569 | Python | 85,902 | 2,049 | """epg_fc2.py
Analysis and plotting functions for EPG_FC2.ipynb
"""
import os
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import scipy as sc
import seaborn as sns
import copy
from scipy.interpolate import interp1d
import analysis_plot as ap
import functions as fc
... |
acac07a96fb8567d6b0737689f0319bfeb7f79aa5cbc320026fd4d934300fc0c | Python | 86,204 | 2,563 | import copy
import json
import numbers
import os
import pickle
import re
import shutil
import yaml
import pprint
import traceback
import torch
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
import tqdm
import utils as u
import plotly.express as px
import plotly.graph_objs... |
68964b97a53daac4cc189900b2f126e82e7814c26a0c917e4d91c786a88dacd7 | Python | 87,244 | 2,252 | """
NeuroLearn Brain Data
=====================
Classes to represent brain image data.
"""
# Notes:
# Need to figure out how to speed up loading and resampling of data
__author__ = ["Luke Chang"]
__license__ = "MIT"
from nilearn.signal import clean
from scipy.stats import ttest_1samp, pearsonr, spearmanr
from scip... |
ce1e973a2f38f27f284bbd661e069dcdba39de49da4cfe9f68551989326c62b8 | Python | 89,964 | 1,429 | import torch
import torch.nn as nn
import numpy as np
from rdkit import Chem
from dig.ggraph.utils import check_chemical_validity, check_valency, calculate_min_plogp, reward_target_molecule_similarity
from dig.ggraph.utils import convert_radical_electrons_to_hydrogens, steric_strain_filter, zinc_molecule_filter
from .g... |
6114f6063dea1c2e3ed7f5a27e4654e9f3f5b52603edb950f34b88231f5a1510 | Python | 91,219 | 2,749 | """Visualization functions."""
# Authors: Mainak Jas <mjas@mgh.harvard.edu>
# Sam Neymotin <samnemo@gmail.com>
# Christopher Bailey <cjb@cfin.au.dk>
import colorsys
import warnings
from itertools import cycle
import matplotlib
import matplotlib.animation
import matplotlib.colors
import matplotlib.p... |
788a828083c6c8519da190bff0358794d3d64d89426938c1145d0342ce7b4391 | Python | 91,560 | 2,048 | import os
import sys
import numpy
import pandas
import logging
import re
import json
from utils import perform_mutation, merge_cols_with_priority, enumerate_isomers
from uniprot_utils import get_uniprot_sequences
from pubchem_utils import get_map_inchikey_to_CID, get_map_inchikey_to_synonyms, get_map_name_to_inchikeys... |
7ce8c2fa5701203950608110090445927742f2c3af482c638ec4138a7977b2c1 | Python | 92,213 | 2,234 | from tifffile import imread, imwrite
from skimage import filters
import subprocess
import pandas as pd
import os
from datetime import datetime
import numpy as np
import argparse
import sys
import time
from collections import defaultdict
import cc3d
import PIL.Image as Image
import matplotlib.pyplot as plt
import matplo... |
545caa82c7bb7447e3fc54fb2501d2f4fbe468a6934ce1d597164d01c609b59a | Python | 93,030 | 2,429 | import os
import sys
import math
import time
import datetime
import copy
import json
import io
from collections import OrderedDict
import warnings # to catch np.polyfit -->> RankWarning: Polyfit may be poorly conditioned
from typing import Any, Union, List, Optional, Dict
import numpy as np
import pandas as pd
impor... |
18fdb07a4f9c97443be3850beb0f3b56fce2e2e66da2b527d686987ae848de2e | Python | 94,935 | 1,990 | # -*- coding: utf-8 -*-
"""
Variability analysis of presynaptic inputs
Clean code for publication
@author: Sebastian Molina-Obando
"""
#%%
#Importing packages
import navis
from fafbseg import flywire
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib
import matplotlib.pypl... |
1393570ddcf4a518fd72d722b0359c8c41bdb46ac1bf0d53326ccfc0b63e1204 | Python | 96,502 | 2,596 | # Authors: Huzi Cheng <hzcheng15@icloud.com>
# Camilo Diaz <camilo_diaz@brown.edu>
# George Dang <george_dang@brown.edu>
import codecs
import io
import os
import json
import logging
import sys
import tempfile
import time
from pathlib import Path
from urllib.request import urlretrieve
from IPython.dis... |
daf8256b3c39601108683023a2c511e94b07331045ac25cb18a77c9ee9b700f6 | Python | 96,628 | 2,256 | """Represent brain image data with the BrainData class."""
import os
from collections.abc import Callable, Mapping, Sequence
from typing import TYPE_CHECKING, Literal, overload
import numpy as np
if TYPE_CHECKING:
from pathlib import Path
from nibabel import Nifti1Image
from sklearn.base import BaseEsti... |
83ec3bf4fdfe17ecf41f7ec061df9a9d61ec76eb32430307b3702c687d2bfc71 | Python | 97,848 | 2,391 | # pylint: disable=too-many-lines # magnetic MACE variants live here
import logging
from abc import abstractmethod
from typing import Any, Callable, Dict, List, Optional, Type, Union
import numpy as np
import torch
from e3nn import o3
from e3nn.io import CartesianTensor
from e3nn.o3._reduce import ReducedTensorProduct... |
d0dc1e0f0ff934d5959861202a47e978d7f5cb6b2baf64f139de7eec5760d977 | Python | 100,073 | 3,391 | # this helper script is from PyBioMed to get protein descriptors.
# there are incompatibility issues to use the entire library, so I copied and pasted here the src.
# https://pybiomed.readthedocs.io/en/latest/
import math
import string
import re
# import scipy
AALetter = [
"A",
"R",
"N",
"D",
"C... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.