sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
d56a9bc52bfb075b9055692f46989ea11927585a7358c3a4e787ad0ba9c808e1
Python
9,853
336
import torch from latent_time_stepping.special_loss_functions import MMD from latent_time_stepping.time_stepping_training.optimizers import Optimizer import pdb import matplotlib.pyplot as plt class LpLoss(object): def __init__(self, d=2, p=2, size_average=True, reduction=True): super(LpLoss, self).__init...
4fa9862cc19c5dba72a09ed90a5adf45770ca26ea9012989d91863473c5c5077
Python
9,855
249
from typing import List, Tuple import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import ConvModule from mmdet.models.necks.fpn import FPN from torch import Tensor from lqit.registry import MODELS from lqit.utils import ConfigType, MultiConfig, OptConfigType @MODELS.register_module() c...
517636a71a862281721bdd42e3b309affcd1ef92aa3872d063b15e87119490f7
Python
9,855
245
"""Methods for reshaping raw ECG signal data for use in the pandas ecosystem.""" import os import tempfile from typing import Any, Dict, Optional, Tuple, Union import numpy as np import pandas as pd from biosppy.signals.tools import filter_signal import h5py from ml4h.defines import ECG_BIKE_LEADS from ml4h.defines im...
839b46e57ace1788b4145d33794d04fa5193fba617aeee21ce0d99a4614d4d27
Python
9,857
280
""" Copyright (c) Meta Platforms, Inc. and affiliates. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. """ from __future__ import annotations import os import tempfile import importlib from typing import TYPE_CHECKING import numpy as np import ...
87e2c7b0d4f2129598a9f10a87594d365d54f9f295991f7c4a1dc1f9b6b8aa3e
Python
9,857
328
cd /mnt/d/Brain_region_project/SCENIC/ conda activate scenic_protocol python import scanpy as sc import numpy as np import pandas as pd adata=sc.read_csv("Brain_region_raw_major_cell_counts_matrix.csv") sc.pp.filter_genes(adata,min_cells=100) adata.raw=adata sc.pp.normalize_total(adata, target_sum=1e4) sc.p...
4b3d53fd9ec807e60f91d246564c036d761095c612c38dda2a5a7821340cb702
Python
9,859
297
# built-in dependencies import os import json import hashlib import struct import math from typing import Any, Dict, Optional, List, Union # project dependencies from deepface.modules.database.types import Database from deepface.modules.modeling import build_model from deepface.commons.logger import Logger logger = L...
9c2793f8b3758684c1cf6be8100ce1612d005839c34ed6925eda8ced6d1771bb
Python
9,859
316
# -*- coding: utf-8 -*- # (C) Copyright 2026 IBM. All Rights Reserved. # # Licensed under the MIT license. See LICENSE file in the project root for details. """aihwkit example 18: resnet32 CNN with CIFAR10. CIFAR10 dataset on a resnet inspired network based on the paper: https://arxiv.org/abs/1512.03385 """ # pylint...
2104b8f9d95d327fee55bfff1706a52ca40e94fa430fbb857ec6cbfe03424d7d
Python
9,864
223
#!/usr/bin/env python # Import required modules from __future__ import print_function from future import standard_library standard_library.install_aliases() from builtins import str import os import argparse import subprocess import ICA_AROMA_functions as aromafunc import shutil # Change to script directory cwd = os....
aa23d4cab8cba7c2e49c1190740c42501ddbd1803a83642e5b4df045b6085ae9
Python
9,864
247
""" class for handling manual settings *** built as part of the Russell Ray Lab Breathing And Physiology Analysis Pipeline *** Breathe Easy - an automated waveform analysis pipeline Copyright (C) 2022 Savannah Lusk, Andersen Chang, Avery Twitchell-Heyne, Shaun Fattig, Christopher Scott Ward, Russell Ray. This prog...
d2dbb0ad89ea01ded4c64ccf03a0d4121a483511778682004a80a6a8fe09c62f
Python
9,868
260
# ML4H is released under the following BSD 3-Clause License: # # Copyright (c) 2020, Broad Institute, Inc. and The General Hospital Corporation. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # #...
f97c6df0e87bd486cea91f1291b6617e612eb17cff42d535694332279734c5d2
Python
9,868
288
import os import signal import time import shutil import numpy as np import keras from keras.callbacks import EarlyStopping, ModelCheckpoint from nets import get_network # force data format to "channels first" keras.backend.set_image_data_format('channels_first') def transform(Xb, yb): """ handle class for o...
88d272a51368d0e7c25f1f227474d707334bc9ce19a959b41df4d8ddc6e4297c
Python
9,871
310
# -*- coding: utf-8 -*- # (C) Copyright 2026 IBM. All Rights Reserved. # # Licensed under the MIT license. See LICENSE file in the project root for details. """aihwkit example 4: analog CNN. Mnist dataset on a LeNet5 inspired network based on the paper: https://www.frontiersin.org/articles/10.3389/fnins.2017.00538/f...
9c96accaa373dd43e193eb26a211aaec509708cfa11da2a55717f4e9b4acf3aa
Python
9,884
265
""" Copyright (c) Meta Platforms, Inc. and affiliates. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. """ from __future__ import annotations import math import torch from e3nn.o3 import FromS2Grid, ToS2Grid class CoefficientMapping(torch.nn....
1d55dac539e260e686c80a1bfbb07701bafde45769cfc7490d71f9f83a3d1cb4
Python
9,886
268
import torch import numpy as np from .. import nn # from ..nn import ImagingModelWrapper from .net_resnet3d import r3d_18 from typing import Any, Type import math Tensor = Type[torch.Tensor] from icecream import ic ic.disable() class Transformer(torch.nn.Module): ''' ... ''' def __init__(self, src_moda...
98f8dc99c0e19bdd057da4cafd3b19dafd3c596085198b065b1f1a6b968b9f13
Python
9,886
312
#################################################################################################### # Copyright (c) 2016 - 2024, EPFL / Blue Brain Project # Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch> # # This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis> # # This program is fre...
95f1df393c7b027517085ced5f935dd827e0d064f2c1a13450581a264120c9af
Python
9,890
256
from sklearn.metrics.pairwise import cosine_distances, euclidean_distances from sklearn.preprocessing import normalize from sklearn.neighbors import NearestNeighbors import numpy as np import time # import faiss # from bonsai.bonsai_helpers import time_format # from icecream import ic # ic.configureOutput(prefix=time_...
daa46afcb1da07cc091bdde8617ec3688e4cce23dcf02c34b3a35b8540f4d463
Python
9,890
258
""" Main script for Segmentation Analysis of HRTEM images Run this script to run the automated nanoparticle transmission electron micrograph analyzer (ANTEMA) Copyright (C) 2022 University of Duisburg-Essen This program is free software: you can redistribute it and/or modify it under the terms...
0952370e0433926ab7a4afcec6189dab6658ecacdbf8adbdfbbd85f045441fe9
Python
9,895
261
import os import scipy.io import numpy as np #from tensorflow.keras.models import Model from tensorflow.keras.layers import (Dense, Activation, Permute, Dropout, Conv2D, MaxPooling2D, AveragePooling2D, SeparableConv2D, DepthwiseConv2D, BatchNormali...
acafe39b355d7e44181f1f2e05d91990c724e3e1bd6dacdfbb97439bacf95d0e
Python
9,897
231
from typing import Callable, Union from torch_pgn.models.dimenet_utils import * from torch_pgn.args import TrainArgs import torch from torch_geometric.utils.scatter import scatter from torch_geometric.typing import SparseTensor from torch_geometric.nn.resolver import activation_resolver class DimeNet(torch.nn.Modu...
7cea94c00a150e259ed28b4d2e31bedd12a7437e43e030892bbe736a802f62b9
Python
9,898
270
# # CEBRA: Consistent EmBeddings of high-dimensional Recordings using Auxiliary variables # © Mackenzie W. Mathis & Steffen Schneider (v0.4.0+) # Source code: # https://github.com/AdaptiveMotorControlLab/CEBRA # # Please see LICENSE.md for the full license document: # https://github.com/AdaptiveMotorControlLab/CEBRA/bl...
d66aa28c8a5f176d6dd5ce9bbe854bae15ebe8cd80a5c959d5f757c5e37253c1
Python
9,900
307
import pandas as pd from pathlib import Path import zarr import numpy as np from scipy.sparse import coo_matrix, spmatrix from scipy import stats import statsmodels.api as sm import pickle from deeprvat.data import DenseGTDataset import sys import os import logging logging.basicConfig( format="[%(asctime)s] %(le...
e10d8e462764e06efccbc8f3070e5aa9182db47a0bd92ca931fdd7e832427735
Python
9,904
204
""" This script is used to threshold images with different methods and save the thresholded images. The thresholded images are used to create the masks for the segmentation and naively analyse the data. This makes it easier to preprocess whole folders with the same technique instead of having to use ImageJ. (c) 2024, M...
4c6fc70ab9d4b9a88233124d47ba7f84430fddf6e13115fa708b9aa11abcb8d8
Python
9,909
287
import os import argparse import time from datetime import datetime, date import random import numpy as np from scipy.sparse import load_npz from sklearn.metrics import roc_auc_score, f1_score, precision_recall_curve, auc from scipy.stats import pearsonr import pandas as pd import torch import torch_geom...
582b840cb1707b23bf25e8174c9d7e09064b41bc3e7733a10073f3726c7dab3a
Python
9,915
279
# Copyright (c) 2017-present, Facebook, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
3017677ac9a1f621202d8c4cee7850eb5c560f3c467773af0acd967c16f86eaa
Python
9,923
292
# Copyright 2023 Google LLC # 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 # https://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, sof...
bb362fb46a275db9eda1316f96c0314460f77b6c6e1e4791ba0e32e5debad99c
Python
9,930
250
import logging import json from agent.data.entities.config import BACKUPS_PATH, ROOT_LOGGER_ID from agent.data.sql.sql_mgmt import get_connection, execute_query, execute_read_query, select_fields_where logger = logging.getLogger(ROOT_LOGGER_ID) def insert_crawled_item_instance(connection, item, crawl_date, review_l...
6703b02e9946c70655103e034a42500f60384bc74564689a66e173dc259f8f32
Python
9,931
306
""" Copyright (c) Meta Platforms, Inc. and affiliates. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. """ from __future__ import annotations import logging import warnings from abc import ABC, abstractmethod from typing import TYPE_CHECKING, An...
727210b8982051e2a3f11846c035724c390d69bb14d7341518e81ecda3ddbdc1
Python
9,933
211
#!/usr/bin/env python # srnaLaunch.py 0.0.1 import argparse,os, sys, json import dxpy from launch import Launch #from template import Launch # (does not use dxencode at all) class SrnaLaunch(Launch): '''Descendent from Launch class with 'small-rna-seq' methods''' PIPELINE_NAME = "small-rna-seq" ''' This...
25a923496bf44440df654d9523db3a5261dfd0be549187a2f29263a8c541bd56
Python
9,939
214
import argparse import pickle from typing import List import numpy as np import torch import lib.data_utils.data_util as du import lib.data_utils.dynamic_data_util as ddu import lib.dataset_config_parser.dataset_config_parser as dcp from denoise_inverse_alg.glm_inverse_alg import reinflate_cropped_glm_model, reinflat...
5abe9903581de695731afec009a9392188b54f458844ff1fd8fc99548a399bf8
Python
9,939
248
import nengo import numpy as np import nir class IF(nengo.SpikingRectifiedLinear): def step(self, dt, J, output, voltage): voltage += J * dt output[:] = (self.amplitude / dt) * np.where(voltage > 1, 1, 0) voltage[output > 0] = 0 def nir_to_nengo(n, dt=0.001): nengo_map = {} pre_m...
9145063c44a4e5f667923daf765d18109a842fb4bf51100584f0a57b4f095acc
Python
9,941
333
from sim_evaulation_functions import collect_all_results, get_maf_filter_var_explained import sys import os import logging import math import itertools import pickle import pandas as pd import numpy as np import yaml logging.basicConfig( format="[%(asctime)s] %(levelname)s:%(name)s: %(message)s", level="INFO",...
7097c671a8fdacbf58855848b49bfec6ec18b2f7ab6825c55509bf5e0fe23131
Python
9,947
330
# encoding: utf-8 """ This module implements Git's wildmatch pattern matching which itself is derived from Rsync's wildmatch. Git uses wildmatch for its ".gitignore" files. """ from __future__ import unicode_literals import re import warnings from .. import util from ..compat import unicode from ..pattern import Rege...
b13e576d9337a673ff09c74f4e9d52b202682148ff46f41d0afc89ef8a63a219
Python
9,949
247
import logging from typing import TYPE_CHECKING, Optional from .backpressure_policy import BackpressurePolicy from ray._common.utils import env_float from ray.data._internal.execution.resource_manager import ( _BLOCKING_MATERIALIZING_OPERATORS, ResourceManager, ) from ray.data.context import DataContext if TY...
27c6a95f1df0c70ee09db5cd31677daa0939c2f7e04f7f2b7d1a792145c81834
Python
9,951
225
# -*- coding: utf-8 -*- # (C) Copyright 2020, 2021, 2022, 2023, 2024 IBM. All Rights Reserved. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. #...
b921bbd156d7d78130e180368b3d8f35f42a2c1be829232239fb2677759b2b78
Python
9,951
218
""" ModNN, first-generation architecture (released as 1.0.1): LSTM envelope module that also sees the time of day, bounded internal-gain schedule, and an encoder that blends measured and predicted zone temperature to initialise the thermal state. Select it with args["architecture"] = "v1". Constraints available: "hvac"...
35b6c98b2e8e0909f55c76fb8d785671d98f56e6c693551ec602451691471930
Python
9,952
299
import torch.utils.model_zoo import time from src.model.mhnn import * from src.tools.utils import * from src.config.config_utils import * import argparse import logging logging.basicConfig(level=logging.INFO) log = logging.getLogger() setup_seed(0) parser = argparse.ArgumentParser(description='mhnn', argument_defau...
e1096e9bba6bc13196c2d86f9b57150f45fa02ef2bf676709fc2feac2b5477b9
Python
9,953
283
# built-in dependencies from typing import List, Tuple, Union, cast # 3rd party dependencies import torch from torch import nn, Tensor import torch.nn.functional as F # project dependencies from deepface.commons import weight_utils from deepface.models.facial_recognition.pytorch.TorchFacialRecognition import ( To...
82f8b91e3d7ef7b41d98d6b929ed90baec25aa21319cb8de90474f4c572e5d8b
Python
9,956
222
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import os import os.path import glob import json from jinja2 import Environment, FileSystemLoader, Undefined import logging # This script generates input files (for example JSON inputs to be passed to cromwell, but also # potentially tsv files for Terra im...
62aeaeb57fdd9e896cab31c920831c7816f2e3418b9632985d749408e506cd48
Python
9,958
244
import numpy as np import pandas as pd from scipy.interpolate import interp1d from lib5c.util.lowess import lowess from hic3defdr.util.printing import eprint def lowess_fit(x, y, logx=False, logy=False, left_boundary=None, right_boundary=None, frac=0.3, delta=0.01): """ Opinionated convenienc...
acc6f405c9adcbf694746f62b0d1b263c99d07f2ef7949554ab282eff8af406c
Python
9,958
271
"""Keep normalization, distance, threshold and confidence in the same space.""" from copy import deepcopy import numpy as np import pandas as pd import pytest from deepface.modules import datastore, verification class MemoryDatabase: """Deterministic storage boundary; real search/identify logic runs above it."...
b341fe6d061e2387ea1619e338c92d79ba91e93c7fe9078653c6ac6f5e82ecdd
Python
9,962
264
import re import nibabel as nib import numpy as np from lib.qc import QCResult from lib.qc_report import QCReport, fig_to_png from lib.qc_surface import ( COMPARE_METRICS, DEFAULT_THRESHOLDS, DEFECT_MAP_CAPTION, DEFECT_TYPES, STAGE_DESCS, STAGE_LABELS, defect_panel, defect_table, fa...
5ba3e5e21e40e17799d4faaedb798925e4ae4bc789337b3d20dc8ff1799aa143
Python
9,963
243
# -*- coding: utf-8 -*- # (C) Copyright 2026 IBM. All Rights Reserved. # # Licensed under the MIT license. See LICENSE file in the project root for details. """Tests for model conversions.""" from unittest import SkipTest from torch import Tensor, manual_seed, randn from torch.nn import Sequential, Linear, Conv2d, ...
4f4fa919cec162868c5f42fa260e90ef2aeab34001659afadb651fa6092abccc
Python
9,964
199
from typing import Union, List, Tuple from nnunetv2.configuration import ANISO_THRESHOLD from nnunetv2.experiment_planning.experiment_planners.default_experiment_planner import ExperimentPlanner from nnunetv2.experiment_planning.experiment_planners.residual_unets.residual_encoder_unet_planners import \ nnUNetPlann...
a8f716e8de67d874b93ebfbc713548d721398aa40c2c28a01fea01427f147d7e
Python
9,964
230
"""PyTorch implementation of R CellChat ``computeCommunProb`` (sc/snRNA-seq mode). For every LR pair ``i`` and sender/receiver groups ``(s, r)``:: avg = triMean of data.signaling / max(data.signaling) per group L, R = ligand / receptor expression (complex = geometric mean of subunits) R = ...
ba2b966363023b06d2e0a172a7d7c4f5d40b9dc32ebd512f4c146c2058a416a5
Python
9,968
297
# coding=utf-8 # Copyright 2023 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
f86578151ba7f81c86c0ab0a93fe1924f7ec9be5e775f1e6a8cf1dea0362ab05
Python
9,971
266
# -*- coding: utf-8 -*- # (C) Copyright 2020, 2021, 2022, 2023, 2024 IBM. All Rights Reserved. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. #...
329501ceffc6db9d7ab2942bca43b2f7bffc98a28964eac987a17e2700629df6
Python
9,972
319
import numpy as np import sys, tqdm import torch import torch.nn.functional as F from numpy import interp from collections.abc import Sequence from collections import defaultdict from sklearn.metrics import confusion_matrix, roc_curve, roc_auc_score, auc from sklearn.metrics import precision_recall_curve, average_preci...
d9f56807d28ffb3443e062c96411800865df58e30d1c66759a2b49e2e7861dfd
Python
9,977
156
import numpy as np #Numpy for numerical 'ala Matlab' computations import pymc as pm #pymc will be doing most of our heavy lifting for Bayesian calculations import matplotlib.pyplot as plt #This works as our plotting tool import arviz as az # arviz is a visualization packag...
e6264e430c01456999c537de240e952d000e90a3de142a6769cd51d8844ee3c4
Python
9,977
279
# Copyright 2023 The HuggingFace Team. 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 applicabl...
bd12c805d385aa9af45d0b6685332b118877de704c2888174b19afe2b3fb50ac
Python
9,985
198
import argparse from utils.utils import load_data, define_logger, tokenize_gen, evaluate_gpt2, gpt2_evaluate, compute_ppl import random import numpy as np import torch from model.generatively_model import gpt2_generate, bart_generate from transformers import AdamW, GPT2LMHeadModel import sys import torch.nn as nn impor...
6c21c4991798afbd35ec805cdb58e24ea5683c9546360b475614ec615d7b3e46
Python
9,986
335
# flake8: noqa # fmt: off from typing import List # __textbot_setup_start__ import asyncio import logging from queue import Empty from fastapi import FastAPI from starlette.responses import StreamingResponse from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer from ray import serve lo...
496adc5b9bf9a6d9b75e4a52d02fe618c1600ab17fd3fbe35baa90f89b5bd299
Python
9,988
148
#------------------------------------------------------------------------------------------------------------------------------------- # Author: Brandon S Coventry Wisconsin Institute for Translational Neuroengineering # Date: 08-17-2022 # Purpose: This calculates a simple linear regression (Bayesian Formulation...
a18165977494d39175c49d36a01178b58facbb80f47e788a14eea0cf23c10f90
Python
9,989
301
# -*- coding: utf-8 -*- # (C) Copyright 2026 IBM. All Rights Reserved. # # Licensed under the MIT license. See LICENSE file in the project root for details. """Digital/analog model conversion utilities. This module includes tools for converting a given torch model to a model containing analog layers. """ from typin...
8ca9d8eab09fa57240095a0b13c0dcb236a6bf22942d6ee75c80006f77dce606
Python
9,991
356
"""Helper functions for quick command line interfaces with skorch and fire. """ from functools import partial from importlib import import_module from itertools import chain import re import shlex import sys from sklearn.base import BaseEstimator from sklearn.pipeline import FeatureUnion from sklearn.pipeline import...
f043545f7e8efbcde17a3e55550f2b1385a588857e6f6e14650c0c7cf9306814
Python
9,991
272
import dataclasses from dataclasses import asdict, fields from typing import Awaitable, Callable, List, Tuple import aiohttp.web from ray.dashboard.optional_utils import rest_response from ray.dashboard.runtime_env_redaction import ( redact_state_rows, should_redact_runtime_env, ) from ray.dashboard.utils imp...
753e4d62bfc9e1bf9382abfaaf1030a566b1abaae8b489a5adfaf0e28588559d
Python
9,993
299
# coding=utf-8 # Copyright 2023 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
fe993595d32e0a8b6be7f78b34da7040926b5c2c6131b208489d7605f3490815
Python
9,995
261
import json import logging import pathlib import random import string import threading from datetime import datetime from enum import Enum from typing import Union from ray._private import ray_constants from ray._private.protobuf_compat import message_to_dict from ray.core.generated.export_dataset_metadata_pb2 import ...
37f855886dd8297a9fad8f5a200b8ff45d50eb18efa2a13cf9758a0ee8552588
Python
9,996
285
from abc import ABC, abstractmethod from dataclasses import dataclass, field from typing import List, Optional from ray import ObjectRef from ray.actor import ActorHandle from ray.data._internal.execution.interfaces.common import NodeIdStr from ray.data._internal.execution.interfaces.execution_options import Execution...
a03011887fa5eea0fa4dbf4d78e2969a7d9bb1aff8e42d3b22440e758dae18c7
Python
9,998
289
""" Do clustering analysis """ import warnings warnings.filterwarnings('ignore') import pandas as pd import numpy as np import copy import pickle as pkl import os import matplotlib.pyplot as plt import seaborn as sns from sklearn import mixture from sklearn import cluster from sklearn.manifold import TSNE import ...
f97b4ff34d6e56b6a052505ffba3e347950763a0747dccb5a5483433a42540aa
Python
9,999
316
import math import os from itertools import groupby from multiprocessing import Process from typing import Dict, List, Tuple import numpy as np import samna import samnagui import torch from .utils import parse_device_id, standardize_device_id # A map of all device types and their corresponding samna `device_name` d...
caf5b2ba2248863cd0bbf9b81eb56a8d491d5f592713246c5a69cfafa40cfbbd
Python
10,002
164
#################################################################################################### # Copyright (c) 2016 - 2024, EPFL / Blue Brain Project # Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch> # # This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis> # # This program is fre...
fe3927cbfc5463abf2dfefd590b8b628a7f3be11c9a079a6bd0de70d5241dae6
Python
10,004
630
"""Groundtruth data structures for fly visual system cell types. This module contains various dictionaries and lists that represent groundtruth information from literature about different cell types in the fly visual system. The data includes polarity, pathway classification, layout, direction selectivity, and other p...
e39f8ee1c2d28d1d27a2939990bcc5f1edc726654ac913eeb7e314d2ca1cd6ae
Python
10,005
288
# # CEBRA: Consistent EmBeddings of high-dimensional Recordings using Auxiliary variables # © Mackenzie W. Mathis & Steffen Schneider (v0.4.0+) # Source code: # https://github.com/AdaptiveMotorControlLab/CEBRA # # Please see LICENSE.md for the full license document: # https://github.com/AdaptiveMotorControlLab/CEBRA/bl...
3d43ca9e9beef86b7a4cf86041ac2e5caaaf98003233eabaf787d406bed4c2e7
Python
10,006
248
import requests from .__config import base_url from .__aux_funcs import process_response def get_muts_in_mol_prof_by_sample_list_id(molecular_profile_id, sample_list_id, entrez_gene_id=None, projection="SUMMARY", direction="ASC", pageNumber=0, pageSize=10000000, sortBy=None)...
3f5cc9b02a9b6afc1d20467683a8ec067699f4ed7a941510b1b488cd17660a52
Python
10,009
247
#!/usr/bin/env python """ Complete demo pipeline for motion correction, source extraction, and deconvolution of two-photon calcium imaging data using the CaImAn package. Demo is also available as a jupyter notebook (see demo_pipeline.ipynb) Dataset couresy of Sue Ann Koay and David Tank (Princeton University) This d...
fb4629e1b59381bb9c4c9ed58e367930bdc1759fd62701c48854f1950ad3461a
Python
10,012
281
import json import os from pathlib import Path from typing import Optional, Union import numpy as np import scanpy as sc import torch from anndata import AnnData from torch.utils.data import DataLoader, SequentialSampler from tqdm import tqdm from .. import logger from ..data_collator import DataCollator from ..model...
11013d6b6a5bfd2695fff6da285f3cdeb40952f923e94bd48e5d11da7e57c0ac
Python
10,014
260
# -*- coding: utf-8 -*- # (C) Copyright 2026 IBM. All Rights Reserved. # # Licensed under the MIT license. See LICENSE file in the project root for details. """Helper for generating presets.""" from typing import Union, Type, Callable, Any from copy import deepcopy from aihwkit.exceptions import ArgumentError from ...
d6733e0bdc6662f5be9a7264671b9f52bf1551ae017b09c00d2d6e0cebea52c0
Python
10,016
302
""" Analysis of responses to flash stimuli. Info: Relies on xarray dataset format defined in `flyvis.analysis.stimulus_responses`. """ from typing import List, Optional, Tuple import matplotlib.pyplot as plt import numpy as np import xarray as xr from flyvis.utils import groundtruth_utils, nodes_edges_utils fro...
849bd1bcdc77ca8610ce3c116ce449a76372ae5c21269f64cfe3bca4dce9e61b
Python
10,021
221
import multisensory as ms import matplotlib.pyplot as plt from matplotlib import cm import json import os import numpy as np from scipy.optimize import fsolve from collections import defaultdict plt.style.use('./style_sheet.mplstyle') def get_ideal_data_classical_comod(): fname = 'figdata/ideal_data_classical_com...
f465fa75a657fd7d5553a16e6712190f64d64e4e7a44c318e7f0c41561acf3e9
Python
10,021
268
#* # @file Different utility functions # Copyright (c) Zhewei Yao, Amir Gholami # All rights reserved. # This file is part of PyHessian library. # # PyHessian is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, ei...
b39f429fd02c99e680cda5f06cead95fa02c3d7befa9f9997463c9e27adf918d
Python
10,022
245
#################################################################################################### # Copyright (c) 2016 - 2024, EPFL / Blue Brain Project # Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch> # # This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis> # # This program is fre...
11032749123e88c654b960a02d3035e8ae3addeef96d6c4f371bcc16592b122e
Python
10,023
297
#################################################################################################### # Copyright (c) 2016 - 2024, EPFL / Blue Brain Project # Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch> # # This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis> # # This program is fre...
0bbd9a0de1262a56afe312791db450e2ef65c51b036adc45fab95c6bbccaeeac
Python
10,026
341
#!/usr/local/bin/python """ *********************************************** - PROGRAM: smoothMatrix.py - CONTACT: Bryan lajoie (bryan.lajoie@umassmed.edu) *********************************************** """ from __future__ import print_function import argparse import logging import os.path import sys import gzip impo...
4db468efc7bba9d0c776cc3b28f5c3998f7b4e85a29405af02758477c4c2ed2b
Python
10,030
223
"""Test utils""" import unittest import pandas as pd from rdkit import Chem from rdkit.Chem.EnumerateStereoisomers import EnumerateStereoisomers from lefshift import utils from lefshift.fp import LEFFingerprint class UtilsTests(unittest.TestCase): """Test utils""" def test_smiles_nof_unique_fingerprints(se...
972ba2343013054071fe0d815ded53f5335f3aa2e0e38e1da12a9cbe1ed6c322
Python
10,031
278
# -*- coding: utf-8 -*- # (C) Copyright 2026 IBM. All Rights Reserved. # # Licensed under the MIT license. See LICENSE file in the project root for details. """Utilities for resistive processing units configurations.""" from sys import version_info from typing import Any, List, Optional, Type from dataclasses import ...
df1dbdae3921f447a06edc22213f2733ed01d6f838aa663205dacc5e1301b318
Python
10,035
238
# camera-ready # NOTE! OS: output stride, the ratio of input image resolution to final output resolution (OS16: output size is (img_h/16, img_w/16)) (OS8: output size is (img_h/8, img_w/8)) import torch import torch.nn as nn import torch.nn.functional as F import torchvision.models as models def make_layer(block, in...
f93b6085982d6b4c2b8ed78f63b526b98326b6141eeb19505c3f19cb6b9cb975
Python
10,035
281
""" Copyright (c) Meta Platforms, Inc. and affiliates. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. """ """ Driver script to evaluate the performance of ML models on predicting experimental products for HER and CO2RR in the OCx24 dataset. """ ...
403e5d2938109862e33fc7c8cffbe55c5a527a6f19faafbdcd379ba9df712737
Python
10,036
294
from collections import defaultdict, deque from copy import deepcopy from typing import TYPE_CHECKING, List, Optional, Set, Tuple, TypeVar, Union import torch import torch.nn as nn import warnings import sinabs.layers as sl from .crop2d import Crop2d from .dvs_layer import DVSLayer from .exceptions import InputConfi...
f8c6c0358a3e6678dce41f569b283dd8d0ca330c0f4a532bd4aa623d9e496f43
Python
10,036
216
import numpy as np import pandas as pd from scipy.sparse import csr_matrix def compute_weighted_average_around_target( adata, target_cell_type_quantile: float = 0.995, source_cell_type_quantile: float = 0.95, normalisation_quantile: float = 0.95, distance_bin: list = None, sample_key: str = "s...
05966e8af10bbe1d9407a85a644af1e0db1834b8a28088c5e7b4cac45fb17e2d
Python
10,037
293
# -*- coding: utf-8 -*- # (C) Copyright 2026 IBM. All Rights Reserved. # # Licensed under the MIT license. See LICENSE file in the project root for details. # pylint: disable=no-name-in-module, import-error, too-few-public-methods """Mappings for version 1 of the AIHW Composer format.""" from collections import nam...
bae6c79ab045d132e9e2de3c2bfe175f7f97a465d013c5fecbd8eca54158b843
Python
10,042
313
# -*- coding: utf-8 -*- # (C) Copyright 2020, 2021, 2022, 2023, 2024 IBM. All Rights Reserved. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. #...
4db4a4b906081835f496337716ca2aa31dc1a53237cd4cf693aecc201c1e2728
Python
10,044
254
#################################################################################################### # Copyright (c) 2016 - 2024, EPFL / Blue Brain Project # Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch> # # This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis> # # This program is fre...
5b24a69e0c2739ad8ccb64594a7f2f486f1d3c792bd87e30159aea0d8c0ee566
Python
10,047
256
# Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software...
7a2ed5fa0859aece70105717b0673d079a3edd6ef746d0200ba1e33e99bb72a2
Python
10,047
294
import torch.nn as nn import math import torch.utils.model_zoo as model_zoo import torch def conv3x3(in_planes, out_planes, stride=1): """3x3 convolution with padding""" return nn.Conv1d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=False) def conv5x5(in...
835f9d25c0ba47cfff3a2a3c63171b7cd789bdc61aaf103770833d27f28b2fae
Python
10,047
289
#################################################################################################### # Copyright (c) 2016 - 2024, EPFL / Blue Brain Project # Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch> # # This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis> # # This program is fre...
27aea0806b13a45605faebf8f04e09aaf239fb0b9bd10695c3ea7b3dd631855f
Python
10,049
255
#################################################################################################### # Copyright (c) 2016 - 2024, EPFL / Blue Brain Project # Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch> # # This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis> # # This program is fre...
8d80d1ba2238108be9fcc82cd1c97cb293e0b27ceb0c6838ed23261ef1552513
Python
10,050
254
import exputils as eu import numpy as np import plotly.subplots def plotly_meanstd_bar(data=None, config=None, **kwargs): """ param repetition_ids: Either scalar int with single id, list with several that are used for each experiment, or a dict with repetition ids per experiment. """ default_config = ...
9fb624ea264d76845d49264e6efd1b2cb705534fdda61f7dffec1ac42ef88819
Python
10,052
304
# built-in dependencies import os import json import hashlib import struct import math from typing import Any, Dict, Optional, List, Union # project dependencies from deepface.modules.database.types import Database from deepface.modules.modeling import build_model from deepface.commons.logger import Logger logger = L...
93d11d5c830513d7369dffb5a8d7b31a7db1864a449490edc37d77c2566424c4
Python
10,061
273
# Copyright 2023 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
e54e9c5448b6ff95bd1c9302d73d2f4ff3a8f85fa25b85fe32b24696d84a8274
Python
10,062
251
# -*- coding: utf-8 -*- # @Time :2024/6/6 14:56 # @Author :MENGLong Li # @File :MachineLearning.py # @Software:PyCharm import numpy as np import matplotlib.pyplot as plt from sklearn.preprocessing import StandardScaler from sklearn.model_selection import train_test_split import tensorflow as tf from tensorflow....
060f1f46259d3c94feeb28e8d99f7aba2b4d816f7b28d289d736336db9273c82
Python
10,063
269
import math import warnings from functools import partial import torch import torch.nn as nn def softmax(x, dim, inplace=False): if inplace: torch.exp(x, out=x) else: x = torch.exp(x) s = torch.sum(x, dim=dim, keepdim=True) x /= s return x def _no_grad_trunc_normal_(tensor, mean,...
a52a919d225533ae628648b4f58ec7db6302cbbb5b4896a766bc12378d777c1f
Python
10,063
246
""" Top-level functions. """ import pandas as pd from distributed import Client, LocalCluster from arboreto.core import create_graph, SGBM_KWARGS, RF_KWARGS, EARLY_STOP_WINDOW_LENGTH def grnboost2(expression_data, gene_names=None, tf_names='all', client_or_address='local', ...
8685748a32158344ee8541f3686e2bea70098a20067068501681229ed8e5aa6c
Python
10,064
291
import logging import math import pickle from pathlib import Path import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns import torch import datasets from datasets.utils.logging import disable_progress_bar, enable_progress_bar from sklearn import preprocessing from sklearn.metrics...
a9ba09100f8faf79d3a06914b95d3a5eeda4bdee0daa29d38662469a8dc1822e
Python
10,066
233
import numpy as np from spinnaker2.neuron_models.application import BaseApplication from spinnaker2.mapper import SynapseWordSize, SynapseWordSpec from spinnaker2.configuration import PEConfig, MemoryRegion from spinnaker2.neuron_models.common import (add_log_memory_region, collect_routing_targets, format_rout...
c63da3196cb7b505633c4d87937aa991011e4355a390bc59f28ab75ef6569825
Python
10,067
247
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Constrained Nonnegative Matrix Factorization A similar CNMF class that will output data that are not usually present in the regular CNMF process Created on Fri Aug 26 15:44:32 2016 @author: agiovann """ from builtins import str from builtins import object from pa...
78c7d031a49bf00e483833c026aed940771bd8030c9027bb78e7d1848751de4c
Python
10,070
301
# Copyright 2023 Google LLC # 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 # https://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, sof...
91a087e34f3f675eb976dbd38f9dcd34af3232afdbc213080b91593a0f42ff7a
Python
10,070
292
"""Exceptions for SiaPy library. This module defines custom exceptions used throughout the SiaPy library to handle errors related to file handling, input validation, processing, and configuration. """ from pathlib import Path from typing import Any __all__ = [ "SiapyError", "InvalidFilepathError", "Inva...
f9fac9cd89796e78690dbf8dab89a42a94323d0a54802865d9a0c7c0b73ae114
Python
10,072
218
import os import sys import argparse import ast import cv2 import time import torch from vidgear.gears import CamGear import numpy as np sys.path.insert(1, os.getcwd()) from SimpleHRNet import SimpleHRNet from misc.visualization import draw_points, draw_skeleton, draw_points_and_skeleton, joints_dict, check_video_rota...
b19dece69b13bf9f54b43a828255de8cf7d3f02fe5298a485684bc4acb7a1793
Python
10,073
264
import torch import torch.nn as nn import torch.utils.data as torch_data import torch.optim as optim from torch.utils.tensorboard import SummaryWriter import numpy as np import matplotlib.pyplot as plt from typing import Callable, Tuple import os class Neurips2017_Encoder(nn.Module): ''' Benchmark for the H...
091a7ba200bb518504aaf220319f2756ed038ffddcafc9aa1a05edac5a10386c
Python
10,084
326
""" This module contains utilities for running snap_polygons directly from the Allen Institute's internal Laboratory Information Management System. Example Usage ------------- python -m neuron_morphology.snap_polygons --host <lims host> --port <lims port> --user <username> --password <password> ...