sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
41740d0c2e7ea1340a4a7d488f75d1b74bff0cec8a544922b3eabbebfdd5dc4b | Python | 28,756 | 851 | # Copyright 2022 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0
"""
@author: Shay Vargaftik (VMware Research),
shayv@vmware.com; vargaftik@gmail.com
@author: Yaniv Ben-Itzhak (VMware Research),
ybenitzhak@vmware.com; yaniv.benizhak@gmail.com
EdenPipeline module.
EDEN is an unbiased lossy compression method that... |
2bdb1457a71c2280267cf87d73ecbb8fcea5559806825048b90f918b03ec0035 | Python | 28,759 | 719 | # 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... |
c1914de6d31c83663822e26fe6f527d37730172cbd9935be2b95ed47493e0f32 | Python | 28,789 | 837 | """Parameter optimization."""
# 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 matplotlib
import matplotlib.pyplot as plt
import numpy as np
from scipy.optimize import ... |
3d5e23b0a5dfe0b7b1d382679897476f44136c7bc6158becdf023b647c66a0ba | Python | 28,805 | 753 | # Copyright 2020-2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""GaNDLFTaskRunner module."""
import logging
import os
from copy import deepcopy
from typing import Union
import numpy as np
import torch as pt
import yaml
from GANDLF.compute.forward_pass import validate_network
from GANDLF.compute.gene... |
5c1f015d22ff4a41519c803ad0c180ff3050722383db55a5d9ab7acb3e6f86d8 | Python | 28,844 | 690 | """The LES electrostatics family reproduces its committed references.
`MACELES` is a `ScaleShiftMACE` with a long-range head: it predicts five
latent quantities per atom, hands them to the external `les` library for an
Ewald sum, and adds the result to the energy *outside* the scale-shift. None
of that was pinned by a... |
91ffac8b52560bcc4b72e25a7b43171d68b7b7fa4a73a09c8a14f3a7dd887dd8 | Python | 28,845 | 725 | # -*- coding: utf-8 -*-
"""
Allen Institute Software License - This software license is the 2-clause BSD
license plus a third clause that prohibits redistribution for commercial
purposes without further permission.
Copyright 2018. Allen Institute. All rights reserved.
Redistribution and use in source and binary for... |
44ee3d36dc888c90e29047cd9bf979afe55345cc1d19a00c048e23e27845be45 | Python | 28,871 | 660 | #!/usr/bin/env python3
#
# Sniffles2
# A fast structural variant caller for long-read sequencing data
#
# Created: 27.08.2021
# Author: Moritz Smolka
# Maintainer: Hermann Romanek
# Contact: sniffles@romanek.at
#
import math
import logging
from typing import TYPE_CHECKING
from sniffles import util
from s... |
a2d0f7b99d58729ccaa804a1cc01a50b072a54ba46354dfc07c996fc11710cfb | Python | 28,980 | 855 | # ==============================================================================
# Copyright 2025 Technical University of Denmark
# Author: Nikolas Borrel-Jensen
#
# All Rights Reserved.
#
# Licensed under the MIT License.
# ==============================================================================
import itertools... |
80bcc5c4fd216cf8082a21ee2400ac762ce9ccecd3a5b6041615f1fbdb0ab0d3 | Python | 29,152 | 445 | 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
... |
b105ba027365155c9249358d0b4b375d27321f977d376b28200d60114f90b27f | Python | 29,153 | 841 | from pprint import pprint
from typing import List, Union, Optional # Callable, Iterator, Optional
import warnings # to catch np.polyfit -->> RankWarning: Polyfit may be poorly conditioned
import numpy as np
import scipy.signal
import sanpy
from sanpy.sanpyLogger import get_logger
logger = get_logger(__name__)
... |
f2cd5d20552cfb9a225755c57cfabf2e4e087f36a7a0834f19dac838f90249a4 | Python | 29,175 | 713 |
import numpy as np
import matplotlib.pyplot as plt
import os
import pandas as pd
#import ccwBaseFunctions as ccw
import itertools
from scipy import stats
import pickle as pk
import seaborn as sns
import scipy
from sklearn.decomposition import PCA
import scipy.signal as sig
from sklearn.decomposition import FastICA
fro... |
efe9eba07dcb5f5960aa44c90083b9cf93e1a76136cd5f83948ca5cbd505beb7 | Python | 29,215 | 746 | """Class definition to manipulate data spindle EEG datasets."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import pickle
import numpy as np
from sleeprnn.common import pkeys
from sleeprnn.common import constants
from sleeprnn.common import ... |
b86162fc394eb056c0443027de664b84dd4694ea72c907f81067c921ed6f06d1 | Python | 29,274 | 560 | # import tensorflow as tf
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
import os
import numpy as np
import NALSM_GEN_SUPPORT as sup
class CUBA_LIF_network:
def __init__(self,number_of_networks_IN):
self.rootPath = os.path.abspath(os.path.join(os.getcwd(), os.pardir))
self.... |
ea442d994293d4220cb9a21b41f525390ed7d39f5e0e13261efc400ab0d7197d | Python | 29,525 | 333 | """A lot of naming definitions for model and datasets"""
import config
trained_models = dict()
# pgans
trained_models['pgans'] = ['UNet-20220307-Brats184-Gan184mirroraugsingle_fullannotations-256-geoaug-imaug-valid-lr1.0e-02',
'UNet-20220307-Brats184-Gan184mirroraugsingle_fullannotations-256... |
85fb2148cdff6df2f901cf336ed7fce31e6ec019733193f1894d43f240fb9d72 | Python | 29,526 | 803 | # ---
# jupyter:
# jupytext:
# formats: ipynb,py:light
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.19.1
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
# name: python3
# ---
# # Focusing... |
f01e07f7f12c5e81c9b6ea1735e6b1dc45e43ed6e30fac5dc3844af3cd0d6205 | Python | 29,533 | 808 | # 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 io
import logging
import os
import pickle
import random
import socket
import struct
import subprocess
import warnings
from argparse imp... |
ac763b475b53e23e4fb4b65547dbe4b78846bede078c8779beecb830b9d20b18 | Python | 29,562 | 845 | import math
from functools import partial
from typing import Union, Dict, List, Tuple, Optional, Optional
import numpy as np
import pandas as pd
from PyQt5 import QtCore, QtWidgets
import pyqtgraph as pg
# from matplotlib.backends import backend_qt5agg
import matplotlib as mpl
import matplotlib.pyplot as plt
from s... |
0a39fb30e1b645177a3a1c0f6028245b7071d9575df5473730c484cb592aabab | Python | 29,567 | 702 | 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 common.losses import create_loss
from prognosis.models.networks import get_output_channels, make_global_pool
MIN_NUM_PATCHES = 0
coloredlog... |
fee6521612f7c2474389b1d2734f513ea237c9ddbbf780f34a4de09bc35b9850 | Python | 29,592 | 806 | """Affine connections.
Lead author: Nicolas Guigui.
"""
from abc import ABC
import geomstats.backend as gs
import geomstats.errors
def _check_log_solver(connection, raise_=True):
if not hasattr(connection, "log_solver"):
if raise_:
raise ValueError(
"Requires `self.log_solve... |
087531502c28db64b2034da84ff5adc0a1a0caa15d3a9ce605fd683c330706cc | Python | 29,612 | 453 | 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
... |
c187bf764d29a360becf2309b68ac2014c5a6a8957b91f198b599b48c9257cb1 | Python | 29,634 | 638 | # -*- coding: utf-8 -*-
import unittest
import os
from itertools import islice
import numpy as np
import odl
from dival import get_standard_dataset
from dival.datasets.dataset import Dataset
from dival.datasets.lodopab_dataset import LoDoPaBDataset
from dival.datasets.cached_dataset import CachedDataset, generate_cache... |
25b025d0785dfd3676f0a5f683a8efe487d129092dd6665056f312f692454111 | Python | 29,658 | 796 | # Copyright 2020-2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""openfl.experimental.workflow.runtime package LocalRuntime class."""
from __future__ import annotations
import gc
import importlib
import math
import os
from copy import deepcopy
from logging import getLogger
from typing import Any, Cal... |
d97014f5ed790aa5f65a3dbf1a9beb4d2bc86ce005b085f991cd3c1a145f8cd7 | Python | 29,662 | 928 |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
# class modules
# In this file we collect all the modules so we don't need to re-write them
# at every file
class _ResidueModule(torch.nn.Module):
'''One-dimensional convolutional residual
we only provide the channel count
... |
9991e6c6b36ace2a64e7f33f1c788751493b80a9f8ce7111d1d911b1fa291a1d | Python | 29,697 | 711 | import os
import urllib.parse
import urllib.request
import warnings
from pathlib import Path
from typing import Any, Literal, Optional, Union, overload
import torch
from ase import units
from ase.calculators.mixing import SumCalculator
from mace.tools.deprecation import warn
from mace.tools.utils import get_cache_dir... |
6c7310b668f7aa38687908c838eb7dd266e16a42e7ccbe71d191f0a352770a80 | Python | 29,724 | 849 | # 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
... |
49012e6d592d9f73766026a21caba1cc161bf4a8983f5e7a0e5078ea241048e0 | Python | 29,732 | 869 | # 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... |
2311fc4c26f668346a2a2f07f3700052d1509b11e096e3135b5afe830327300f | Python | 29,741 | 422 | from argparse import ArgumentParser
from models.lightning_rnn import LITGRU
from models.model_runner import ModelRunner
def parse_inputs(dates, ratios):
date_ratio_zip = list(zip(dates.split(','), [float(x) for x in ratios.split(',')]))
involved_dates = [x for x in date_ratio_zip if x[1] > 0]
s = involve... |
d82adc6e70596df674f2b819f85edecca606e1eb68c8be4feaccec2cf33f13b4 | Python | 29,812 | 836 | # -*- 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... |
4056a0d5ff7fc6559d272434248c167c4a52ab7ac1a956fb084fc6e03c9c8ed5 | Python | 29,836 | 760 | """Unit tests for mace/data/utils.py (configuration parsing).
Covers KeySpecification / update_keyspec_from_kwargs, config_from_atoms
(custom info/arrays keys, missing keys, config_type / weights, pbc/cell),
load_from_xyz round-trip through a temporary extxyz file (including
IsolatedAtom E0 extraction and keep_isolate... |
9890dacd13623968178acdeb01f5bc5b23318e0c98eac13c9691e75dfb17951f | Python | 29,841 | 823 | import torch
import torch.nn as nn
import ISNetFunctions as f
import LRPDenseNet
import globals
from collections import OrderedDict
import re
#Transform function in ISNetFunctions in DNN layers:
class LRPDenseReLU (nn.Module):
def __init__(self, layer,e):
super().__init__()
self.e=e
self.l... |
56ca9e8947af191ef2e60ffe96b28789aea533524717e49d36f5eeec9d569db9 | Python | 29,877 | 700 | 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 common.losses import create_loss
from prognosis.models.networks import get_output_channels, make_global_pool
MIN_NUM_PATCHES = 0
coloredlog... |
fd9b330d86d377237bdeea0b1cb94ec1c19dca883d23eba7bfde69338afedad1 | Python | 29,896 | 846 | import json
import logging
from typing import Dict, List, Optional
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import torch
import torch.distributed
from torchmetrics import Metric
from mace.tools.utils import filter_nonzero_weight
plt.rcParams.update({"font.size": 8})
mpl_logger = logging... |
88888a72d2aab91a7af2809bf168fe275f256ed050b33a22e8dddd96b06c92f7 | Python | 29,909 | 538 | import os
import numpy as np
import batch_utils
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
import glob, random, logging
from configobj import ConfigObj
from tensorflow import keras
from batch_utils import ImageTransformationBatchLoader, Her2data_splitter
... |
13343602a4bad922d5bc15d03646a5829b1c1d42cd7e0f094e2125ebc167f774 | Python | 29,944 | 641 | ################################################################################
# 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... |
230e67664ca7d7cf3039e2d14d89a2866911896ddee4d9931642bbd2216828f2 | Python | 29,951 | 752 | import math
import os
from functools import partial
import json
from types import UnionType
from typing import Any, Optional, get_args, get_origin
from PyQt5 import QtCore, QtWidgets, QtGui
import sanpy
from pydantic import ValidationError
from sanpy.bDetection import DetectionParameters, detectionTypes_
from sanpy.... |
695cd96b947b125bdab734eb45ebdf4547678be08a90eb97a4fe9417e9499b18 | Python | 29,974 | 874 | """Estimate statistics from trajectories using DGA with memory."""
import numpy as np
import scipy as sp
from dgamem.stop import backward_stop, forward_stop
__all__ = [
"stationary_distribution",
"stationary_distribution_matrices",
"stationary_distribution_projection",
"stationary_distribution_soluti... |
51a65538c365031b3faf6b10b606335f6ab3517110e455aae8754d34191b2cd1 | Python | 30,019 | 823 | # Copyright (C) 2020-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
# -----------------------------------------------------------
# Primary author: Hongyan Chang <hongyan.chang@intel.com>
# Co-authored-by: Anindya S. Paul <anindya.s.paul@intel.com>
# Co-authored-by: Brandon Edwards <brandon.edwards@intel... |
d8e68232defe3594dd56ee02bf51174c6649f5862c0617f7cb4af620c65746fb | Python | 30,061 | 732 | import warnings
from typing import Optional, Tuple
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from ..modules import AttentionConvZ, Conv3dBlock, UNetAttentionConv, _get_padding
from . import Atom, MoleculeGraph, find_gaussian_peaks, make_box_borders
from .._weights import do... |
ee5f14a7677cdb35a53f2af6daf36c0377a3d0d1b9cf312ce7b13108aed72258 | Python | 30,118 | 591 | # 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 ... |
cd935c0b52f894237708660074fa0389e5613af815f806aa1d632bf21180db27 | Python | 30,122 | 820 | from math import sqrt
from typing import Callable, List, NamedTuple, Optional, Tuple, Union
import e3nn_jax as e3nn
import haiku as hk
import jax
import jax.numpy as jnp
import numpy as np
from e3nn_jax import Irreps, IrrepsArray, config
from e3nn_jax._src.core_tensor_product import _sum_tensors
from jax import numpy a... |
b9e12e44bb6d1760a2ccf0b3d2a44b7eb2c34e9fd609b740f8ebe90780c712f4 | Python | 30,190 | 895 | ###########################################################################################
# Utilities
# Authors: Ilyes Batatia, Gregor Simm and David Kovacs
# This program is distributed under the MIT License (see MIT.md)
###########################################################################################
imp... |
961a175446385ec26c71b6613d7da44fda7beeb15b89a65ee399df51acd7fadf | Python | 30,196 | 546 | import os
import warnings
import itertools
import argparse
from tqdm.autonotebook import tqdm
import numpy as np
import GPy
import torch
import gpytorch
import math
from manager import Config
from metrics import Metrics
from data import get_system
from online import get_online_api, plot_online
from utils import minma... |
98136bdc02d71e20defc6b41a50dfad5bc41ede82b327249f229cda85ac6968c | Python | 30,236 | 983 | from abc import ABC, abstractmethod
from typing import Sequence, Optional, List
from uuid import UUID
from overrides import override
from chromadb.api.collection_configuration import (
CreateCollectionConfiguration,
UpdateCollectionConfiguration,
)
from chromadb.auth import UserIdentity
from chromadb.api.model... |
6ae7fd79166dc921dbb8d6d45bcd0c179807f14d7be898245dd5363121b3c8cc | Python | 30,311 | 715 | # -*- coding: utf-8 -*-
"""Provides `LoDoPaBDataset`.
Provides simple access to the `LoDoPaB-CT dataset
<https://zenodo.org/record/3384092>`_ documented in a
`Data Descriptor article
<https://www.nature.com/articles/s41597-021-00893-z>`_.
"""
import os
from warnings import warn
from math import ceil
import numpy as np... |
5400ea95214e258c336ab37e8817711987029809fba223891f9743d10dda9447 | Python | 30,421 | 645 | # 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 ... |
9a0fd88d6cd48e4c0222725989150aa0de79e8fd7516b74c1dcdba0d1244e198 | Python | 30,428 | 782 | """
NeuroLearn Simulator Tools
==========================
Tools to simulate multivariate data.
"""
__all__ = ["Simulator", "SimulateGrid"]
__author__ = ["Sam Greydanus", "Luke Chang"]
__license__ = "MIT"
import os
import numpy as np
import nibabel as nib
import pandas as pd
import matplotlib.pyplot as plt
from nil... |
030347362d686be347a19f0df1a0c6f88752edb0b2c07dff85269c7dad230832 | Python | 30,458 | 736 | # 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... |
b3f08c0bd07a591319b93c2a8f1cfea15344cbf2b1b98e6a8373cfb649be3f5b | Python | 30,544 | 731 | # 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... |
01307dae9126f1c34030215767994e0342eed6bb69c6dad995e4417e34f7f36a | Python | 30,550 | 782 | #!/usr/bin/env python3
#
# Sniffles2
# A fast structural variant caller for long-read sequencing data
#
# Created: 15.08.2021
# Author: Moritz Smolka
# Maintainer: Hermann Romanek
# Contact: sniffles@romanek.at
#
import logging
from dataclasses import dataclass, field
from functools import cached_property... |
f6e3debcda9830a9879f5266d7fbcbadc07411ef35a0117ef5e454f8470dc33e | Python | 30,557 | 950 |
# file_browser_ui.py
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
import pickle
import sys
import os
import main
import numpy as np
import napari.utils.notifications as notif
class LineEdit(QWidget):
def __init__(self, title, default=None):
QWidget.__init__(self)
... |
0fcd114e7ac36311260f03d78b5e85a660fd515b2942a680284ec59b13cd062a | Python | 30,639 | 770 | """niivue interactive viewer for BrainData, as a self-owned `anywidget`.
`_build_viewer` returns a `_NiivueViewer` — a WebGL brain viewer with live
windowing, slice scrolling, native 4D frame scrubbing, true 3D rendering, and
optional nltools-atlas overlays (colored regions / outlines / hover labels).
The widget driv... |
9e12b3afcca73b2609714f032f8e2188e17b5c7b2154582d8d1c347e8d8e50dd | Python | 30,653 | 888 | """Handling of parameters."""
# Authors: Mainak Jas <mjas@mgh.harvard.edu>
# Sam Neymotin <samnemo@gmail.com>
import json
import fnmatch
from pathlib import Path
from copy import deepcopy
from .externals.mne import _validate_type
from .params_default import get_params_default
# return number of evoked in... |
461f91c21f75c3d9728fc7844b08f0def115622fc6aaec914c35b2ca46169b04 | Python | 30,675 | 769 | import numpy as np
import pandas as pd
from scipy import signal, ndimage, interpolate, stats
from itertools import combinations
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from matplotlib.ticker import FormatStrFormatter
from matplotlib.offsetbox import AnchoredText
import statsmodels.a... |
a3d2078c490c448110cde34b27d8d207b8026d86b6a675f8f5957fc96fd4fbe3 | Python | 30,689 | 860 | import copy
import concurrent.futures
import json
import logging
import os
import sys
import time
import warnings
import argschema
import h5py
import numpy as np
import renderapi
import scipy.sparse as sparse
from scipy.sparse import csr_matrix
from .schemas import BigFetaSchema
from . import utils
from . import json... |
a4980cfa68795aefee74c1f5335a308f7e946930960e9923663f3427907e09c3 | Python | 30,809 | 623 | #!/usr/bin/env python3
import typing
from typing import Any, Callable, Sequence, Tuple, Union, cast
import torch
from torch import Tensor
from torch.nn import Module
from .deep_lift import DeepLift, DeepLiftShap
from captum.attr._utils.attribution import LayerAttribution
from captum.attr._utils.common import (
Ex... |
46bfb43b40c21879b3503da3e717c1cdd2da9eb13ec3e0fecd1dfde3fe57556c | Python | 30,814 | 953 | import copy
import json
import logging as log
import os
import pickle
import warnings
from random import random
import coloredlogs
import cv2
import numpy as np
import pandas as pd
import solt
import torch
from sas7bdat import SAS7BDAT
from scipy.special import softmax
from scipy.stats import beta
from solt import cor... |
3c78c0d93d66849eb55e213d15544d235b0fcd148aa69f32becdf2d36024a529 | Python | 30,825 | 716 | # 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 nequip.model.saved_models.package import (
_get_shared_importer,
_get_package_metadata,
_suppress_package_importer_exporter_warnings,
_cpu_deserialize_always,
)
from ... |
b0e5edc80fa08f04124e505afe6f656eb5809792867b09bb8cfff51ce06d522b | Python | 30,846 | 453 | from multiprocessing import Process, Lock, Manager
from argparse import ArgumentParser
import json
from models.lightning_rnn import LITGRU
from models.model_runner import ModelRunner
def parse_inputs(dates, ratios):
date_ratio_zip = list(zip(dates.split(','), [float(x) for x in ratios.split(',')]))
involved... |
bc2f108d4ae8ecac43682cd82fcd480c8d6177df1b5539e70ef507d55c3c3bc8 | Python | 30,848 | 736 | # 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... |
3ffacdda686f64f44ec7aa95949080127fb468d5535dade300b4d2196de14b03 | Python | 30,887 | 804 | """
Handler classes to calculate extracellular electric potentials, such as the
Local Field Potential (LFP), at ideal (point-like) electrodes based on net
transmembrane currents of all neurons in the network.
The code is inspired by [1], but important modifications were made to comply
with the original derivation [2] ... |
da3d33e7debee815baaa3472842f810f2113cfee7f54c4a76cbf17f8316fcdfb | Python | 30,964 | 745 | # 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... |
8f2f4113e1004bf572be2479f94dce03c7dfc5c560d124ab47cc45d52e558ec7 | Python | 31,017 | 802 | """This Python script is modified based on the official `transformer_layer.py` from fairseq. It takes encoded input
from `transformer_encoder.py`, performs splitting, constructs a syntactic-semantic encoding self-attention network,
and then fuses the encoded representations. The fused encoding serves as the output."""
... |
ac2566bdfb6c01d6e2b417d8a5c8e11f546bacd04fad2be73ab77b0928850e37 | Python | 31,024 | 946 | #!/opt/conda/bin/python
import argparse
import dask.dataframe as dd
import json
import matplotlib.gridspec as gridspec
import matplotlib.pyplot as plt
import numpy as np
import os
import os.path as op
import pandas as pd
import pingouin as pg
import re
import s3fs
import seaborn as sns
import shap
from glob import gl... |
c37ccecf3daa00b5d74b63af850e328c8dee828d04de671ab0faa98488f3eadd | Python | 31,028 | 706 | # 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.
try:
from collections.abc import Iterable
except ImportError:
from collections import Iterable
import contextlib
import itertools
impo... |
16b49d7accfa3639f4a5cd45f0d2fc92a759443b23dafa105263626b4176ea55 | Python | 31,038 | 638 | """Stable VDJdb record identifiers.
A VDJdb record has no identifier today. It is a row in a chunk file, and the only thing that names it
is its own content. So when a curator fixes a typo in a CDR3, the old record disappears and a new one
appears, and nothing downstream can tell that from a deletion plus an addition.... |
934236b5ca1eea5e5282da53c8fc607d314bacdf632ce6f9e248a38c50f39bb6 | Python | 31,049 | 888 | from abc import ABC, abstractmethod
from typing import Union, Tuple, Optional, Sequence
import numpy as np
import torch
from torch.nn import Module, Parameter
import torch.nn.functional as F
from torch.nn.modules.utils import _pair
from .nodes import Nodes, CSRMNodes
class AbstractConnection(ABC, Module):
# lan... |
9b6a46abb4df936c300bcf49e539947c57e4a058706508e432ba61296cbea175 | Python | 31,059 | 1,082 | # -*- coding: utf-8 -*-
"""
Plotting function for visualizing comparison results.
Created on Jun 29 2023
@author: Mohammad Torabi
"""
import math
import os
import warnings
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy.cluster.hierarchy as shc
import scip... |
18e3d8e6d04e24d5bb0741d0eef14575f89dda5a5af8ce8478bfa272c0cbfdd4 | Python | 31,146 | 859 | # -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
from scipy import stats
import seaborn as sns
import matplotlib
def plot_pie(values, subplot):
labels = ['pl', 'cg', 'm2']
colors = ['grey', 'white', 'yellow']
subplot.pie(values, labels=labels, colors = colors, auto... |
26ffa586d76f8d58dcf937b1fe773248e2a5368d96ab0392e98cac5da62e0884 | Python | 31,170 | 784 | # pyhddmjagsutils.py - Definitions for simulation, model diagnostics, and parameter recovery
#
# Copyright (C) 2021 Michael D. Nunez, <m.d.nunez@uva.nl>
#
# 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 Fou... |
ddc4f8cbabff6747e46edf5f0a877ef2b4bff352ad8c109aa4c4b5afe4c2c12c | Python | 31,237 | 773 | """Characterization of `mace/modules/radial.py` and the radial-embedding
assembly in `mace/modules/blocks.py`.
Everything in this file is pure mathematics: a distance in, a number out, no
learned parameters and no graph beyond the element pair an edge connects. It
ports into the rewrite nearly verbatim, so these value... |
ddf5d45cce5c5ff3696ce9b52dbd31f8d3c80f2bfbc64fa6cd0f906a2b0a30ad | Python | 31,248 | 908 | """
StochasticHH_ObjectOriented.py
Author: Alan Leggitt
5-11-2012
This code is a re-implementation of Matlab code written by Joshua Goldwyn. The original Matlab code can be found at
http://faculty.washington.edu/etsb/tutorials.html
This version runs best using the Enthought Python Distribution 7.2
www.enthought.com
... |
88b1ac70d51860a5636fe622d5005efcdf53d431abee47fbc2c24af0d1bce3b7 | Python | 31,369 | 814 | # 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 math
from typing import List, Optional
import torch
import torch.nn as nn
from fairseq.token_generation_constraints import (
Const... |
7a7d604858b6cf2cfc92acddd92ea2d3bedc562643ea33420481078db8eb02eb | Python | 31,445 | 788 | #!/usr/bin/env python
# coding: latin-1
"""Shared Response Model (SRM) for multi-subject fMRI alignment.
SRM factorizes each subject's data as `X_i ≈ W_i S`: a shared low-dimensional
response `S` common to all subjects plus a subject-specific orthogonal
transform `W_i`. `_SRM` is the probabilistic model fit by
expect... |
a5198310fa209ebecf8fb268bab1644857828cab5eaae2ba876973892eee67a3 | Python | 31,527 | 986 | import collections
import copy
from functools import partial
import itertools
import json
import logging
import os
import subprocess
import sys
import time
import warnings
import h5py
import numpy as np
import requests
import scipy.sparse as sparse
from pymongo import MongoClient
import renderapi
from renderapi.exte... |
798f1255c93eeb8d7c891c0a0d264e4c27a4e3ba03b1efed759cb1901ba72c5e | Python | 31,542 | 1,008 | # sys
from pathlib import Path
# sci
import numpy as np
from sklearn.decomposition import PCA
# ephys
import quantities as pq
import elephant as ele
# vis
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
# own
import functions as sf
import sssio
logger = sssio.get_logger()
def get_c... |
e12bc966d9999ab907a759e73cb90de8fc0d45289dd45a7653ab5889d2c421c4 | Python | 31,593 | 897 | import numpy as np
import pytest
import torch
import torch.nn.functional
from ase import build
from e3nn import o3
from e3nn.util import jit
from scipy.spatial.transform import Rotation as R
from mace import data, modules, tools
from mace.tools import scripts_utils # noqa: F401 (tools.scripts_utils)
from mace.tools ... |
90f9b14d8c9ab61aee51c0f6e1ff5eea0734c7986d9c24de3151eb62b656460c | Python | 31,605 | 774 | """Preprocessing pipeline from Smith et al. (2015)."""
import warnings
import numpy as np
from scipy.stats import zscore
# explicitly require this experimental feature
from sklearn.experimental import enable_iterative_imputer # noqa
# now you can import normally from sklearn.impute
from sklearn.impute import Simple... |
a291329979827d0091addde08aaf977e17592fb14d5ae8fb73f0e7e531d1179d | Python | 31,738 | 808 | """What each surface can emit, read out of ``mace/`` rather than remembered.
The golden schema has to know every name an evaluation can produce, and the
only durable way to know that is to derive it. Two rounds of defects here had
one shape: a hand-written table that looked complete, silently missed
something, and rep... |
ba763c57ff7870313d806fb4f2b1973308b8a7da55f66a5130e4337bb6c71a8a | Python | 31,890 | 818 | ###########################################################################################
# Training script
# Authors: Ilyes Batatia, Gregor Simm, David Kovacs
# This program is distributed under the MIT License (see MIT.md)
###########################################################################################
... |
ff6f606c932e7c71b8d739b1191fd4988ddff1c000b7cff1c3d10971348a3a47 | Python | 32,031 | 615 | """ Spatial Extent Project - Data Cleaning script
The goal of this script is to clean the ADNI data as downloaded from the LONI servers
in May 2022. We specifically downloaded and cleaned:
- UCBERKELEYAV1451_04_26_22.csv (TAU AV1451 data)
- UCBERKELEYAV45_04_26_22.csv (Amyloid AV45 data)
- UCBERKELEYFBB_04_26_22.csv (... |
75bc8d6d8c94b82efecbdcdab3c13430fdf644e2448f7ff74cb0ce93935a20da | Python | 32,088 | 1,034 | r"""Classes for the Wald Space and elements therein of class Wald and helper classes.
Lead author: Jonas Lueg
References
----------
.. [Garba21] Garba, M. K., T. M. W. Nye, J. Lueg and S. F. Huckemann.
"Information geometry for phylogenetic trees"
Journal of Mathematical Biology, 82(3):19, February 2021a.
... |
2d0ec7c959a52548ecf96da35fd25795a5da54f6924c99d12632e8c58290bcd8 | Python | 32,096 | 176 | from PymoNNto import *
import tensorflow as tf
import time
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
steps=[100*1.2**(i+1) for i in range(26)]
'''
class Basic_Behavior_Tensorflow(Behavior):
def initialize(self, neurons):
neurons.voltage = tf.Variable(neurons.vector(), dtype='float32')
... |
3a0a6132178798d8406a78f1affd8be5107a431cf3a1113dd13e2a99beeed84c | Python | 32,142 | 794 | """
Networks for voxelmorph model
In general, these are fairly specific architectures that were designed for the presented papers.
However, the VoxelMorph concepts are not tied to a very particular architecture, and we
encourage you to explore architectures that fit your needs.
see e.g. more powerful unet functi... |
7e584a420e11a424f40ba129dc013b86cd9590eadc6e631906843cee4bb34ba8 | Python | 32,188 | 602 | # import tensorflow as tf
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
import os
import numpy as np
import NALSM_GEN_SUPPORT as sup
class CUBA_LIF_network:
def __init__(self,number_of_networks_IN):
self.rootPath = os.path.abspath(os.path.join(os.getcwd(), os.pardir))
self.... |
0e871c0748dbb16bd2ef0b25f3cdaacd0b31df487848833dc770b8ec8361459b | Python | 32,198 | 742 | """
# Connectome Predictive Modelling - Python adaptation - V2.0
Script - CPM (LOOCV)
Author: Frederic St-Onge (adapted from Shen et al. 2017)
Date created: 2022-02-21
Date modified: 2022-11-03
Version 2.0
Future versions:
- Correlations in Matlab go much faster. We did some testing where we imported the original m... |
5e810f29b0e9f7b8ed9755b5c21fffbc28cafdf150cdfd92881122ae0917db4a | Python | 32,253 | 758 | # 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... |
2d27a468cbff46c7420e9f712fda50cc004c6b5d1355b4b443bcfe2ac3c71bcf | Python | 32,350 | 909 | """
Run the "canonical" TE-Dependent ANAlysis workflow.
"""
import argparse
import datetime
import json
import logging
import os
import os.path as op
import shutil
import sys
from glob import glob
import numpy as np
import pandas as pd
from nilearn.masking import compute_epi_mask
from scipy import stats
from threadpoo... |
28ca67c044d7ab8ad3b72c6bcdb744e11e3f00d5f8389733f4018068d5bd64c6 | Python | 32,366 | 932 | """
Plugin to create and save Axon ATF files
File looks like this 20211119
ATF 1.0
8 11
"AcquisitionMode=Episodic Stimulation"
"Comment="
"YTop=20000"
"YBottom=-20000"
"SyncTimeUnits=100"
"SweepStartTimesMS=21.000,221.000,421.000,621.000,821.000,1021.000,1221.000,1421.000,1621.000,1821.000"
"SignalsExported=IN ... |
fa7b952207a2b0d8be4ec3a8f09442ecb28aaa1ff5d5b4fa856f0ad5e7f7bb62 | Python | 32,491 | 812 | # -*- 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... |
fa1a5cfaf1dc52ffa3cbcf77b639c23de758a1afc9f3442dad3e128b38b2dc93 | Python | 32,538 | 893 | from typing import TypedDict, Dict, Any, Optional, cast, get_args
import json
from chromadb.api.types import (
Space,
CollectionMetadata,
UpdateMetadata,
EmbeddingFunction,
)
from chromadb.utils.embedding_functions import (
known_embedding_functions,
register_embedding_function,
)
from chromadb.... |
28b8f6c82f6a8358ad664fb636eedc668e06b4393ed6adc6645c32848527a1cd | Python | 32,612 | 814 | # 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... |
ad1507a629ce1f05f3e0ee2adaf34c8b2c2b0bfde8145e9eb10a2ea21ae98029 | Python | 32,651 | 1,664 | import os
OPTIMAL_THR_FOR_CKPT_DICT = {
os.path.join("20210529_thesis_indata_fixed_e1_n2_train_mass_ss", "v2_time"): [
0.52,
0.58,
0.54,
0.56,
0.52,
0.58,
0.52,
0.50,
0.56,
0.48,
0.52,
],
os.path.join("20210529_thesis_... |
ac6186f8aaaf329564a40278459e66572404fffafa376c6ee63f66f7ac98a2e7 | Python | 32,697 | 1,108 | import operator
import functools
from warnings import warn
from pathlib import Path
import sys
import numpy as np
from hnn_core.docs import docdict
####################################################
# mne/parallel.py
def parallel_func(func, n_jobs):
if n_jobs != 1:
try:
from joblib import... |
932d68b0188e6dfacbc23a9f1c5560254b017c759dc5afa80a8fe972e8994b71 | Python | 32,806 | 837 | from __future__ import annotations
import functools as ft
import itertools as it
import textwrap
import warnings
from math import inf
from pathlib import Path
from string import Formatter
from typing import Any, Iterable, NoReturn, cast, overload
import attr
import more_itertools as itx
from bids import BIDSLayout
fr... |
a4ba2c9996b01e47ff186954a0053502e52a4a6ace4e6aca8dd7c822d5620b57 | Python | 32,974 | 1,036 | """Frechet mean.
Lead authors: Nicolas Guigui and Nina Miolane.
"""
import abc
import logging
import math
from sklearn.base import BaseEstimator
import geomstats.backend as gs
import geomstats.errors as error
from geomstats.geometry.hypersphere import HypersphereMetric
from ._utils import (
_is_elastic_metric,... |
8c8c854cc9f6c9f9b50b2626eed86a6f70e989c71dc438e29e31710c3b8ca6e8 | Python | 33,010 | 873 | import json
import logging
import pickle
from collections.abc import Callable, Generator, Iterable, Iterator
from contextlib import suppress
from itertools import combinations, pairwise
from math import comb
from pathlib import Path
from pprint import pformat
from typing import Any, Literal
import h5py
import numpy as... |
095e3c33cd5d5e74079d2caf599ec313d26b6472e8afe5d3be705b9b9cb6d951 | Python | 33,090 | 729 | import pickle
import pandas as pd
import numpy as np
import os
import warnings
import sys
import shutil
from tqdm import tqdm, trange
import random
import torch
from torch_geometric.data import InMemoryDataset, Data
import prettytable as pt
import math
import argparse
warnings.simplefilter(action='ignore', category=Fu... |
a892537f5fd34f9afc0d5edff253b45c77b09a3a0b3cd6210d0e913effcb09d4 | Python | 33,116 | 909 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 14 12:00:03 2023
@author: egemo
"""
from .core import core
from .utils import Dict
from torch import (float as torchfloat,
zeros,
ones,
rand,
tensor,
arange,
... |
a7cd119d9e196099d40c047dfd869829d34dd53d190efc73162ef9b42271b599 | Python | 33,168 | 920 | """Information Manifold of multivariate normal distributions with the Fisher metric.
Lead authors: Antoine Collas, Alice Le Brigant.
"""
import math
from scipy.stats import multivariate_normal, norm
import geomstats.backend as gs
import geomstats.errors as errors
from geomstats.geometry.base import VectorSpaceOpenS... |
cfed1f50e6d8383dfce0d94dd593e5543b487def452df55ff1372d35912ceaeb | Python | 33,178 | 815 | """Where the isolated-atom energies come from, and what happens when they do not.
E0s are the largest numbers in a MACE energy by two or three orders of
magnitude, and they enter in exactly one place: `AtomicEnergiesBlock` looks
them up with a one-hot matmul and the result is the first term of the readout
sum (`mace/m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.