sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
e6ffdc7041af499123e2f5c18116b16e3e2d12531bf39e02670d6becb8e94a6b
Python
28,451
800
# Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT import os.path as osp from abc import abstractmethod from dataclasses import asdict as dataclass_asdict from dataclasses import dataclass from datetime import datetime from pathlib import Path from tempfile import NamedTemporaryFile from urllib.parse...
2dde056fd6f5d1cd5ef92eea223088e180c62280c6dffe09d8ff21504d99e00c
Python
28,456
817
import json from collections import Counter from collections.abc import Generator, Iterator, Sequence from copy import copy from dataclasses import dataclass from typing import TYPE_CHECKING, Any, Union import torch import torch.nn.functional as F from aislib.misc_utils import ensure_path_exists from torch.utils.data ...
566641cba63d786a3aa2edfd275cb81d5b8aab2dcd7fb3153572c41695393212
Python
28,465
648
# -*- coding: utf-8 -*- """ Created on Sat Jun 29 00:23:18 2024 @author: aka2333 """ #%% %reload_ext autoreload %autoreload 2 from itertools import permutations, product import time import warnings warnings.simplefilter(action='ignore', category=FutureWarning) import numpy as np import pandas as pd ...
25956add5e2af0a2d95827e0698950052b7e42c161fbfb28c3533715f68ac12d
Python
28,466
847
from __future__ import annotations import asyncio from collections.abc import Callable from typing import TYPE_CHECKING, Any, get_type_hints try: import ipywidgets from ipywidgets import widgets as ipywdg except ImportError as e: raise ImportError( "magicgui requires ipywidgets to be installed to ...
de7055d6dc8307168dd183033ca2ed8785ee8092aece020f04321ff061ab0f24
Python
28,478
735
""" Defines the controller UI """ import typing import asyncio import datetime import functools from ..qt import * import numpy from ..util import MeteredUpdater from .task_context import TaskContext, TaskDescription from .util import remove_by_is from ..config import * from .tasks import DESCRIPTIONS as TASK_DES...
fee0ddee08fb83f460abbd09c2b541abea89aa267b53850bd00805feca17e515
Python
28,490
731
#!/usr/bin/env python3 """ This is to prepare the processed SSC samples for SFARI long-read sequencing data deposition. Currently only supports PacBio + Nanopore data Usage: sfari_data_deposit.py --sample 11918_s1:SSC --proj_dir --ont_dtype fast5 Author: Mei Wu https://github.com/projectoriented """ import sys if sys....
a56656a09c718d20a704c369ec0785cf654c2665992fff1a5626f15bed14c885
Python
28,494
997
# -*- coding: utf-8 -*- """Mesh utilities.""" import datetime import functools import itertools import os from shutil import copyfile import nibabel as nb import numpy as np from nibabel.freesurfer.io import ( read_geometry, read_label, write_geometry, write_morph_data, ) from numpy.linalg import norm...
98d49a01e14c699353c20b38f66a57244f89a3373c5b872d6ae62e73cdeab137
Python
28,532
851
import torch from typing import Optional, Union, Dict, List, Any, Callable from .scatter import scatter, scatter_softmax from torch_geometric.nn.inits import glorot from mlcg.nn import MLP from mlcg.nn._module_init import init_xavier_uniform from mlcg.nn.painn import PaiNNInteraction, PaiNNMixing from mlcg.nn.so3krate...
2899392924112b9cca152aafdb20c7afbec1d047a47bcc2401ee4a44ec5fb5d2
Python
28,552
753
#Lucas Sancéré - import json import os import matplotlib.pyplot as plt import numpy as np import pandas as pd import plotnine import seaborn as sns import yaml from attrdictionary import AttrDict as attributedict from plotnine import ( aes, geom_density, ggplot, labs, scale_color_manual, scale...
6c04104bbcb84ecfe2c6619f9213abaf9291c13d57443492f85c7645cb4795a1
Python
28,578
712
from infopath.session_stitching import build_network from models.pop_rsnn import PopRSNN from datasets.prepare_input import InputSpikes import numpy as np import torch.nn as nn import torch from infopath.utils.logger import optimizer_to, reload_weights import os import copy from geomloss import SamplesLoss from infopat...
089095eb02bb066611008fad13dfba14ff971f61f7aad9e29ef6c83a255d9470
Python
28,591
790
""" Copyright 1999 Illinois Institute of Technology Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publi...
dccd53bea645b379d500adfd1a9ca5031d00d4ee52a13d8fbbe8e3ee74df3f6c
Python
28,592
807
import glob import pickle import numpy as np import pandas as pd from os import path from nilearn._utils.niimg_conversions import check_niimg from nilearn.glm.first_level import FirstLevelModel, make_first_level_design_matrix from nilearn.image import get_data from nipype.interfaces.base import ( BaseInterface, ...
d3de9cc0aa0c1f2c0b17c28ea35d1ae971ae7b56f1b7a5c2e3513e5b45e5efaa
Python
28,622
593
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """ Run prediction on images, videos, directories, globs, YouTube, webcam, streams, etc. Usage - sources: $ yolo predict model=yolo26n.pt source=0 # webcam img.jpg ...
5f30235eff63ca4e842f69e90fa8829c1d365483527ed80f83cf6974e0aee127
Python
28,640
703
""" Unified Feature Extraction Script - For Research Reproducibility This script extracts feature vectors from three different data sources: 1. Binder Features: Extract 65-dimensional features for matched ImageNet classes from CSV 2. Concept Vectors: Extract concept vectors from multiple .pt files (30 trails, 20-dim v...
0dfe2e978e8238a3e587be614d0215f8f83c4b8f8b56031b4009a271ceacb678
Python
28,641
625
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license from __future__ import annotations import os from pathlib import Path from typing import Any import numpy as np import torch import torch.distributed as dist from ultralytics.data import build_dataloader, build_yolo_dataset, converter from ultralyt...
91dd91c763be297c00980c5972aaec9ce31b8a1036fa786170e3cf8ae62af643
Python
28,649
641
import torch # from torch.optim.lr_scheduler import StepLR from .dataset import SpatialOmicsImageDataset from .net import SparseNet_Grand,SparseNet from ..visualization.visualization import vis_scatter_label from sklearn.metrics import adjusted_mutual_info_score import os import numpy import datetime import csv from tq...
0e1ece4fbc46a60495108db4b30fa275f2bae0aee64882489a09ae91583a874c
Python
28,650
885
import numpy as np import numexpr as ne from nems.registry import layer from nems.distributions import Normal from .base import Layer, Phi, Parameter from .tools import require_shape, pop_shape from nems.preprocessing.normalization import log_compress class StaticNonlinearity(Layer): """Apply a nonlinear transfor...
0091f91bd6c28f43731d9363962070bd423283d35d54d0afac6aae8e0d6e503d
Python
28,745
607
import copy import numpy as np # 3x3x1 grid of fODF taken from the outside of the backwards 'C' # in the FiberCup. Order 8, descoteaux07 basis. fodf_3x3_order8_descoteaux07 = np.asarray([[[ [0.26286387, -0.336828, -0.00369634, -0.25474626, -0.01061569, 0.29750797, 0.03732642, 0.01171304, 0.16143565, 0.0...
daa596dd1befa3e27a0c636f5d9696edae11cc8beef288a1bc2357d6b7108f4d
Python
28,757
942
import numpy as np import matplotlib.pyplot as plt from scipy.optimize import curve_fit import pandas as pd from mpl_toolkits.axes_grid1.inset_locator import inset_axes from sklearn.metrics import auc, r2_score from scipy import stats from scipy.odr import Model, Data, ODR def AIF_fit( t, AIFm, RETURN_FIT...
a2b09197e582b7ce8db6590b5508a90953f243dde1f00dd11237968caf59ca39
Python
28,763
704
""" Copyright 1999 Illinois Institute of Technology Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publis...
e3b7033d49832a640a61c1db8dfcedd38d80183623ceaf63c8f9e2838189b3fa
Python
28,769
648
# Copyright (c) Meta Platforms, Inc. and affiliates. All Rights Reserved """Postprocessors class to transform MDETR output according to the downstream task""" import dataclasses import logging from collections import defaultdict from typing import Dict, List, Optional import numpy as np import torch from sam3.model ...
1c24948fcd529f2ea36f2ad5f0a186bb22475d363598efbf8fc4c31f905bd9e8
Python
28,780
660
""" Elastix registration plugin for Lasagna Rob Campbell """ import os import shutil import subprocess # To run the elastix binary import tempfile from PyQt5 import QtGui, QtCore, QtWidgets from lasagna.plugins.lasagna_plugin import LasagnaPlugin from lasagna.plugins.registration_plugins import elastix_plugin_UI...
1b31f8a3c6fb5c18d65dd5e769667a3aee9e5055dd706d9ed3a9d15da38234e1
Python
28,799
744
import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec from dipy.core.gradients import gradient_table from dipy.core.sphere import disperse_charges, HemiSphere from dipy.reconst.dti import fractional_anisotropy, mean_diffusivity from beltrami import (fraction_init_s0, fraction_init...
425e289bbefa18eb07ad8c8c2a5a324a2587c679e130462c90a329d566d9cd8f
Python
28,808
743
""" Wrappers for the TORTOISE programs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ import logging import os import os.path as op import subprocess import nibabel as nb import nilearn.image as nim import numpy as np import pandas as pd from nipype.interfaces import ants from nipype.interfaces.base import ( BaseInterfac...
86c7e96ad49fbb47fdeb7610616a6f4e623aebb339a8cf63d2435169b7856c4b
Python
28,816
442
class W417(): """ A class to store molecular data and corresponding calculations for W417 dataset. Attributes ---------- molecules : list[str] List of molecule identifiers used in test calculations. exp_values : dict[str, float] Dictionary mapping test identifiers to their expe...
8ae1fbb2249afa6faac2e101e1eae323e2f23cb5525610f960a8157e02cd9c05
Python
28,833
692
import torch from torch import nn, einsum, broadcast_tensors import torch.nn.functional as F from einops import rearrange, repeat from einops.layers.torch import Rearrange # types from typing import Optional, List, Union # pytorch geometric try: import torch_geometric from torch_geometric.nn import MessageP...
6cf1b10ed16a1c7cb807b3c8cd348cb800b744cff75f36a855816ce59d6008fb
Python
28,852
921
# Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT import itertools import logging import os import shutil import unittest import unittest.mock from collections.abc import Callable, Collection, Generator, Iterator, Sequence from contextlib import contextmanager from copy import deepcopy from io impor...
aa3186dd0dd0e858c96eb6e83d4c63e37f899c5f06831cac48683d3b2b5ce8e4
Python
28,856
769
# encoding : utf-8 # IO module for reading data from CRCNS hc-11 # Author: Etienne Ackermann # Date: January 2019 """This file contains nelpy io functions for reading data from hc-11. See https://crcns.org/data-sets/hc/hc-11/about-hc-11. datatype = ['spikes', 'lfp', 'pos', 'waveforms', 'metadata'] """ # __all__ = ...
eb5603cd1cbb12cb7c59f4fe84e41ef124f522241247559d5df48f4b36f66581
Python
28,884
615
#!/usr/bin/python # ---------------------------------------------------------------------------------------- # A class to load, parse, and control predefined kilroy protocols, i.e. # collections of predefined valve or pump configurations and a defined # duration to wait before setting the next configuration. This class...
db39d6765a3c2f94092c2dde7ec554caa2ade0e24997e391bf553a8c59aa3de9
Python
28,886
555
############################################################################# # Copyright (C) 2020-2026 MEmilio # # Authors: Kathrin Rack, Wadim Koslow, Martin J. Kuehn, Annette Lutz # # Contact: Martin J. Kuehn <Martin.Kuehn@DLR.de> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use ...
e40aec6dddca29707da40e3f166510e509f7f9d9fa57d03ab6df908bf98815d2
Python
28,886
555
############################################################################# # Copyright (C) 2020-2026 MEmilio # # Authors: Kathrin Rack, Wadim Koslow, Martin J. Kuehn, Annette Lutz # # Contact: Martin J. Kuehn <Martin.Kuehn@DLR.de> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use ...
b06c529b8e03662fa33143d77725796f81435113e33fcdb90a3288d3b361cbf5
Python
28,916
803
"""Generator for 3d video images.""" import numpy as np import tensorflow.keras as keras import tensorflow as tf import os from tensorflow.keras.applications.vgg19 import preprocess_input as pp_vgg19 import imageio from dannce.engine import processing as processing import scipy.io as sio import warnings import time imp...
96db468a4b873c267018316b3d3fdf4a63939face228982e9978006a71edd439
Python
28,933
719
"""CLI configuration and error-handling regressions for Deep Agent.""" import io import os import select import subprocess import sys import time from types import SimpleNamespace import pytest import toml from rich.console import Console from chemgraph.agent.interrupts import PendingInterrupt from chemgraph.agent.l...
12d2bd7000cf105f651e51be45f1b172a0d644c8caca5c40f0c9ab12b396c24d
Python
28,936
537
import pathlib import time import numpy as np from mpl_toolkits.axes_grid1.anchored_artists import AnchoredSizeBar import matplotlib from matplotlib.collections import LineCollection import matplotlib.font_manager as fm matplotlib.use('Qt5Agg') import matplotlib.pyplot as plt from helper_functions.get_dendritic_curren...
21a8cab1ec642cf5bf34f4cf5c906891ed1ce56eaee3be8bed9b2e87768c66b0
Python
28,945
616
#!/usr/bin/python # ---------------------------------------------------------------------------------------- # A class to load, parse, and control predefined kilroy protocols, i.e. # collections of predefined valve or pump configurations and a defined # duration to wait before setting the next configuration. This class...
ec14862b49885ee048d076b20f4d33edb3d8188efd0fa3d1ea689a6f4716abe2
Python
28,973
590
import cv2 import numpy as np from qtpy.QtGui import QImage, QPixmap from napari_dmc_brainmap.registration.sharpy_track.sharpy_track.view.DotObject import DotObject from napari_dmc_brainmap.registration.sharpy_track.sharpy_track.model.calculation import fitGeoTrans from napari_dmc_brainmap.registration.sharpy_track.sha...
5c615b635a9580fe7ab63601751ff947bdcc632b9d72d2a573c5470a44a10251
Python
28,982
619
# Batch processing of cohorts with dmriprep # # A batch lives in its output directory: # <out>/batch/batch.yml settings (config directory, dmriprep command, version) # <out>/batch/manifest.tsv one row per dataset: id, images, output folder, protocol, overrides # <out>/batch/prot...
5db7fdf9db7dc8399ce51652eaa729098392200582f57cd5bb569b14cca89b84
Python
28,982
775
# encoding : utf-8 # IO module for reading data from CRCNS hc-18 # Author: Etienne Ackermann # Date: November 2018 """This file contains nelpy io functions for reading data from hc-18. The data set includes 5 sessions (i.e., 5 rats), each consisting of three travel sessions (passive, active, passive; 2~15 laps each) ...
25ce9663807ade92ecfe0a256d1a8e82adc2f388631a02ae1ce57f0e9819e71e
Python
29,012
664
import torch import pandas as pd import os import os.path as osp from datetime import date import shutil from tqdm import tqdm import numpy as np from ogb.io.read_graph_raw import read_binary_graph_raw, read_binary_heterograph_raw from ogb.utils.torch_util import all_numpy class DatasetSaver(object): ''' A...
8e4b805f16b6e8146d3bbe831187a72a2c20867234f8e680c2aed35aef7b7672
Python
29,031
631
import numpy as np import tensorflow as tf import pandas as pd from sklearn.preprocessing import LabelEncoder from sklearn.metrics import f1_score, accuracy_score, confusion_matrix from keras.utils import np_utils import matplotlib.pyplot as plt import scipy.stats as stats from sklearn.calibration import calibration_cu...
8d90c84b3f70b28fd55cb1faebec15cf43035b91f9afc132dafb956d77087325
Python
29,095
958
# laminar_rs/schaefer_stats.py """ Schaefer-400 / RSN-7 network statistics with spatial null models. This module provides: - Bookkeeping for Schaefer-400 parcels on fs_LR 32k - Safe parcel ↔ vertex mapping helpers - Network-wise ANOVAs (per layer) with spin nulls - Network × layer interaction tests with spin nulls - S...
2a1f8d212151c5ae256d69aa0461290c05e210747638b346246e21e42f82e0b5
Python
29,098
766
import pdb import numpy as np import numpy.fft as fft import time import os import json from matplotlib import pyplot as plt from scipy.signal import find_peaks, savgol_filter import pandas as pd from scipy import signal from pybaselines.polynomial import imodpoly, modpoly from scipy import integrate from json impo...
c128490aad1a9342cbdf1fad6d4c1dfc1bb63df48d296347b846de11a479aa01
Python
29,133
684
# Required libraries import matplotlib matplotlib.use('Agg') # Set globally for all matplotlib usage import os os.environ['PYTORCH_CUDA_ALLOC_CONF'] = "max_split_size_mb:100" os.environ['KMP_DUPLICATE_LIB_OK']="True" os.environ['CUDA_LAUNCH_BLOCKING']="1" import random import glob import time import matplo...
2436d1d42738f3dd2230690370dadf58380fdc10815a10a35b43d2059e0da4ac
Python
29,164
858
from __future__ import annotations import dataclasses as dc import sys import warnings from collections.abc import Callable from dataclasses import dataclass, field from functools import cache from types import FunctionType from typing import ( TYPE_CHECKING, Annotated, Any, Generic, Literal, T...
dfe986a3fdc706aa5f7d2a15aeadbb5735deeda0b521b92601373f1278eb36a1
Python
29,165
716
# -*- coding: utf-8 -*- """ Globe Shape Analysis Pipeline for 3D Slicer A modular, open-access tool for analyzing eyeball shape projections from template space to subject space. Features: - Orthogonal and polar projection analysis - Cross-platform path handling - Configurable via dataclass - Lazy Slicer integ...
12e310d93dc5f07db5e75a42cba3012b2a29133ef3d524cc0245de9a82bb92ae
Python
29,179
556
import sys from qtpy.QtWidgets import QPushButton, QWidget, QVBoxLayout from superqt import QCollapsible from napari.qt.threading import thread_worker from magicgui import magicgui from magicgui.widgets import FunctionGui import numpy as np import pandas as pd from natsort import natsorted from matplotlib.backends.b...
9d2300e012c7d554284aef6ef1f9386df4fcbf08a78ec6f4b762cfae0459b349
Python
29,193
652
# Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT from __future__ import annotations import ast import json import unittest from pathlib import Path from types import SimpleNamespace from unittest import mock import datumaro as dm import numpy as np from attrs import evolve from cvat.apps.dataset...
f84552541d9680a1c0ffbfb8c2a6210eae0400ddbae3f195371d7c2b1a255fb4
Python
29,208
960
from __future__ import annotations import base64 import json from pathlib import Path from typing import Final import numpy as np import PIL.Image import pytest from PySide6 import QtGui from PySide6.QtCore import QPoint from PySide6.QtCore import QPointF from PySide6.QtCore import Qt from pytestqt.qtbot import QtBot...
879bfae26435cc0ed76022f030308b468e722fe825f1a91690fc1b024aca5d58
Python
29,213
603
# -*- coding: utf-8 -*- import numpy as np import sys import os import datetime # In[] # Create ABAQUS inp files def create_inp(meshfilename, b_width_distribution, sx): # In[] #############Hyper Parameters############# L0 = 7.83 n_node1 = 541 n_element1 = n_node1 - 1 Bond...
8629e5488339da0901ffb0d98e9349bd4db201b4e00772a1a20542dc4ec9c4bc
Python
29,224
759
r""" Vis multi dataset and their connection """ import random import math from typing import List, Mapping, Optional, Union import scanpy as sc import numpy as np import pandas as pd from anndata import AnnData import matplotlib.pyplot as plt import plotly.graph_objects as go from .color import * def get_color(n=1...
9a9293f907f6d7290f1f9676a5820c0f5c4e35bf07c1f4858f0c2554d00ba14a
Python
29,224
1,006
""" Copyright 1999 Illinois Institute of Technology Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publis...
93b63c05a507463c320d8e659e833042223585600fc377f8f23b7583a879c14b
Python
29,232
688
import os import csv import glob from tqdm import tqdm from ogb import linkproppred import torch import torch.nn as tnn from torch.utils import data as torch_data from torchdrug import data, datasets, utils from torchdrug.core import Registry as R class InductiveKnowledgeGraphDataset(data.KnowledgeGraphDataset): ...
9c1543ceb8e017fb89f2d1ecdd0a568dd858a556c843ebbc45212bb9fc15ac75
Python
29,232
554
"""Spike detection settings. Thirteen settings, of which two decide what a run does: which thresholds, and which method's spikes feed steps 2-4. A third, above them, decides whether the nodes are electrodes or *sorted units* — spike sorting replaces the detectors when it is on (see :mod:`meanap.pipeline.spike_sorting`...
067f626887c4e0d5830d658ca82bc1799e1b216d528a5c7f3a5e423c90a589a4
Python
29,242
747
import copy import inspect import warnings from typing import Any, Dict, Optional, Tuple, Type, Union import torch from torch_geometric.data import Data, Dataset, HeteroData from torch_geometric.loader import DataLoader, LinkLoader, NodeLoader from torch_geometric.sampler import BaseSampler, NeighborSampler from torc...
756f446d0046f1d3d4572bd8d8599cc30fae0c1cc589fe83b6fdbc2b14fcb948
Python
29,255
502
# -*- coding: utf-8 -*- """ Created on Thu Jan 28 14:34:30 2021 @author: nehas """ import numpy as np import sys import pandas as pd pd.set_option('display.width', 1000) pd.set_option('display.max_colwidth', 100) import warnings warnings.simplefilter("ignore")#, category=FutureWarning) import glob import os print ...
12dbb5238f082ea665d309436a946942375ab1fde68ec6e791b226a21d0d82fc
Python
29,291
789
#!/usr/bin/env python # coding: utf-8 # In[ ]: #!/usr/bin/env python # coding: utf-8 """ AGED Optimal K Selection Module Automatic selection of optimal number of topics using multiple evaluation metrics """ import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import pandas as pd fr...
78baac6e73f525add5ad4afa801c8b1246db551d43d7566f54396633447c0803
Python
29,291
735
''' ''' # # Adapted from MATLAB code written by S. Nishimoto (see Nishimoto, et al., 2011). # Anwar O. Nunez-Elizalde (Jan, 2016) # # Updates: # Anwar O. Nunez-Elizalde (Apr, 2020) # import itertools import numpy as np from .utils import (iterator_func, log_compress, sqrt_sum_...
3f4deec977fd3441968a5d41ba00b45d77016ef9ca48940b4f939f481a26d122
Python
29,302
637
import os import torch import math import warnings import torch.nn.functional as F import pandas as pd import numpy as np import scipy.spatial as spa from torch_geometric.data import Data, Dataset, InMemoryDataset from tqdm import tqdm from scipy.special import softmax from Bio.PDB import PDBParser, ShrakeRupley from...
3bb6b260bcb731127b8dfda0d67a3f73c54926e6e7c3585ae0b639cba5c33f3e
Python
29,320
902
import reprlib from collections.abc import Generator, Iterable, Sequence from copy import copy from dataclasses import dataclass from pathlib import Path from typing import ( TYPE_CHECKING, Any, Optional, ) import numpy as np import polars as pl from sklearn.preprocessing import KBinsDiscretizer from tqdm ...
07d4411c56d40999157c3bba69b747faa743eac1a8997f419923f3565a311980
Python
29,333
640
"""Step 1 by spike *sorting*: units, not electrodes, as the pipeline's nodes. The detectors in :mod:`meanap.pipeline.spike_detection` give one spike train per electrode. On a dense culture an electrode often hears several neurons, and every later step then treats their pooled activity as one node. Sorting clusters the...
44a439b070fe397ff3d15f28a046a253cdd20a2ecd8caa3bcc7d6218202924bc
Python
29,344
620
#!/usr/bin/env python3 """ Unified DeepSTARR DEGU Distillation Training Script This script trains DEGU distilled models that learn to predict both Dev and Hk outputs from DeepSTARR ensemble predictions, following the @DEGU_paper methodology. """ import argparse import logging import os import sys from pathlib import ...
11fd9553f279a43bcb8f1f4669ca0ee6e3986abd977cbf62419aa1bb5cb23c70
Python
29,372
625
import ANNarchy as ann import pandas as pd import matplotlib.pyplot as plt import numpy as np import os plt.rcParams.update({'font.size': 40}) plt.rc('axes', labelsize=30) plt.rc('xtick', labelsize=20) plt.rc('ytick', labelsize=20) plt.rcParams["font.family"] = "serif" plt.rcParams["mathtext.fontset"] = "dejavuserif" ...
0b87e03f878b502ae0b65baa36c9e2ac48b743357b52d2de4b11deb290bb271c
Python
29,387
671
# wfield - tools to analyse widefield data - command line interface # Copyright (C) 2020 Joao Couto - jpcouto@gmail.com # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of t...
0726eb031fe76ad620b95a2b265801082028df3d31551531b88c31a86815348d
Python
29,389
769
# -*- coding: utf-8 -*- """ @JimHokason's translation of the Schafer Lab's skeletonization code. """ import numpy as np # If you are interested to know why the following line didn't work: # import scipy.signal.savgol_filter as sgolay # check out this: http://stackoverflow.com/questions/29324814/ # Instead we use th...
0c9d444547e3ad57e2e35e03f4282ab256ff6205ef719b05f53bacc07255a164
Python
29,427
922
# -*- coding: utf-8 -*- """Spatial properties of image arrays.""" import copy import os import random import re import matplotlib.pyplot as plt import nibabel as nb import numpy as np import pydicom from nibabel.freesurfer.io import read_label from numpy.fft import fft, fft2, fftshift from numpy.random import shuffle...
87c4b1c909bc6564ca1a15e74a36edcbdf5a0ac1ea92f59ff9b888742c20e5c8
Python
29,450
663
from staticnet_analyses.base import * from tqdm import tqdm import matplotlib.pyplot as plt import seaborn as sns from scipy.stats import pearsonr,kurtosis from collections import Counter from scipy.spatial.distance import pdist,cdist import torch.nn as nn from staticnet_experiments import configs from neuro_data.stati...
01a996f67b008eb29191548233ef8786ba4ea9a9283f08064262e025a934ff59
Python
29,469
694
"""The shared folder a multi-computer run goes through, and what is in it. A shared run lives in one directory inside whatever folder the machines have in common — ``<shared folder>/<run name>.meanap-shared/``:: Run1.meanap-shared/ shared_run.json what the run is: settings, recordings, who ...
41363cbac0aa788564cb39c921b34dea666b049d60f72dcd8e682b69c8928c91
Python
29,475
907
#!/usr/bin/env python3 # # This script converts between 2 model formats # Formats are guessed from the suffix. # All models are first converted to CARP format which is 0-index based import sys, gzip, pdb, time, shutil,re import os.path import argparse import numpy as np import scipy.io as io import struct import meshi...
446a401d019ee2196ba0e5e74d341ed5e92571fd06ae140b021d6b005583a1ba
Python
29,481
777
""" ECG datasets to use with ECGx.AI package. MB Vessies and RR van de Leur """ import os import torch from torch.utils.data import Dataset from scipy import io from sklearn.model_selection import train_test_split import numpy as np from typing import List, Union, Callable import pandas as pd from torchvision.transfo...
320ac16b50a8207a660b1921d66a944784d1ed8237635b9dc2be348de11b54b2
Python
29,510
704
''' Generate retina ------------------- Functions to generate a retina parameter array defining a synthetic retina and containing the ground truth data. ''' import numpy import os import sys from scipy.special import erf from ERICA import ERICA_toolkit, peak_detection #################### # GLOBAL VARIABLES # ####...
7cf2d435918695d330821e0f182104f4af6a34e94d72e4a68bc870c99ddd6334
Python
29,537
600
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license from __future__ import annotations from collections import deque from functools import wraps from typing import Any import numpy as np import torch from ultralytics.utils.metrics import bbox_ioa from ..utils import LOGGER from .basetrack import Tr...
16a56bfe892a02e4c5a2f6402f330b1c0e6c2fe941f8dab7fc4c6a4bcd3820e3
Python
29,564
722
"""Network viewer panel: load a MEA-NAP output .mat file and plot the network.""" from __future__ import annotations from pathlib import Path import numpy as np from PyQt6.QtCore import Qt, QThread, pyqtSignal from PyQt6.QtWidgets import ( QComboBox, QDoubleSpinBox, QFileDialog, QFormLayout, QGroupBox, QHBox...
d9d382790650ebbbc2116fb6936c199a07abc04507799a5972f3753bb3b7f834
Python
29,590
569
# YOLOv5 YOLO-specific modules import argparse import logging import sys from copy import deepcopy from pathlib import Path sys.path.append(Path(__file__).parent.parent.absolute().__str__()) # to run '$ python *.py' files in subdirectories logger = logging.getLogger(__name__) try: from models.common import * ...
a5aef51bf41f6898b2016f4d17e52d89122964f7ca6945995ee16362bf467746
Python
29,595
768
""" tensorflow/keras utilities for the neuron project If you use this code, please cite Dalca AV, Guttag J, Sabuncu MR Anatomical Priors in Convolutional Networks for Unsupervised Biomedical Segmentation, CVPR 2018 Contact: adalca [at] csail [dot] mit [dot] edu License: GPLv3 """ import sys from ext.neuron import...
aecfc34b9e670fa505fef997efbf30d6732957b7a2c276c2fcb5d9290ed5af98
Python
29,629
835
# -*- coding: utf-8 -*- # # sampler.py # # Copyright 2020 Amazon.com, Inc. or its affiliates. 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.or...
c33dcf3fa8de1e49ae931093cddd8dfc7ed206799ab143911741b86640d4a8e6
Python
29,646
817
""" SettingsManager: Centralized manager for the settings/ directory. Owns all file I/O under ``<dataset>/settings/``: * **Geometry** – center, rotation, auto-geometry cache, global base * **Flags** – transform, ignore, image-diff cache * **Blank / mask state** – enable/disable flags, blank config JSON * **Calibratio...
a2d9f1c1e754710f9ddee2f51fcbc15f0892897babd5a02ca8bb6e0c4f659eca
Python
29,667
505
# -*- coding: utf-8 -*- """ This script performs the encoding model fits for all the sessions included in the analyses. Created on Mon Feb 10 00:11:53 2025 @author: Lukas Oesch """ import numpy as np import pandas as pd import glob from os.path import splitext, join import itertools from labdatatools import * from s...
f1b9ab009c41093c0da0b8df890d0ba6705078e4f7c26269fdcf1182b621a678
Python
29,674
619
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """Hyperparameter tuning for Ultralytics YOLO models across all supported tasks. Hyperparameter tuning is the process of systematically searching for the optimal set of hyperparameters that yield the best model performance. This is particularly crucia...
3376a671c5e16d86fb67b87246bec4d91734900ca1610dab2ec85b3118e466ad
Python
29,686
704
import numpy as np from monai.data import GridPatchDataset, DataLoader, PatchIter, PatchDataset, Dataset from monai.transforms import RandShiftIntensity, RandSpatialCropSamples, Compose, RandFlipd import SimpleITK as sitk from typing import IO, TYPE_CHECKING, Any, Callable, Dict, List, Optional, Sequence, Union from to...
0381b5a2177dd2dfa014f5a720df43f7352738da1bd2bb59d11a4c6aca251d33
Python
29,714
574
# YOLOv5 YOLO-specific modules import argparse import logging import sys from copy import deepcopy from pathlib import Path sys.path.append(Path(__file__).parent.parent.absolute().__str__()) # to run '$ python *.py' files in subdirectories logger = logging.getLogger(__name__) try: from models.common import * ...
54300d09ba065b026a32231b3ddedbfc9ad75194cd2b719a70bc22b079d6f36a
Python
29,714
939
import gc import numpy as np import pytest import time import torch import xdas from xdas import Coordinate, DataArray from scipy.signal import resample_poly, sosfilt_zi, sosfilt import seisbench.models as sbm def test_get_n_patches(): patching_structure = sbm.PatchingStructure( in_samples=500, i...
dd1379747784e6f74fe4429c062caef37e494cf4369f4bc4d4a02d9a3bd88691
Python
29,751
872
#!/usr/bin/env python import math import sys from numpy import ( float32, putmask, shape, zeros, ) # This is the average of all species in the alignment outside of exons # > mean(r) # A T C G # 0.2863776 0.2878264 0.2129560 0.2128400 # > sd(r) # ...
98ea536adb7f07f794217e3ed2bc994dae8f7c1bce839cd7c6f959f61f2d88f7
Python
29,764
771
""" XGBoost Regression Constraint Model for PFAS Resistance Prediction ================================================================= This module implements an XGBoost regression model as a constraint model for predicting initial resistance values in PFAS soil treatment systems. """ import pandas as pd import nump...
44cc6e8d7479ebf832aff06351c010676ad8a1201a6c04d60ba2b5039add9c90
Python
29,765
805
import re import bz2 from argparse import Namespace import torch import torch.nn as nn import torch.nn.functional as F import torch.distributed as dist from torch.distributions import Normal from torch_scatter import scatter_add from torch_geometric.nn import global_add_pool import dgl import numpy as np from scipy.sp...
cf7879284e2702988d6429bd884691bd93d98b3f2e40df0dee6ff9a2d6392f7d
Python
29,769
725
############################################################################# # Copyright (C) 2020-2026 MEmilio # # Authors: Sascha Korf, Patrick Lenz # # Contact: Martin J. Kuehn <Martin.Kuehn@DLR.de> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance w...
cca036a1922faffd4077a6cbb2dffcd462c0037c62d11235bacfcbb6f7fd0aba
Python
29,785
890
"""Module to generate networkx graphs.""" from jarvis.core.atoms import get_supercell_dims from jarvis.core.specie import Specie from jarvis.core.utils import random_colors import numpy as np import pandas as pd from collections import OrderedDict from jarvis.analysis.structure.neighbors import NeighborsAnalysis from j...
eec91ec6170d29fdcad5b8c94f9ee1e83e26bf4b8f20ac83ccacf3038e3ae2f4
Python
29,839
612
import pandas as pd import numpy as np import json from pathlib import Path import random from skimage import measure from scipy.ndimage import zoom from skimage.transform import resize from scipy.ndimage import gaussian_filter from scipy.spatial.distance import cdist from sklearn.preprocessing import MinMaxScaler impo...
edd956fbefda4057cd75e4ff75b80ed9d5b8acfe525b06364e90af9298ec8978
Python
29,847
757
""" This file contains several helper functions to calculate spectral power from 1D and 2D EEG data. """ import logging import mne import numpy as np import pandas as pd from scipy import signal from scipy.integrate import simpson from scipy.interpolate import RectBivariateSpline from .io import set_log_level logge...
b9e86f1bae39d99e15388ff3412fe94a2628a9930960b6c85fb44bdf1061e1ba
Python
29,875
1,084
"""circstats.py -- circular statistics module This software is licensed under the terms of the MIT License as follows: Copyright (c) 2013 Jessica B. Hamrick, Peter W. Battaglia Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Softw...
26f99fcdd619ff1a7a2eda55d5f12727cbc83725e471fc8086711fbc0c1cfa55
Python
29,916
846
"""Simulation data loading functionality.""" import os import numpy as np import pandas as pd import torch from mcmlnet.data_gen.camera_adaptation import adapt_simulations_to_tivita from mcmlnet.experiments.data_loaders.config import DataConfig from mcmlnet.experiments.data_loaders.utils import ( subsample_data,...
d24e5683bfd6037feedd5ef9713b6f0a92fba0b50f52ea8277190908dbeb9184
Python
29,919
817
"""Shared chemistry-screening helpers for scripts/demo/*. Each demo script in this directory is a thin wrapper around ``submit_and_collect`` -- the actual chemistry workload (a 5-molecule thermochemistry screen) lives here so we don't duplicate it across backends. Workload -------- For each of {water, methane, ammoni...
b5f29c9a8f6042117d8ffca32fba027c882c13658e232237f8faf24b1c3e72f3
Python
29,930
932
#!/usr/bin/env python """ Handles parsing settings xml files and getting/setting the resulting settings. Hazen 06/15 """ import copy import os import traceback import xml from xml.dom import minidom from xml.etree import ElementTree # # Functions. # def config(config_file): """ Parse...
9ba6a867eb21c9b4bac0e7edb8931af5e414a8c2b030bc45cd238aa5d0a377ec
Python
29,971
899
"""Tests for the middleware-based main-agent supervisor.""" from typing import Annotated, Any, NotRequired, TypedDict import pytest from deepagents.backends import LocalShellBackend, StateBackend from deepagents.middleware import SubAgentMiddleware from langchain.agents import create_agent from langchain_core.languag...
36eaf2d0cee7479f239504ec8347fad5be648b505de41b7b8f99178aa36c8b0f
Python
29,972
662
# ======================== # 📦 Imports & Setup # ======================== import ast import io import pandas as pd import plotly.io as pio import streamlit as st import yaml try: import altair as alt alt.data_transformers.disable_max_rows() # prevent silent failures on larger data except Exception: pas...
d0b93675d6e4b0d125111e055910e5897d1de5fd6e6c25bf7c6bd57465346cc0
Python
29,973
752
# -*- coding: utf-8 -*- from contextlib import nullcontext import itertools import logging import multiprocessing import os import sys from tempfile import TemporaryDirectory import traceback from typing import Union from tqdm import tqdm import numpy as np from dipy.data import get_sphere from dipy.io.stateful_tracto...
059aee4f783e8cb02655f393d9ecb5a8ca2fabf0ee64615b319b518166d6b1b7
Python
30,014
818
# Copyright (C) 2020-2022 Intel Corporation # Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT from __future__ import annotations import io import itertools import math from abc import ABCMeta, abstractmethod from bisect import bisect from collections import OrderedDict from collections.abc import C...
72b9070f28c19f2dead793a0b2e3d1ddad58c622448f66c209d3cc21934f0f95
Python
30,028
888
# Copyright 2024 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...
40618c32c978a9bfb029aca5e6c64f878e1f357ef1d9c8e910d9b22990f5746a
Python
30,046
622
from qtpy.QtCore import Qt from qtpy.QtGui import QPixmap,QColor from qtpy.QtWidgets import QWidget,QStackedLayout,QPushButton,QVBoxLayout,QHBoxLayout,QLabel,QMainWindow,QMessageBox,QTableView,QDialog,QDialogButtonBox from qtpy import QtGui from napari_dmc_brainmap.registration.sharpy_track.sharpy_track.view.AnchorRow ...
4ca5b15ce4f792339131dff400fea79a2e9caf60ffa371d1250d3ab64f329551
Python
30,050
622
from PyQt5.QtCore import Qt from PyQt5.QtGui import QPixmap,QColor from PyQt5.QtWidgets import QWidget,QStackedLayout,QPushButton,QVBoxLayout,QHBoxLayout,QLabel,QMainWindow,QMessageBox,QTableView,QDialog,QDialogButtonBox from PyQt5 import QtGui from napari_dmc_brainmap.registration.sharpy_track.sharpy_track.view.Anchor...
657c2e20277d106485f677bde408f46b01e3d03ff8d9a472417ac0879d53f565
Python
30,053
698
# Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT from __future__ import annotations import itertools from collections import Counter from contextlib import closing, suppress from copy import deepcopy from django.db import transaction from django.db.models import OuterRef, Subquery, prefetch_relat...