sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
d375dbceb2bf1ae962a1f8f2bd6cae1b41417b12760d9841c0832a57f80fd448
Python
23,335
603
# -*- coding: utf-8 -*- import unittest import arbor as A from arbor import units as U import numpy as np from .. import fixtures """ Tests for the concentration and amount of diffusive particles across time and morphology. Four different morphological structures are considered: 1 segment ("soma only"), 2 segments ("...
18e9a4319fe3ed6dd20b6a12eafd141d8b96bd427357d448937b05411524d45d
Python
23,344
477
import pytest import torch import SimpleITK as sitk import numpy as np import os import subprocess import logging from pathlib import Path import torch.nn.functional as F from scipy.ndimage import map_coordinates # this is the lib used to load the images for scipy transforms # important because the image dimensions ar...
b03286431415060e99d7ac897dc96c33dc3c19280da2bbbc5de539d56f37513e
Python
23,373
481
import matplotlib matplotlib.use("agg") import matplotlib.pyplot as plt import numpy as np import os def plot_residual(diff_p, diff_s, diff_ps, tol, dt): box = dict(boxstyle='round', facecolor='white', alpha=1) text_loc = [0.07, 0.95] plt.figure(figsize=(8,3)) plt.subplot(1,3,1) plt.hist(diff_p, r...
ead5d7e1efe2d6569c70db846e958b0d911eed59cbc860110f74a202b8463287
Python
23,386
653
# -*- coding: utf-8 -*- import numpy as np import logging from dipy.reconst.shm import sh_to_sf_matrix from dipy.data import get_sphere from dipy.core.sphere import Sphere from scipy.ndimage import correlate from itertools import product as iterprod from scilpy.gpuparallel.opencl_utils import have_opencl, CLKernel, CLM...
d7b51fb9a5eaaf921adc7b7233b9509df83bfb07f67b8521e4a1e2a8f991f868
Python
23,390
624
""" Interface between the data loaders and file loaders. """ from abc import ABC from typing import Dict, List, Optional, Tuple, Union import numpy as np import tensorflow as tf from deepreg import log from deepreg.dataset.loader.util import normalize_array from deepreg.dataset.preprocess import resize_inputs from d...
9f48d0962ea82b44a625a3d2ab1a16b9062af1cfb6cd1e48e33a5ff130afb12b
Python
23,398
707
import argparse from collections import defaultdict from pathlib import Path from queue import Queue import cartopy.crs as ccrs import matplotlib as mpl import matplotlib.patches as patches import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from cmcrameri import cm textwidth ...
533a1930f44ab25d0606b7290f32b02d5cbc2aabb9c454f5849bded1f50dfd9b
Python
23,413
784
import sys import os import re import logging import pandas as pd import numpy as np from scipy.sparse import csc_matrix from heig import utils class Dataset: def __init__(self, dir, all_num_cols=False): """ Read a dataset and do preprocessing Parameters: ------------ dir:...
3b6c5ac02ac44659092e6132303b830142777939e09b53bd0436b16e9475a025
Python
23,414
536
# Plotting utils import glob import math import os import random from copy import copy from pathlib import Path import cv2 import matplotlib import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns import torch import yaml from PIL import Image, ImageDraw, ImageFont from ..utils.g...
98c15dac8713a3c2d5aef247f98c821494676f97bc1fda88b1e3ca1ae6814c18
Python
23,417
479
import dtiplayground.dmri.common as common import yaml, inspect from pathlib import Path import pkgutil,sys, copy import os import markdown logger=common.logger.write @common.measure_time def _load_modules(system_module_paths=[],user_module_paths=[],module_names=None, **options): options.setdefault('logger', c...
2b365fa61677e726d53fbc43fde15426f7bd1acd36e890e3e5595b6a0667ce4d
Python
23,429
341
''' FH2 ''' import numpy as np import sys def intro(): print(""" SHORT List of potential energy surfaces for FH2: P: potential energy, G: Gradient, D: Nonadiabatic coupling vector This is listed at the end of description to show the availability. For example: P/G means both potential energy and g...
ee6ca16b1d4cee0004bef78181806b4017ebeb6627e3eaf0b0897f7acd96989b
Python
23,438
604
#Lucas Sancéré import os script_dir = os.path.dirname(os.path.abspath(__file__)) import math from collections import Counter, defaultdict import lightgbm import numpy as np import xgboost import yaml from attrdictionary import AttrDict as attributedict from sklearn.metrics import balanced_accuracy_score from sklea...
a118628ba8688cb71a86c4cb4ce3dabba6d9f07413f1f615a2d77c62b00ea87c
Python
23,453
543
import sys sys.path.append('..') import warnings warnings.filterwarnings("ignore") import os, random, logging, time, copy from tqdm import tqdm from argparse import Namespace from typing import Callable import pandas as pd import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch....
5cd98bb8f7d639f4be3f568f9a559905d79655a0a5751cbd069e5ec60c8f1a90
Python
23,461
601
import shutil from collections import defaultdict import h5py import numpy as np import seisbench import seisbench.util from .base import WaveformBenchmarkDataset class SCEDC(WaveformBenchmarkDataset): """ SCEDC waveform archive (2000-2020). Splits are set using standard random sampling of :py:class: ...
ae9a43c2dcc2070ebaea2fff177013dc4267db8233e5bf0c9f5611636c823346
Python
23,476
558
#!/usr/bin/env python3 """3D ViT-UNet model definition for BraTS tumor segmentation.""" import torch import torch.nn as nn from einops import rearrange from functools import reduce from operator import mul import torch.nn.functional as F import torch.utils.checkpoint as checkpoint from timm.models.layers import DropPat...
bea59677b1c9b1b10045c92804fd16f5233e724d3dc4fabf642b41a5362edbc9
Python
23,476
677
# -*- coding: utf-8 -*- """ MReye-Seg Slicer Utilities =========================== Project-specific 3D Slicer utility functions for the MReye-Seg pipeline. Provides wrappers for centerline extraction, cross-section analysis, visualization, geometry, and fiducial/markup operations. Used by: - landmark_transform.py ...
01fb184e0cbdddf84b775f9621e612f9bbe70b9ad2aee4067d565f0182c2af5f
Python
23,484
394
#Type something like this from within python: ARGS="20160822orangedm105 M 30 none 10.5 DM" #template: ARGS="filename sex age drugs theta region" #then type: #If not in python, type: python PopSpikeAnal.py 031011_5Or M 30 none 10.5 DM import os; import numpy as np from matplotlib import pyplot pyplot.ion() import sys ...
0d3ddd90a53fae48df1e8326989c2f6b6f024fc7025963da45b9c91e93f25bf0
Python
23,488
640
# -*- coding: utf-8 -*- """ANTS registration.""" import math import os import shutil as sh from glob import glob from os.path import exists, join import nibabel as nb import numpy as np from nibabel.freesurfer.io import write_geometry from scipy.io import loadmat, savemat from .. import check_installation, execute_c...
a4d98c3555cc4c0810a7b6282196a74d4c60e9e9acc4be43346158c1f2d7faa5
Python
23,492
559
# -*- coding: utf-8 -*- # @Author : LG import os import platform import time from collections import OrderedDict from typing import Union import numpy as np import torch from PIL import Image osplatform = platform.system() class SegAny: """ Segment Anything model class. Arguments: checkpoint:...
b5003246e195a91c19adac1f3b1f5811360e722ff46b971b4a31a3e199202f1c
Python
23,498
568
# Required libraries 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 matplotlib.pyplot as plt from dataset_patches import MyDataset from dataset_patches import Custom3DAugmentation...
54cf3dd4b418081b1bfbeb7c65132d8a33da3572f85f992235e3474505911cad
Python
23,500
676
#!/usr/bin/env python3 # # PRECONFIG, a versatile configuration file generator for varying parameters # # Copyright Francois J. Nedelec and Serge Dmitrieff, # EMBL 2010--2017, Cambridge University 2019--2022 # This is PRECONFIG version 1.59, last modified on 03.02.2023 """ # SYNOPSIS Preconfig generates files fr...
f16a50136b2d82eb800a95946a32cab6ccc89a25f422bae94310ca85048d84b4
Python
23,516
383
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'mosaic.ui' # # Created by: PyQt5 UI code generator 5.15.4 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. from PyQt5 import QtCore, QtGui...
fdc06fe3ed79d1bb0ed29131864d8771418dac0f628a3ed569a3400a14894c06
Python
23,555
529
#!/usr/bin/env python # Copyright (c) 2015 Tobias Neumann, Philipp Rescheneder. # # This file is part of Slamdunk. # # Slamdunk is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the #...
a9e8b4df2bda72326ad10cad41bb44f52e2dc4609aba1bfc66f042b3ed59a738
Python
23,562
501
# mat_to_tfrecord.py # Created by Nick Card, July 2023 # Modified May 2024 by Justin Jude import os import re from pathlib import Path import numpy as np import scipy.io import tensorflow as tf from g2p_en import G2p import matplotlib.pyplot as plt import os import json PHONE_DEF_SIL = [ 'AA', 'AE', 'AH', 'AO',...
ec889a960f630f3814c287266be3a965b8064de3c76c8ce18a2597f37e9c9b9c
Python
23,573
565
############################################################################# # Copyright (C) 2020-2026 MEmilio # # Authors: Manuel Heger, Henrik Zunker # # 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...
1f4c45255fd5748912a4b79db3151732a2af3aec381104fca0ffa1a49faa9ec8
Python
23,596
649
#!/usr/bin/env python """ The handles all the UI elements in the Mosaic tab. Hazen 10/18 """ import numpy from PyQt5 import QtCore, QtGui, QtWidgets import storm_control.sc_library.hdebug as hdebug import storm_control.steve.coord as coord import storm_control.steve.imageCapture as imageCapture import storm_control....
cb3dfd39bf86960972781cade293af03da6979c93d897a88f5fb531e1564b32a
Python
23,607
649
import numpy as np from scipy.stats import ttest_rel, ttest_1samp, ttest_ind, kstest, wilcoxon from statsmodels.stats.multitest import fdrcorrection import pickle import mne import pandas as pd import matplotlib.pyplot as plt import glob import os from update_sub_lists import* from pp_utils import * def find_existin...
b2aadfaf988f32a6e936439ddd3c6a5f3cfe302c3fb37325fa58fa5d42e0656b
Python
23,642
678
import os import h5py import logging import numpy as np import pandas as pd import hail as hl from tqdm import tqdm from collections import defaultdict from numba import njit, prange from sklearn.model_selection import KFold import heig.input.dataset as ds from heig.wgs.utils import init_hail, read_genotype_data, clean...
67229e75f8d1213fd0db751a7fd151086fe02697d73fa5d342aa78aad02fccbf
Python
23,675
638
from __future__ import annotations import numpy as np import scipy from functools import cached_property from scipy.interpolate import interp1d from typing import NamedTuple from argclz import argument, AbstractParser, int_tuple_type, union_type, as_argument from neuralib.decoding.position import place_bayes from neu...
dc1563425b193477d71c8c3a1cf43c69b235503fd51721212cbd4a7fd24f5617
Python
23,679
618
import os import argparse import nibabel as nib import numpy as np import csv from nipype.utils.filemanip import fname_presuffix ############################ # Image Loading and Saving # ############################ def load_image(image_path): """Load image data based on file extension.""" ext = os.path.split...
254bce67b2e6cb8599cf4bc6d896856caa6528693c8ab2375d91be117ad9d4f0
Python
23,689
463
import warnings; warnings.filterwarnings("ignore") import sys, random, math import numpy as np import scipy.stats as stats import multiprocessing from operator import itemgetter from sklearn.preprocessing import StandardScaler from sklearn.neural_network import MLPClassifier from Energy import * ####################...
76b029bc68457f50f4755aac0940f561ffc09b4489131ff232ddd54420028a63
Python
23,694
752
import math from dataclasses import dataclass from typing import TYPE_CHECKING, Any import torch import torch.nn as nn from eir.models.fusion.seq_out_fusion_attention import CrossAttention from eir.models.layers.cnn_layers import ( ConvAttentionBlock, ECABlock, StochasticDepth, UpSamplingResidualBlock...
853d330a034e44a50885cf64cf313bf3ce5d017ed4744a3acff7eaf2684b8e42
Python
23,698
608
import torch from torch import nn import torch.nn.functional as F import numpy as np import copy from torchsummary import summary def conv_bn(in_channels, out_channels, kernel_size, stride, padding, groups=1): result = nn.Sequential() result.add_module('conv', nn.Conv2d(in_channels=in_channels, out_channels=o...
a000e329a0f37bb303ed39486925e7f8f7cc9db2fbc7baa78e4759c85a2a0563
Python
23,707
532
"""Test resuming a CAT-NAP run from a previous run's output ("start at step 4"). Run from the repo root:: uv run python python/test_catnap_resume.py MATLAB's ``MEApipeline.m`` appends ``adjMs`` to each recording's ``ExperimentMatFiles/<rec>_<folder>.mat`` at the end of step 2, and its ``priorAnalysis == 1 && sta...
740872f42953cba2173153d31c12b0ad5b8041ec14f78dacd0ed6d97af88dd6e
Python
23,712
613
""" DMC-BrainMap widget for stitching .tif files. 2024 - FJ, XC """ from collections.abc import Iterator, Sequence from pathlib import Path from typing import Dict, List, Tuple import numpy as np import tifffile as tiff from magicgui import magicgui from magicgui.widgets import FunctionGui from napari import Viewer ...
a2155da1a4783e6cffb4229e743bcfdb496850045bbeeb7bfb38306584542701
Python
23,717
592
# -*- coding: utf-8 -*- import os import re import sys def find_reference_pcr_file(ref_pcr_name, root_dir): ref_path = os.path.join(root_dir, 'dat_vestacif_files', 'reference_pcr_format', ref_pcr_name) if os.path.exists(ref_path): print("Found reference PCR in reference_pcr_format folder: {}".format(...
db57f93f87ecafe3d0b27c4ba266162c8de557d4031f3c0c9eb4a556286d67f9
Python
23,729
535
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Copyright (c) Meta Platforms, Inc. and affiliates. All Rights Reserved # Based on https://github.com/IDEA-Research/GroundingDINO from __future__ import annotations import torch from torch import nn from ultralytics.nn.modules.utils import _get_clo...
c171e6f26206c61ad04eaed701e97044411afe7976fe3f65fe069461beef8e4b
Python
23,730
603
import argschema as ags import numpy as np import pandas as pd import logging from multiprocessing.dummy import Pool from skeleton_keys.database_queries import ( swc_paths_from_database, ) from skeleton_keys.depth_profile import ( calculate_pca_transforms_and_loadings, apply_loadings_to_profiles, earthm...
ba65712ceba6aa4cae82e86bc3d2c537d830c27ec1b34855ee089cf829e776b3
Python
23,742
692
import typing import asyncio import numpy import math import grpc import bisect import pathlib import datetime import itertools import traceback import matplotlib import logging from ..config import * from ..util import open_preferred_app from ..util import MeteredUpdater from .. import thalamus_pb2 from ..qt import ...
2248b8c4b4e7977ad340d519acfd9f4f860697900eb264b49704afbe84a9c5e7
Python
23,761
508
import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.patches import FancyArrowPatch, Patch from matplotlib.lines import Line2D from scipy.cluster.hierarchy import dendrogram import networkx as nx from . import process as proc def SemiCirc_coordinates(star...
1324c0d497fe890c16b313ae63f372df2311344d01123f50253da9c26e9edc46
Python
23,772
562
import numpy as np import multiprocessing as mp from . import galvo_corrections import time def map_frames(f, scan, field_id, channel, y=slice(None), x=slice(None), kwargs={}, chunk_size_in_GB=0.5, num_processes=10, queue_size=10): """ Apply function f to chunks of the scan (divided in the temporal...
c29c27e5d0f40907a81e8b5640f499f566b5c9dcb11a0db0c606a9c76391329b
Python
23,821
791
import base64 import json import subprocess import time from collections.abc import Sequence from functools import partial from pathlib import Path import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from docs.doc_modules.experiments import ( AutoDocExperimentInfo, get...
b4e4c4702c56e09e8e72900a4141ff0176769c0a6f32349e6be20fd15aa522e0
Python
23,832
583
from tqdm import tqdm import numpy as np import pandas as pd import os import gc from scipy.ndimage import zoom import matplotlib.pyplot as plt from traitlets import default from .gradients import IntegratedGradients, GradientDescent from .evosearch import Evolution from .motifs import Motif from . import ...
f147edfc944aa81fb5ad4a0b34568c7ed4fa28df29a5b56a405a162cb48eed7b
Python
23,833
489
from models.keras_vision_transformer import swin_layers from models.keras_vision_transformer import transformer_layers from tensorflow.keras.layers import Input, Dropout, Lambda, Conv2D, Conv2DTranspose, MaxPooling2D, Concatenate, Activation, Add, multiply, add, concatenate, LeakyReLU, ZeroPadding2D, UpSampling2D, Batc...
a1d6b970526c80d967a8ae9d7d4f05c02e30f19661378ef24895f363de9bdb59
Python
23,843
642
""" 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...
3a6745665d8e8ca22933ffc0fb12d64cca930e0ad8f030dda64689ff1323a8f2
Python
23,851
677
# Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT import io import json import os.path as osp import zipfile from logging import Logger from pathlib import Path from unittest import mock import pytest from cvat_sdk import Client, models from cvat_sdk.api_client import exceptions from cvat_sdk.api_c...
0a3d012335208e3fe14ccb3a0be486941790e9a44b7311beeab1fc8a98034b59
Python
23,865
563
import os import time import torch from ignite.engine import Engine, Events from ignite.handlers import ModelCheckpoint, EarlyStopping, create_lr_scheduler_with_warmup, CosineAnnealingScheduler from ignite.handlers import Timer from ignite.metrics import Accuracy from torch.nn import TripletMarginLoss from torch.optim...
f4ffc21821571e8373a0e4021a173b5daf1cb656077a8169706d88abb84bc451
Python
23,869
764
"""Protocols (interfaces) for backends to implement. Each class in this module is a [typing.Protocol][typing.Protocol] that specifies a set of :func:`~abc.abstractmethod` that a backend widget must implement to be compatible with the magicgui API. All magicgui-specific abstract methods are prefaced with ``_mgui_*``. ...
1bd244306e77123062f8bc9edf3a4003f2188ee9940ebe47bf5de9db61242326
Python
23,875
632
import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt import torch import torch.nn as nn import torch.nn.functional as F import torchvision import torchvision.transforms as transforms import numpy as np import pandas as pd import os import cv2 from torch.utils.data import Dataset import ...
5545b18a6aecca181fac09db35a4023cac65e11b94ce39100790d9610559e904
Python
23,883
718
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. 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 cop...
205dcf68bb05b24b7ea45cc3ebfcaae46cfccd59248dfda2097985b36feec152
Python
23,894
701
#!/usr/bin/python # ## @file # # Qt Widget Range slider widget. This is a slider with two bars, one of # which is used to set the maximum and the other of which is used to # set the minimum. # # Qt Double Spin Box slider widget. This is the range slider grouped # with two spin boxes to make the range editable....
0cba16ef0eb9203c809f8ebffb9ad3699a8e6c5e7be0a6a10905840b34779541
Python
23,901
507
from typing import List import torch from torch.nn import Module, Parameter import numpy as np from ..numpy.generic import MeshPhases from ..config import BLOCH, SINGLEMODE from ..meshmodel import MeshModel from ..helpers import pairwise_off_diag_permutation, plot_complex_matrix import os class TransformerLayer(Mod...
0e85e8344e6e6a0b8df0171a285da1fbb57b1bd6dbef0aa8fe94d04d6300e6e6
Python
23,903
752
"""Deterministic structured-output judge for ChemGraph evaluation. Compares the agent's ``ResponseFormatter`` structured output against a ground-truth ``structured_output`` dict field-by-field using numeric tolerances and SMILES canonical comparison -- no LLM required. Each ``ResponseFormatter`` field is compared ind...
7651d526911b0b0cebec4922c21a7b8226c5acff92330472bd63bf455c481f23
Python
23,943
599
import keras.layers as kl from keras.models import Model def DREAM_RNN_Official(input_shape, config, epistemic=False): ''' Full DREAM-RNN architecture matching the paper specifications. Architecture: - BHIFirstLayersBlock: Conv1D with kernel sizes [9, 15], 160 channels each → 320 total - BHICo...
fda386ee66c9a1f87a0fe07834906c7a71af926bcb3eac99a330eb6e801fa50b
Python
23,950
484
from curses import meta import os import pickle import random import numpy as np import pandas as pd from tqdm import tqdm from glob import glob import torch import torchaudio from torchaudio import transforms as T from torch.utils.data import Dataset from copy import deepcopy from .icbhi_util import g...
05d573ed838510a3b1b1ca50c085ba4dfe460073cd7aa146146c96d1c2745211
Python
23,956
537
# ============================================================================== # Binaries and/or source for the following packages or projects are presented under one or more of the following open # source licenses: # cocoeval.py The OpenLane Dataset Authors Apache License, Version 2.0 # # See: # https:...
58d040aed48c4af39ccd18cb303831d0d3bff98e73875fcdd445745f7b676ed6
Python
23,962
659
""" Module containing data augmentation techniques. - 3D Affine/DDF Transforms for moving and fixed images. """ from abc import abstractmethod from typing import Dict, List, Optional, Tuple, Union import numpy as np import tensorflow as tf from deepreg.model.layer import Resize3d from deepreg.model.layer_util impo...
5f821ecc57919bb3994a3945755390e9ff6fcd4f549597da2878e5cdcdaa8c66
Python
23,978
475
"""Choosing a MEA-NAP version, and keeping the cutting edge current. Everything runs against throwaway git repositories standing in for GitHub, so the checks need no network and cannot touch the real clone. Four groups: A. what is running — main, a release worktree, a branch, no clone at all; B. is it current — b...
31aecf86a6efb45ecc8331c48cda9b93686449fdb1aca7e62003b1f230db1701
Python
23,980
756
import datajoint as dj import pandas as pd from . import mice # needed for referencing import numpy as np import os from commons import lab schema = dj.schema('pipeline_experiment', locals(), create_tables=False) @schema class Fluorophore(dj.Lookup): definition = """ # calcium-sensitive indicators fluoro...
cd7b6800d108b83ee282db0cda73f50313ed4183a91abbba6526922b837f8e73
Python
23,988
684
import os import h5py import logging import numpy as np import pandas as pd import hail as hl from tqdm import tqdm from collections import defaultdict from numba import njit, prange from sklearn.model_selection import KFold import heig.input.dataset as ds from heig.wgs.utils import init_hail, read_genotype_data, clean...
71367e883b40b5d2f88c30e8ce37880b3f6b1938866330fc28c0664ea59b530d
Python
23,997
524
# flake8: noqa # note: this file has been modified from its original version in TrackEval in # https://github.com/JonathonLuiten/TrackEval/blob/master/trackeval/datasets/youtube_vis.py # to support the following: # 1) bbox evaluation (via `IOU_TYPE`) # 2) passing GT and prediction data as Python objects (via `GT_JSON_...
eea91645a74d6089c459c2620b14281973a10751ac6c289be9d8aabd8031ee37
Python
23,999
571
"""Plot Schirmer vascular-territory statistics as an axial mosaic. The atlas is displayed over a user-supplied anatomical or perfusion image. Its outer footprint is clipped to the nonzero background mask, while signed distance fields provide smooth internal ROI interfaces. Significant and non-significant territories ...
14f8742eaf6d4c6b5b2d241c8099e4c122f95790646117af5c0fb6fff4159e3d
Python
24,009
651
from pathlib import Path import collections import functools import numpy as np import scipy.optimize import scipy.stats import warnings from matplotlib.axes import Axes from scipy.interpolate import interp1d from tqdm import tqdm from typing import Union, NamedTuple, Optional, Literal, Iterable, overload from argclz...
e488a6657d388da1c8dbf5fbbbbade478cd242482cb108a828f1d351e708c836
Python
24,012
611
"""Codex SDK model adapter. This module adapts the official ``openai-codex`` Python SDK to LangChain's chat-model interface. Codex is used only as the model backend; ChemGraph's existing LangGraph workflow remains responsible for executing all exposed tools. """ from __future__ import annotations import json import...
63f0fe1faa78b84bcf5d0b049eeb415b2d389dfb6b16be825e6b1a794fb3f666
Python
24,030
720
import numpy as np from scipy.optimize import curve_fit from scipy import stats def mse_func(a, b): return np.sqrt(np.sum((a - b) ** 2)) def interpolate_time_frames(C_A, t_A, C_B, t_B, frame_length): # Interpolate C_A and C_B to uniform time frames of frame_length [s] # Make them equally long by shorten...
a393110510365dce846bb3e2e98ab2063025589c418435eb41632be856471cb9
Python
24,033
667
"""Control analysis for resting state""" import nibabel as nb import seaborn as sns import numpy as np import matplotlib.pyplot as plt import math import subprocess import glob import os from nilearn.connectome import ConnectivityMeasure ROOT = '/Users/sebastiandresbach/data/s1Anfunco/Nifti' subs = ['sub-05', 'sub-0...
ff6ba6d0834a9c5142ae8bbc9a4c7cf2ad0b9115e854ae22fff51a3af1d188d3
Python
24,040
765
""" This module contains functions to plot the results of RNN simulations, including activity, performance, and angle between evidence and input dimensions. For comparison with neural data, the module also contains functions to plot the angle between neural regression dimensions for evidence and outcome. """ import nu...
29a75598f407f1da23031943a8e35e3e23e4b8b357e2708f883c56983b228880
Python
24,044
562
import numpy as np import random import os from tensorflow.keras.models import Model from tensorflow.keras.layers import Input, Activation from tensorflow.keras.layers import Conv2D, MaxPooling2D, Conv3D, MaxPooling3D, Dropout from tensorflow.keras.layers import concatenate, UpSampling2D, BatchNormalization, Reshape f...
f428735850b08f6b2535c5413a07d5fb0427f8ab1c25eff2ef9d36c3e55fefac
Python
24,045
826
import functools from typing import ( Any, Callable, Dict, Iterable, List, NamedTuple, Optional, Tuple, Type, Union, ) import torch import torch.utils._pytree as pytree from torch import Tensor from torch_geometric.typing import INDEX_DTYPES aten = torch.ops.aten HANDLED_FUNC...
ab4c25948a48bb643cbe69f4e70e07808533287638c827bb66e65090a02f404e
Python
24,050
660
""" 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...
bbcf81d9e7e7dbb5615867d076e2ade52fc41eea7473417b1bd432da284882c4
Python
24,055
721
import torch import numpy as np from scipy.optimize import linear_sum_assignment from datasets.dataloader import TrialDataset import pandas as pd import json def prepare_svd_feat(model, filt_data): T, K, N = filt_data.shape filt_data = filt_data.permute(2, 1, 0).reshape(N, -1) mean = filt_data.mean(1, kee...
da1f5815f494f75d5b17ac97df65776524b0813c8ac9eaff763a2e4f73a7675b
Python
24,065
636
# python 02_run_lickextraction_fromtrace.py PL077_20230407-probe0 -ipimin 0.015 -npmin 1 -pthr 3. from scipy.signal import find_peaks from argparse import ArgumentParser import sys import h5py import numpy as np import yaml import os from scipy.interpolate import interp1d from copy import deepcopy from matplotlib.widge...
1bdf7ba94b5805ef9031c9f7732c5988a26eca6feeaf8fc738f91d088d123a27
Python
24,083
512
import numpy as np import matplotlib.pyplot as plt from scipy.stats import sem from matplotlib.colors import ListedColormap, BoundaryNorm import matplotlib matplotlib.use('TkAgg') def plot_3d_line(ax, arr, set_color='lightblue', set_alpha=0.5, set_linewidth=0.5, set_label='None'): for i in range(arr.shape[0]): ...
b7ed6386d3db3dd8217e7eb2f6fbccdb8e3f222536426deb7d019a1da894984a
Python
24,083
539
# Copyright (c) Facebook, Inc. and its affiliates. from typing import Dict, List, Optional, Tuple, Union import torch import torch.nn.functional as F from torch import nn from detectron2.config import configurable from detectron2.layers import Conv2d, ShapeSpec, cat from detectron2.structures import Boxes, ImageList, ...
5179561757e8c614a51a2632536f7cf264a88876525a377c8d688460c7c38679
Python
24,084
653
import pandas as pd import os.path as osp import os import numpy as np from ogb.utils.url import decide_download, download_url, extract_zip from tqdm import tqdm ### reading raw files from a directory. ### for homogeneous graph def read_csv_graph_raw(raw_dir, add_inverse_edge = False, additional_node_files = [], addit...
893e370263947ad439dcc1337a5abeb55ee5cc04f36eb75cd5669871932ab8e4
Python
24,102
584
""" EfficientNet3D-B0 Baseline Training Script Train EfficientNet3D-B0 model with T2W or FLAIR single modality input """ import os import json import time import argparse import numpy as np import torch import torch.nn as nn import torch.optim as optim from data.dataset import MRIDataset from models.efficientnet3d_pret...
74de809a4e66fbf6c38f4424ba455d1da145e71416317186c48effc906ef03da
Python
24,110
472
import os import pathlib import numpy as np import matplotlib matplotlib.use('Qt5Agg') import matplotlib.pyplot as plt from matplotlib import colors as mcolors from matplotlib.collections import LineCollection from numpy.typing import NDArray from helper_functions.neuron_cell_functions_lib import collect_lines_section,...
2023ce7c42a9dda75211d2b277037bb929db4a6d48324450c778a3e86de41d47
Python
24,123
705
import sys from dataclasses import dataclass from enum import Enum from typing import Any import numpy as np import polars as pl import torch from numpy.typing import DTypeLike from eir.utils.logging import get_logger logger = get_logger(name=__name__) NULL_STRINGS = frozenset(("", "None", "null", "nan", "__NULL__"...
a535409c7eb529e08ee92c04ac8fab3d30d58ca42191b963a551372904e7b68d
Python
24,123
670
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: karajohnson """ import os import numpy as np from scipy import signal from fooof import FOOOF, utils from scipy.stats import sem, pearsonr, ttest_ind, fisher_exact import math import pandas as pd import copy pd.options.display.max_columns = None pd.options.d...
8fe896865277a1a826b3383a79c904541a5a8a70ee4f09be86b3b64d1d7c3741
Python
24,136
793
# Copyright (c) Meta Platforms, Inc. and affiliates. All Rights Reserved import os from typing import Optional import torch import torch.nn as nn from huggingface_hub import hf_hub_download from iopath.common.file_io import g_pathmgr from .model.decoder import ( TransformerDecoder, TransformerDecoderLayer, ...
e121fea0e71a9741e32f7dec248b05ad855edb7b23e349539752beeda18ecd48
Python
24,168
755
"""Entrypoints for dannce training and prediction.""" from dannce.interface import ( com_predict, com_train, dannce_predict, dannce_train, build_params, ) from dannce.engine.processing import check_config, infer_params from dannce import ( _param_defaults_dannce, _param_defaults_shared, ...
4c19bff6a4195851266de99d5e1486e5665a6a2112258835298a145b86dfeb14
Python
24,176
542
""" Created on Wed Mar 25 19:31:32 2025 @author: Sophie Skriabine """ import tkinter as tk from tkinter import ttk, messagebox import os from .config import parse_literal from .WaveletGenerator import * from .LoadPinkNoise import * from .Analysis_Utils import * from matplotlib.backends.backend_tkagg import FigureCanva...
a268b8d386800ca887be38ef197feadc5944228aa81743a1239505d504692f57
Python
24,177
587
# This file contains modules common to various models import math from copy import copy from pathlib import Path import numpy as np import pandas as pd import requests import torch import torch.nn as nn from PIL import Image from torch.cuda import amp try: from ..utils.datasets import letterbox from ..utils.g...
24d2e597f8dea56d7dcbd63cbc725502d1b4bb2dcaea6dae1a24a3d6e204c018
Python
24,195
680
# Example of training script EPOCHS = 200 QAT_EPOCHS = 20 EVALS = 25 # Standard Library imports import os import sys import time import random import json import copy import fcntl from pathlib import Path import warnings # Third-party Libraries from tqdm import tqdm import pandas as pd import matplotlib.pyplot as ...
49e52ce5ed5030226337815bc489958b70796e380997d0d1d2f481235d6aa4d3
Python
24,215
568
""" This file was written to provide an easy way to load an existing CLAPP trained model. It is based on codebase of CLAPP as modified by Ariane Delrocq. Import the function load_model from this file. Check its docstring (with help(load_model)) to know how to use. Note that due to CLAPP training requirements, CLAPP mod...
f15cf14107c2f25b43c58d0d4f954a176e03aacd9f8e23098e92d761f7262e08
Python
24,215
582
#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...
1e5b99a17fa9ddee7ec5ecf204099eb91a8b8dd98da74afa54eae6e32e76eead
Python
24,222
499
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license from __future__ import annotations import glob import math import os import random import shutil from copy import copy, deepcopy from multiprocessing.pool import ThreadPool from pathlib import Path from typing import Any import cv2 import numpy as n...
9b9d09aeb1bde966175ebd6d56cdca5cfd820594f2c6176dde1bd3331f6c1d5c
Python
24,225
517
from torch.utils.data import Dataset, DataLoader import torch import torch.nn.functional as F import numpy as np import openbabel from openbabel import pybel import os import pickle from math import ceil, sin, cos, sqrt, pi from itertools import combinations from random import choice from skimage.draw import ellipsoid ...
125167f2f2d74403b15ae5b845260db316c62a0b8982ee2a20795c1e05e7830a
Python
24,230
833
# Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT import traceback from typing import Any import rq from crum import get_current_request, get_current_user from django.db import DatabaseError from django.db.models import Model from rest_framework import status from rest_framework.exceptions import N...
263732a659281557ac8e8565845b4009d8f82257bca80dab63094c8afe1ba983
Python
24,236
626
############################################################################# # Copyright (C) 2020-2025 MEmilio # # Authors: Agatha Schmidt, Henrik Zunker # # 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 complian...
8e1b8e5acf51cb854cedc705f9644e56f5cbefe80b7606eefa500307e9c66249
Python
24,251
614
##### # ogo_sideways_fall_fe.py # # This script sets up the sideways fall FE model on the hip from the density (K2HPO4) # calibrated image. This script sets up the model for either a left or right femur, as # specified by the user. The analysis resamples the image to isotropic voxels, transforms # the image, applies th...
dbc3535bd6e273971d874401fad1f4c2227bca2705ff01ace4ce4eaf4badac27
Python
24,258
583
import matplotlib.pyplot as plt import numpy as np from matplotlib.animation import FuncAnimation import json import numpy as np import os, cv2, glob, json, gc import pandas as pd import itertools from itertools import chain from moviepy.editor import VideoFileClip import skvideo.io from tqdm import tqdm import circsta...
23ea367357550300f2ed9c3c31336c977e570da9275f66468706edaeefddcc08
Python
24,283
752
# Kai Sandbrink # 2023-04-27 # This script analyzes Prolific Participants with different efficacy using neural networks # %% LIBRARY IMPORTS import numpy as np import pandas as pd import os, ast, glob import matplotlib.pyplot as plt import matplotlib as mpl import seaborn as sns import torch from ObserveBetEfficacyT...
d2e9f221a9dbbd708249c1a072392c711468cd03ef0e06e019b04a7ae13e881d
Python
24,286
706
import os import glob import cmat import pickle import math import collections from collections import Counter import numpy as np import pandas as pd import sklearn.model_selection import src.featurizer import wandb import tempfile import zipfile def replace_classes(y, replace_dict): if replace_dict: ret...
07e7bd9ebd614934dfa7c47f59df099ae76b2564a6dc37c5bfd91bedde3bf335
Python
24,291
383
import cv2, os, glob import numpy as np from PyQt5.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.preprocessing.pr...
bfad2c05c88983487b16c8f9fa42172d025c90717e38512729f867990f679e43
Python
24,298
759
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: # # Copyright 2022 The NiPreps Developers <nipreps@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may...
ac03572448372617f4e6c6ece7c8e186f5b88d49b0263d00eeb006d1cc291f50
Python
24,301
575
# -*- coding: utf-8 -*- # @Author : LG import os import platform import time from collections import OrderedDict from typing import Union import numpy as np import torch from PIL import Image from ISAT.segment_any.sam2.utils.misc import AsyncVideoFrameLoader from ISAT.utils.dicom import load_dcm_as_image osplatform...
3bd5c3bb1f852a74aea7f9f5b98543e26779dde298f8d9e52062000d4f1db242
Python
24,302
653
"""Reusable, non-interactive privacy and anonymisation functions. The functions in this module contain no GUI dialogs, terminal prompts, file pickers, or plotting side effects. They are shared by the command-line and browser interfaces. """ from __future__ import annotations from dataclasses import dataclass from i...
5a7336dcd7ab7b013ddd37267c19cc2ed94cfc24b044bb5f5e7c00f11a880166
Python
24,304
596
""" Utilities for motion and raster correction of resonant scans. """ import numpy as np import datajoint as dj from scipy import interpolate as interp from scipy import signal from scipy import ndimage from tqdm import tqdm from ..exceptions import PipelineException from ..utils.signal import mirrconv def compute_r...
45ae184cfa326c703367dd23f5a9cd497bf809163cfa63004982f9b1694b9eb6
Python
24,325
371
from train_AE import init_from_config from brainvoice.visualization import gen_spectrogram_cmap, plot_spectrogram_on_axis, save_borderless from brainvoice.spectrogram_utils import linearspectrogram, inv_linear_spectrogram, get_better_synth_hparams from brainvoice.waveform_utils import write_waveform from brainvoice.dat...
5351830f46a839596fc8822dad329e872a8b2281782b2cdab0d10969e59ee922
Python
24,368
935
# -*- coding: utf-8 -*- """Channel Estimation in OTFS and NOMA .ipynb Automatically generated by Colab. Original file is located at https://colab.research.google.com/drive/15yyB9BhgmOkvNJMxbi7VOCyKRn2tEhNc """ pip install numpy scipy torch scikit-learn matplotlib import numpy as np import torch import torch.nn ...