sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
a0164f3dab2ead960390fac72f9a076b0916c09d8daf75ad39cb8e520997cae3
Python
15,334
354
import numpy as np import pandas as pd import os import matplotlib.pyplot as plt import json def make_onset_timeseries(time, length): x = np.zeros(length) x[time] = 1 return x def make_kernels(tau_rise, tau_fall, timestep): """Make the kernel to convolve the onset timeseries.""" max_time = int(8...
39c974d7b50c9dc6b78ae92f4c83be3304bdcd0db19fe100dc7f96fc2d7a4043
Python
15,338
289
from zigzag.classes.hardware.architecture.memory_hierarchy import MemoryHierarchy from zigzag.classes.hardware.architecture.memory_level import MemoryLevel from zigzag.classes.hardware.architecture.operational_unit import Multiplier from zigzag.classes.hardware.architecture.operational_array import MultiplierArray from...
cda1f4282283e2d4c05d81295f7e26b83869af37de12b337980f1bb5abc790f8
Python
15,341
317
import h5py import numpy as np from ..exceptions import PipelineException from .eye_tracking import ANALOG_PACKET_LEN from .signal import mirrconv, spaced_max def read_behavior_file(filename): """ Reads hdf5 file with timestamps and analog signals. :param filename: path of the file. Needs a %d where multiple...
c6be042d47baac0734835ea13fbd3167d66391ca6eec1f666165a4a44d1a508e
Python
15,344
410
"""Tests for mcmlnet.experiments.data_loaders modules.""" import numpy as np import pytest import torch from torch.utils.data import DataLoader from mcmlnet.experiments.data_loaders.aggregation import ( aggregate_data_image_level, aggregate_data_subject_level, ) from mcmlnet.experiments.data_loaders.config im...
877cc34f5ed55d8eceac9efbf1a432313e34eb8eabc9537bae05aa77b93bcc6e
Python
15,354
374
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import numpy as np import torch from torchvision.ops.boxes import batched_nms, box_area # type: ignore from typing impor...
f4f7a9fa7f61880e165cc86ae3f803717c10558987d88c970440a60760a477e8
Python
15,365
356
import torch import torchvision import torchvision.transforms as transforms import random import numpy as np from torchvision.datasets import ImageFolder import os from torch.utils.data import Dataset from PIL import Image import glob from tqdm import tqdm datapath = './datafile' class SelectiveImageFol...
398d6bb0ce81f5327fed4afaed1d13be9f0b99e870c42c66ab7686e652be250b
Python
15,368
481
#!/usr/bin/env python import argparse import os import os.path as op import numpy as np import glob import nibabel as nib from pydesigner.fitting.dwipy import DWI from pydesigner.system.utils import writeNii from pydesigner.tractography import odf ''' python run_pydesigner_fit.py \ --dwi /Volumes/Flashy/HIE_FBI_...
e6e50defaa796d57b86b307c0c5e9b9155f06a61da27de7e18afe8846010ab55
Python
15,371
368
#!/usr/bin/python3 from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import json import logging import os import random import numpy as np import torch from torch.utils.data import DataLoader from model import KGEModel from dataloader impo...
1b14bfafe8bcdeead010b99f1a58adb675bf35efd4ad298611bafd3eb419e584
Python
15,386
495
# -*- coding: utf-8 -*- import itertools import multiprocessing from math import cos, radians from dipy.data import get_sphere import numpy as np from dipy.direction import peak_directions from dipy.reconst.shm import sh_to_sf_matrix from scilpy.reconst.utils import get_sh_order_and_fullness # Constants NB_PARAMS ...
c8d48ee096dc68048b7b51e173651fd586b498d46a2b5f9638c6ed70c2a5c766
Python
15,392
491
# Copyright (C) 2019-2022 Intel Corporation # Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT import inspect import os import os.path as osp import re import tempfile import zipfile from collections.abc import Generator, Iterable from contextlib import contextmanager from copy import deepcopy from d...
c3e1b688a6fd0a75ba2cd13257ccfd995010bb0d46fc8a6e29d4dfa0f4a72cf9
Python
15,399
488
""" Plotting functionality based on VTK. """ # Author: Oualid Benkarim <oualid.benkarim@mcgill.ca> # License: BSD 3 clause import os import warnings from collections import defaultdict import numpy as np from numpy.lib.stride_tricks import as_strided from vtk import vtkCommand import vtk.qt as vtk_qt from brainsp...
597aa804a70e2f6f0d94a2681ecf99e32f6fe777217b6c6f1f31f2ce3fa58e13
Python
15,407
394
"""Script to extract laminar resting state activity from digit ROIs""" import nibabel as nb import numpy as np import glob from nilearn.connectome import ConnectivityMeasure from nilearn import plotting import matplotlib.pyplot as plt import pandas as pd import seaborn as sns plt.style.use('dark_background') ROOT =...
40f504d4ef5e097faf54f8fbbe2c291e7d925a6171d2c01ab7f5e349a5315bce
Python
15,412
364
import tkinter as tk import numpy as np import math import json from collections import defaultdict from tkinter import messagebox import argschema as ags class DrawingEditSchema(ags.ArgSchema): input_file = ags.fields.InputFile( description="Path to input json file" ) output_file = ags...
a119982564983048282069f6b0f734f486508ce1d1b1c57c668a636aa6cb47d6
Python
15,414
453
# 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, ...
303e7f7dfc9ff6bfd4d4ab85f84b632956f37444764c7a3d31b728ac22c0dfc3
Python
15,415
390
import sys from pathlib import Path import os sys.path.append(str(Path(os.path.abspath(__file__)).parents[3])) import argparse import time from shutil import copy import torch import torch.nn.functional as F from torch.utils.data import DataLoader from ogb.linkproppred import PygLinkPropPredDataset, Evaluator from sk...
754ed2382f3477d5691a60e1c92458a9b6fa30366827cd16edcaa1cbd5e0c57b
Python
15,423
712
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Segment, mask and bin 'MB-KCc' files """ import os import matplotlib.pyplot as plt import numpy as np import mbflim.utils as ut import mbflim.visualization as vis import mbflim.image.image_processing as pro import mbflim.image.image_set_processing as setpro import ...
7b2586d1c37f008022ab93c7bb17655d9f3be0364f4cda95dbcaddb77fd112c8
Python
15,423
363
"""Pack a finished output folder into a ``.meanap`` bundle. Express mode writes a bundle because it never drew the figures. A normal run writes an output folder and nothing else — 111 MB and several hundred PNGs on a two-recording batch, against the ~3 MB of numbers every one of them was drawn from. So the question co...
bc0b3a4f91a1b250dfeee8e5b79e11dcebb72e61d01fb81ac948804d08671f00
Python
15,423
461
from __future__ import annotations from pathlib import Path import os import polars as pl import re import shutil import sqlclz from typing import NamedTuple, Annotated, Type, Literal, overload from neuralib.tools.gspread import upload_dataframe_to_spreadsheet, SpreadSheetName from neuralib.util.verbose import fprin...
4b5c6fc3b97e1c6e97d638374bfb4e04192547140358c3785793583a2eae3b6c
Python
15,428
372
import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D # 只为触发3D后端 import os def load_base_data(InputFolderName,graph_index,is_single_cell = True,fine_GT = False,coarse_GT = False): """ Load spatial coordinate and optional annotatio...
2fcf0e17b42f85d67ba1add107b13ab6a105c111d6dbf85b0cd3b919a1edfc4e
Python
15,429
469
""" Monte Carlo physical data generation script to test surrogate model generalization. This script generates physical parameter datasets for forward surrogate model evaluation on unseen distributions, using a hand-crafted sampling strategy for a three-layer tissue model. Sampling Strategies: - Three layer model with...
761c932eea6b052e90e56ad33eec46167870d3bcb863b6668c7ff5bbb08c8dad
Python
15,433
712
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Segment, mask and bin 'MB-KCc-cond' files """ import os import matplotlib.pyplot as plt import numpy as np import mbflim.utils as ut import mbflim.visualization as vis import mbflim.image.image_processing as pro import mbflim.image.image_set_processing as setpro im...
2955951ae8daf1144425ce6ac584fc6da5c575944fef7ed950013ab75be81b60
Python
15,439
378
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Script to compute all of the Diffusion Tensor Imaging (DTI) metrics. By default, will output all available metrics, using default names. Specific names can be specified using the metrics flags that are listed in the "Metrics files flags" section. If --not_all is set,...
c2ecb4ede4a1092a864260e604caa9f55e14e84ed6a19812750b8b5dc3a7af29
Python
15,441
302
import json import os from mako.template import Template from sympy.parsing.sympy_parser import parse_expr from sympy.printing import cxxcode def remove_parentheses(expr): if '(' in expr and ')' in expr: return expr[:expr.index('(')] else: return expr def post_process(curr, json_dir): un...
ea7bff627703a8f950a7e23e3e3abeccd63f720a4cd5ddfdc985444f745ad878
Python
15,442
409
"""The opt-in real-data tier. Skipped unless ``CCF_STREAMLINES_TEST_DATA`` names the directory holding the real assets, in the published layout:: <dir>/streamlines/surface_paths_10_v3.h5 <dir>/streamlines/closest_surface_voxel_lookup.h5 <dir>/view_lookup/*.h5 <dir>/cortical_metrics/cortical_layers_10_...
d76e9a333a90ee91b0090f5b63ffe08c3c0ee930debc049d2f3e4d8e17c108df
Python
15,449
428
import logging import numpy as np import pandas as pd from typing import Union from ..stats import stats from ..testing import correction from ..testing.det import _DifferentialExpressionTest class RefSets: """ Class for a list of gene sets. Input: 1. Read gene sets from file. 2. Give a list wit...
e4f26b10cd2c73f08772969dfd8d974ab6cc7ab76b1549036a615a93a44a06fd
Python
15,451
416
""" This script makes a plot of the rate differences between Actor (self) and Observer (other) conditions for 1R, 1NR, 2NR, and xNR (1NR + 2NR) trials. It first identifies neurons with a significant rate difference between Actor and Observer conditions (via rank-sum test) for each history type. The plot and subsequen...
aec0c62224e72377565c9b29149ecc5d53051308536396f5224a07ec0cd59ad0
Python
15,455
475
#!/usr/bin/env python # coding: utf-8 # In[1]: import sys def main(gene_familly): # <div style="hwidth: 100%; background-color: #ddd; overflow:hidden; "> # <div style="display: flex; justify-content: center; align-items: center; border-bottom: 10px solid #80c4e7; padding: 3px;"> # <h2 style="...
102e2d8c0cb8b16573c11121ee4e8b723acbe3cc652a870f98ba55035f551c13
Python
15,460
499
# -*- coding: utf-8 -*- """ Create some statistics to test significant changes in voxelized and labeled data TODO: cleanup / make generic """ #:copyright: Copyright 2015 by Christoph Kirst, The Rockefeller University, New York City #:license: GNU, see LICENSE.txt for details. import sys self = sys.modules[__name__];...
f70542fde86b031906d69c6918f2c2b7c950cc6e8dfd1b5a63dcd4d10ae89dd3
Python
15,468
320
import os import os.path as osp import torch import random import numpy as np from tqdm import tqdm import pandas as pd from glob import glob from torch_geometric.data import (Data, InMemoryDataset, download_url, extract_gz, extract_tar, extract_zip) from torch_geometric.data.makedirs...
8dbb5c9035a94b239556e7e1adb0f676c860060f69a4d62eac30cd3d1ee2b0a4
Python
15,469
283
# # fiberprofile/analysis/detect_flip.py # # Find the correction of the tensor frame that makes a diffusion tensor NRRD correctly oriented: a flip of x, y, z # (and their combinations) of the stored components, in the measurement frame of the header or in the frame of the # voxel axes (components estimated in v...
a262a2456135f46117eb0ec4fcf948b2157ed3c808c016ac24668c3f971fbbde
Python
15,470
352
""" (C) Copyright 2021 IBM Corp. 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 to in writing, software ...
9693b60b6f43187e828cc37d9c8de85f292c3c37763ee031097a612c9856e79b
Python
15,471
266
""" If you use this code, please cite the first SynthSeg paper: https://github.com/BBillot/lab2im/blob/master/bibtex.bib Copyright 2020 Benjamin Billot 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 ...
a56cfb47c5d7e41a4dcb22e56941598ab68ecb9cd6f2d32a2112eb098601712c
Python
15,476
416
# Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT import io import threading from logging import Logger from pathlib import Path import cvat_sdk.datasets as cvatds import PIL.Image import pytest from cvat_sdk import Client, models from cvat_sdk.core.proxies.annotations import AnnotationUpdateAction...
c390c0d6ef9a31c06821b6ddeac8c43a433b4736a109ae719043c3955a2fcead
Python
15,479
325
from typing import List import numpy as np from math import prod from zigzag.classes.hardware.architecture.memory_hierarchy import MemoryHierarchy from zigzag.classes.hardware.architecture.memory_level import MemoryLevel from zigzag.classes.mapping.temporal.temporal_mapping import TemporalMapping from zigzag.classes.o...
0358126953e6b34229283977c2757c3ac79691136b727ea311afa66c4efff712
Python
15,480
417
#pylint: skip-file #type: ignore """ Implementation of the simple task """ import time import math import typing import asyncio import logging import datetime import numpy as np import os import stl from ..qt import * from . import task_context from .widgets import Form, ListAsTabsWidget from .util import wait_for, ...
c345993f06cdf62777fc608902f2402290fd0ec2a0ada8807277686c7892ebd5
Python
15,488
369
import numpy as np import plotly.graph_objects as go import plotly.io as pio import pandas as pd import statistics import tensorflow as tf def generate_filt_sequences(stride:int, filter_size:int, feature_map_size:int) -> list: """Return a list of indices that the filter covers in one step. e.g. if the filter is ...
d9ed87956a99406e9334a8df3fef7c9bad6b0034330da284c1f970c98310892a
Python
15,491
409
import os from collections import OrderedDict from math import ceil import numpy as np import torch import h5py from scipy.spatial.distance import cdist from openbabel import pybel, openbabel from skimage.segmentation import clear_border from skimage.morphology import closing from skimage.measure import label from p...
1f50947ac590c1e03592bab6911f1dc9c54406df29fb2101a655b1ef7865c48d
Python
15,497
570
# The ImpedanceFitter is a package to fit impedance spectra to equivalent-circuit models using open-source software. # # Copyright (C) 2018, 2019 Leonard Thiele, leonard.thiele[AT]uni-rostock.de # Copyright (C) 2018, 2019, 2020 Julius Zimmermann, julius.zimmermann[AT]uni-rostock.de # # This program is free ...
0fee5e928b306c174992d5eaf21adf9a82d8d9674635c2b2f296b17d0d3fb12f
Python
15,498
431
import random import torch import pdb from pytorch_transformers import ( BertTokenizer,) import re def convert_dictionary_to_dict(char_map): return char_map.item2idx class BatchedData(list): def __init__(self,input): super().__init__(input) self.features = {} self.teacher_features = {} pass # features = ...
4c1dc9186de64b97564519a0d9bbbd866f76386fa926bbfc90e99efcb92cb6b2
Python
15,499
227
import pytest from pathlib import Path import tempfile import shutil from datetime import datetime from chemgraph.models.ase_input import ASEOutputSchema from chemgraph.tools.report_tools import generate_html # Sample ASE output data from the test file sample_ase_output = { 'converged': True, 'final_structure'...
bff837196d3c687ffcbc5c2d79c17ec8da63ae116427fcb15e0f6f7e372e0867
Python
15,499
321
#!/usr/bin/env python from __future__ import print_function import argparse import sys import os import json import csv import re import errno from collections import OrderedDict # Prints to stderr def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) def conditionInSamples(condition): for s i...
546cc726516969c156a4e86a196687d36b91941afcb7a54f456fe9b7d1e2fa7b
Python
15,500
318
#!/bin/python3 # Plot functions for neuronal and synaptic variables as well as spike raster plots # Copyright 2021-2024 Jannik Luboeinski # License: Apache-2.0 (http://www.apache.org/licenses/LICENSE-2.0) # Contact: mail[at]jlubo.net import numpy as np import matplotlib import matplotlib.pyplot as plt import json im...
7958d63374d3ede601e205f573bfe95de65c3f50e5464fec0fee3dece61b6e53
Python
15,502
314
import os import glob import seaborn as sns from scipy.stats import kendalltau, wilcoxon import numpy as np import pandas as pd import nibabel as nib import matplotlib.pyplot as plt from sklearn.feature_selection import VarianceThreshold from nilearn.maskers import NiftiMasker from sklearn.metrics import pairwise_dista...
c7efdbbf579fbd7c38161d223e1bb1acf8b3b1a6dd6f45bd391562301237441c
Python
15,505
327
#import base trainer so I can inherit from it from nnunetv2.training.nnUNetTrainer.nnUNetTrainer import nnUNetTrainer #import custom transform # from batchgeneratorsv2.transforms.custom.missing_modality_transform import MissingModalityTransform from batchgeneratorsv2.transforms.custom.missing_modality_transform_per_i...
dae016360cf7edc61ea023a8ace29c79a069deb9b7c41d42b13eca8ae1de2e3c
Python
15,508
327
#import base trainer so I can inherit from it from nnunetv2.training.nnUNetTrainer.nnUNetTrainer import nnUNetTrainer #import custom transform # from batchgeneratorsv2.transforms.custom.missing_modality_transform import MissingModalityTransform from batchgeneratorsv2.transforms.custom.missing_modality_transform_per_i...
12baca6d3e5e90027439e72ced204341780cb16014a6b3b7c26f7c6c03dfd6ce
Python
15,509
327
#import base trainer so I can inherit from it from nnunetv2.training.nnUNetTrainer.nnUNetTrainer import nnUNetTrainer #import custom transform # from batchgeneratorsv2.transforms.custom.missing_modality_transform import MissingModalityTransform from batchgeneratorsv2.transforms.custom.missing_modality_transform_per_i...
499915c54da49132f464fc1d3d1454de2ae98b083eae95a16471b90aa61fadcf
Python
15,509
327
#import base trainer so I can inherit from it from nnunetv2.training.nnUNetTrainer.nnUNetTrainer import nnUNetTrainer #import custom transform # from batchgeneratorsv2.transforms.custom.missing_modality_transform import MissingModalityTransform from batchgeneratorsv2.transforms.custom.missing_modality_transform_per_i...
61d33e7ac43cd301de28ea30684c0e7cfcb2f1291a52ae456cbc691fb0e6cca5
Python
15,509
327
#import base trainer so I can inherit from it from nnunetv2.training.nnUNetTrainer.nnUNetTrainer import nnUNetTrainer #import custom transform # from batchgeneratorsv2.transforms.custom.missing_modality_transform import MissingModalityTransform from batchgeneratorsv2.transforms.custom.missing_modality_transform_per_i...
6633a89c7e84c327b7f30aaaa01384867cf48050186f62ffe5ff0a5c209d56fa
Python
15,509
327
#import base trainer so I can inherit from it from nnunetv2.training.nnUNetTrainer.nnUNetTrainer import nnUNetTrainer #import custom transform # from batchgeneratorsv2.transforms.custom.missing_modality_transform import MissingModalityTransform from batchgeneratorsv2.transforms.custom.missing_modality_transform_per_i...
7c523c2f2166835e4fa5212eadd842de88379cbc8bb77ec9bde42f0525836b1e
Python
15,509
327
#import base trainer so I can inherit from it from nnunetv2.training.nnUNetTrainer.nnUNetTrainer import nnUNetTrainer #import custom transform # from batchgeneratorsv2.transforms.custom.missing_modality_transform import MissingModalityTransform from batchgeneratorsv2.transforms.custom.missing_modality_transform_per_i...
86f82cf6f68bdd8b798caba8e21259c873fd366e8adafac61b2c6733b19196f0
Python
15,509
327
#import base trainer so I can inherit from it from nnunetv2.training.nnUNetTrainer.nnUNetTrainer import nnUNetTrainer #import custom transform # from batchgeneratorsv2.transforms.custom.missing_modality_transform import MissingModalityTransform from batchgeneratorsv2.transforms.custom.missing_modality_transform_per_i...
8834d0e4e16af43cdea6cc3e6b744ab2d580a0621a796a882a1da6ef1e1cca26
Python
15,509
327
#import base trainer so I can inherit from it from nnunetv2.training.nnUNetTrainer.nnUNetTrainer import nnUNetTrainer #import custom transform # from batchgeneratorsv2.transforms.custom.missing_modality_transform import MissingModalityTransform from batchgeneratorsv2.transforms.custom.missing_modality_transform_per_i...
8edade34b20be7fb40df5950243cb01c276d30748aa7710a7b6b80ec5003c429
Python
15,509
327
#import base trainer so I can inherit from it from nnunetv2.training.nnUNetTrainer.nnUNetTrainer import nnUNetTrainer #import custom transform # from batchgeneratorsv2.transforms.custom.missing_modality_transform import MissingModalityTransform from batchgeneratorsv2.transforms.custom.missing_modality_transform_per_i...
ad81ecea6374cb494f4ce04f1d5ae4e43af6b4956f37e62264936cf24ca07176
Python
15,509
327
#import base trainer so I can inherit from it from nnunetv2.training.nnUNetTrainer.nnUNetTrainer import nnUNetTrainer #import custom transform # from batchgeneratorsv2.transforms.custom.missing_modality_transform import MissingModalityTransform from batchgeneratorsv2.transforms.custom.missing_modality_transform_per_i...
b7fc462b8903bbc3381429b1b207e775dff47514be31eef189f89fb74c3efa4c
Python
15,509
327
#import base trainer so I can inherit from it from nnunetv2.training.nnUNetTrainer.nnUNetTrainer import nnUNetTrainer #import custom transform # from batchgeneratorsv2.transforms.custom.missing_modality_transform import MissingModalityTransform from batchgeneratorsv2.transforms.custom.missing_modality_transform_per_i...
c2fe62a45accfbaecbecf31c4f9eb42dcd397057555bdab29677b39c0dcabbb4
Python
15,509
327
#import base trainer so I can inherit from it from nnunetv2.training.nnUNetTrainer.nnUNetTrainer import nnUNetTrainer #import custom transform # from batchgeneratorsv2.transforms.custom.missing_modality_transform import MissingModalityTransform from batchgeneratorsv2.transforms.custom.missing_modality_transform_per_i...
d5964bed8a79ab5d39306ccaceb4b86a7c2932562fb314892f644b12458eb633
Python
15,509
327
#import base trainer so I can inherit from it from nnunetv2.training.nnUNetTrainer.nnUNetTrainer import nnUNetTrainer #import custom transform # from batchgeneratorsv2.transforms.custom.missing_modality_transform import MissingModalityTransform from batchgeneratorsv2.transforms.custom.missing_modality_transform_per_i...
db5d5635685f533473d9cdf92f43aebab4c91065b839d1be28e9350ac9515ddb
Python
15,509
327
#import base trainer so I can inherit from it from nnunetv2.training.nnUNetTrainer.nnUNetTrainer import nnUNetTrainer #import custom transform # from batchgeneratorsv2.transforms.custom.missing_modality_transform import MissingModalityTransform from batchgeneratorsv2.transforms.custom.missing_modality_transform_per_i...
35c408fcb6fb4f17a492f7685e09a34939922d8afe66f74c70b427fde3fe6eaf
Python
15,510
327
#import base trainer so I can inherit from it from nnunetv2.training.nnUNetTrainer.nnUNetTrainer import nnUNetTrainer #import custom transform # from batchgeneratorsv2.transforms.custom.missing_modality_transform import MissingModalityTransform from batchgeneratorsv2.transforms.custom.missing_modality_transform_per_i...
90d8a96243686994d78248e9a54753ed7b2c721342684c3f4066c8c9aec4b206
Python
15,510
345
#!/usr/bin/env python # author: Jannes Spangenberg # e-mail: jannes.spangenberg@uni-jena.de # github: https://github.com/JannesSP # website: https://jannessp.github.io import pandas as pd import numpy as np import matplotlib.pyplot as plt import read5_ont import pysam import seaborn as sns from argparse import Argumen...
1f74182a37e92b5228c5165610f3f578ebb32abd81959774aa56173e2f20ee2a
Python
15,511
402
""" Loader Factory, Fast Collate, CUDA Prefetcher Prefetcher and Fast Collate inspired by NVIDIA APEX example at https://github.com/NVIDIA/apex/commit/d5e2bb4bdeedd27b1dfaf5bb2b24d6c000dee9be#diff-cf86c282ff7fba81fad27a559379d5bf Hacked together by / Copyright 2019, Ross Wightman """ import logging import random from...
618796f02cdb8946d188407df590ab08ac223bcb9ba7247e109654c0f274459c
Python
15,512
456
# Copyright 2014-2015 Numenta Inc. # # Copyright may exist in Contributors' modifications # and/or contributions to the work. # # Use of this source code is governed by the MIT # license that can be found in the LICENSE file or at # https://opensource.org/licenses/MIT. import datetime import itertools import numpy imp...
c20f6572353f3052a517b56b140073cfbf69397e7c497839ad29d47bfda6cb4b
Python
15,512
413
#!/usr/bin/env python # Copyright (c) 2026 Rohit Jena. All rights reserved. # # This file is part of FireANTs, distributed under the terms of # the FireANTs License version 1.0. A copy of the license can be found # in the LICENSE file at the root of this repository. # # IMPORTANT: This code is part of FireANTs and its...
00167fcac52bc15c0c2ec575fe33d9fb5dd7ceafdae1afce204a58130648bf5c
Python
15,517
456
# Copyright 2014-2015 Numenta Inc. # # Copyright may exist in Contributors' modifications # and/or contributions to the work. # # Use of this source code is governed by the MIT # license that can be found in the LICENSE file or at # https://opensource.org/licenses/MIT. import datetime import itertools import numpy imp...
4c440a90b9da608c4d4bd9bfcec4e340c87c90c3f6e36f05f48d29e1ec8a1db3
Python
15,520
375
import torch from torch import Tensor import torch.nn as nn #from .._internally_replaced_utils import load_state_dict_from_url from typing import Type, Any, Callable, Union, List, Optional __all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101', 'resnet152', 'resnext50_32x4d', 'resnext101_32x8...
d67d06e8aa98941a75acee256f1c7515093e5f0267ab3e963b10408c5ef4deff
Python
15,523
299
import itertools import logging from collections import Counter import numpy as np import scipy.stats import xarray from numpy.random.mtrand import RandomState from scipy.stats import pearsonr from brainscore_core.supported_data_standards.brainio.assemblies import walk_coords, DataAssembly from brainscore_core.metric...
7d0d71464baa5afc3c61aa5312decc3c3024ff683334b0b3da25253a22c2e1d2
Python
15,526
417
from typing import Any, Literal, Union import torch from eir.predict_modules.predict_tabular_input_setup import ( ComputedPredictTabularInputInfo, ) from eir.serve_modules.serve_schemas import ComputedServeTabularInputInfo from eir.setup.input_setup import al_input_objects_as_dict from eir.setup.input_setup_modul...
8219546b2c521a84af482923d5e80792d5c95083043047480630252d0683ec15
Python
15,526
343
#!/usr/bin/env python """ (single) focus lock. Hazen 04/17 """ import importlib from PyQt5 import QtCore, QtWidgets import storm_control.sc_library.parameters as params import storm_control.hal4000.halLib.halDialog as halDialog import storm_control.hal4000.halLib.halMessage as halMessage import storm_control.hal400...
f54289758fb1987a5a5ee2e676f1d2b564774f2fa447de3297d9de3bea251304
Python
15,526
450
import shutil import numpy as np import pandas as pd import hail as hl # from memory_profiler import profile from hail.linalg import BlockMatrix from scipy.sparse import csr_matrix, save_npz, load_npz from heig.utils import log_execution_time from heig.wgs.utils import * """ TODO: 1. Merge multiple sparse genotype dat...
e783efaa84215001aa54f3ee463c18754971f95524def229ac3a3cb4ceb2dcbb
Python
15,531
293
from qtpy.QtGui import QAction from qtpy.QtWidgets import QMainWindow, QMenu, QFileDialog, QApplication from napari_dmc_brainmap.results.probe_vis.probe_vis.view.MainWidget import MainWidget # from napari_dmc_brainmap.preprocessing.preprocessing_tools import adjust_contrast, do_8bit from napari_dmc_brainmap.utils.atl...
005f9242f787d81089c9f80170ad4e90bec744a467d2bf25619d31006ea7b531
Python
15,534
425
""" 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...
748bf794c848625b12d6d5fc5cac8d0d53d38ea96620157c8bf64533a0a3b045
Python
15,534
472
""" This script makes behavior plots for the paper, for the two-player monkey task. """ import sys import os sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from pathlib import Path import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl import matplotlib.ticker as...
fb7956daf56bdf85859579983df7435c3d55958ce267f077cb2f5088c291a1ea
Python
15,537
433
import torch import torch.nn as nn import torch.nn.functional as F import file_util import rangezero_statis # Model for RM-ResNet thresh = 0.5 # neuronal threshold lens = 0.5 # hyper-parameters of approximate function decay = 0.25 # decay constants num_classes = 1000 time_window = 4 device = torch.device("cuda:0" ...
77692584b769a284251dc61633e284f09b3843ece03043f0c3a5e7013d25645d
Python
15,538
437
# -*- coding: utf-8 -*- """Compute metrics from fMRI time series.""" import datetime import os import nibabel as nb import numpy as np from scipy.stats import zscore from ..io.filename import get_filename from ..matlab import MatlabCommand from ..processing.behavior import get_onset_vols __all__ = ["compute_psc", "...
b4bf82e315e50656e1173549566eb37ce45a30680cb696ddc8f96315c8293b87
Python
15,542
391
import glob import os import sys from argparse import ArgumentParser import numpy as np import torch import torch.utils.data as Data from Functions import generate_grid, Dataset_epoch, transform_unit_flow_to_flow_cuda, \ generate_grid_unit from miccai2020_model_stage import Miccai2020_LDR_laplacian_unit_add_lvl1,...
edc15fb6dd0604c3450305d975c98c9e1cf2fbd6fd9d2cd05d64b6e731acda09
Python
15,543
453
#!/usr/bin/env python import os import subprocess import ruamel_yaml as yaml import configure_seaborn as cs import matplotlib.lines as mlines import matplotlib.pyplot as plt import networkx as nx import numpy as np import seaborn as sns import utils as utils from matplotlib.gridspec import GridSpec from matplotlib.p...
47c4d898ff901be8d4335a975a3705a3d6049b6247bc950b870340d2bfce0b69
Python
15,545
389
# Copyright 2024 BDP Ecosystem Limited. 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 applicab...
3e9f0efd6a6b5a020b281bed09e4df5b92834dc64a8af41a79d49494359e2986
Python
15,560
393
#!/usr/bin/env python # -*- coding: utf-8 -*- # *************************************************************************** # # Copyright © 2022, UChicago Argonne, LLC # # All Rights Reserved # # Softwar...
c0646beb82423e969b860c65fb75fe68ac3c4cd2ca79017635fd1afb5b72d1c6
Python
15,563
375
import unittest import pandas as pd from sklearn.linear_model import LogisticRegression from sklearn.exceptions import NotFittedError from causallib.positivity import ( Trimming, UnivariateBoundingBox, Matching ) from causallib.positivity.univariate_bbox import ( QuantileContinuousSupport, Support, Continuous...
1e33661c5d47810831e7e5e07038018c13069aaa1f6250d7750a1e619654f8da
Python
15,565
343
# import matplotlib.pyplot as plt import numpy import os import SimpleITK as sitk import yaml import copy import traceback from dipy.core.gradients import gradient_table from dipy.data import load_nifti, get_sphere, default_sphere from dipy.direction import peaks_from_model from dipy.io.gradients import read_bvals_bv...
63d2d9ae55de5423fd42e6536775ac9bbfbb44cb07f7e0ce0581b0541246c644
Python
15,570
344
#!/usr/bin/env python """ (single) focus lock. Hazen 04/17 """ import importlib from PyQt5 import QtCore, QtWidgets import storm_control.sc_library.parameters as params import storm_control.hal4000.halLib.halDialog as halDialog import storm_control.hal4000.halLib.halMessage as halMessage import storm_control.hal400...
b2048f5c1a9b87b003642b78ce4676d740b3f552836f72fb4e9b7b41e048d27a
Python
15,570
433
import random import torch import pdb from pytorch_transformers import ( BertTokenizer,) import re def convert_dictionary_to_dict(char_map): return char_map.item2idx class BatchedData(list): def __init__(self,input): super().__init__(input) self.features = {} # token features self.img_features = {} self....
9e10c6ddd1bea91b14aeb50a9d0530ae09e7ef2d7e0ca6dff3abbc8240d48da3
Python
15,572
351
import unittest import pandas as pd import numpy as np from sklearn.linear_model import LogisticRegression, LinearRegression from sklearn.ensemble import GradientBoostingRegressor, GradientBoostingClassifier from sklearn.model_selection import GridSearchCV from causallib.estimation import IPW from causallib.estimatio...
1e0dec8d5aa0014a7d941505181d19c30f95a3f93254b75abec51f40b9c4a8e8
Python
15,577
416
from typing import Any, Literal, Union import torch from eir.predict_modules.predict_tabular_input_setup import ( ComputedPredictTabularInputInfo, ) from eir.serve_modules.serve_schemas import ComputedServeTabularInputInfo from eir.setup.input_setup import al_input_objects_as_dict from eir.setup.input_setup_modul...
f76b1d811dc1830c93bd3500cd6f8ccd271d2c1e52b74ed7d4e03d57f7c797dd
Python
15,580
324
#Type something like this from within python: ARGS="2015_04_07_02 M 30 none 10.5 DM -1" #template: ARGS="filename sex age drugs theta region estradiol" #then type: execfile('PopSpikeAnal.py') #If not in python, type: python PopSpikeAnal.py 031011_5Or M 30 none 10.5 DM import os #if running from windows, might ne...
d77676f7ce29e297783db134e80ad82054200f6adc012200fdb6a56413231189
Python
15,583
480
# This is to store functions for visualisation and plotting. import numpy as np import matplotlib.pyplot as plt from lapy.plot import _get_color_levels, _map_z2color import plotly import plotly.graph_objs as go def _get_colorscale(vmin, vmax): """Put together a colorscale map depending on the range of v-values. A...
96e5c7b8ee45b042ee3578bb314c56b2c2c1129b171c69594ea6ad292a1697d7
Python
15,592
550
import math from typing import Union import tensorflow as tf """ An Exchange-Correlation (XC) functional class collecting ingredients for training neural-network-LMF based XC models in density functional theory. This class implements: 1. PBE exchange (with optional Hirao range-separation). 2. B95 or B97 corr...
362a876beaf46afa3997fcce221f59ab6adc24c5e4bd559a5270e0dba98564f5
Python
15,593
308
''' embeddings::plot.py General purpose plotting functions that may be useful for working with the embeddings we are creating. Available as embedding.plot.* ''' from .internal import * from .func import compute_dissimilarity_matrix import numpy as np import pandas as pd import matplotlib.pyplot as plt import sklearn ...
4ff581f2fc73853a81bded10eb2abe7ec0c788b2de44a5d60cb792ee0b71974a
Python
15,593
369
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Visualize 2-dimensional fODF slice loaded from disk. Given an image of SH coefficients, this script displays a slice in a given orientation. The user can also add a background on top of which the fODF are to be displayed. Using a full SH basis, the script can be used ...
268a7030bc086c5388331ed40b1d14f0b2121062dd24054c3debf9ac3e112cf3
Python
15,594
399
# fmt: off # flake8: noqa """Track Every Thing Accuracy metric.""" import numpy as np from scipy.optimize import linear_sum_assignment from .. import _timing from ._base_metric import _BaseMetric EPS = np.finfo("float").eps # epsilon class TETA(_BaseMetric): """TETA metric.""" def __init__(self, exhaust...
65bae8c5d4e2584dddf770a7db3eb81eaa57af61cdfc1ad042fdac8e0248cffc
Python
15,604
352
#!/usr/bin/env python3 """ Main manuscript - Figure 5: Axon packing models with different volume fractions First row: Axon model compartmentalization masks showing intra-axonal, myelin, and extra-axonal spaces Second row: Fieldmaps for θ=0° (fibers parallel to B0) Third row: Fieldmaps for θ=90° (fibers perpendicular t...
bc709732f3cdb65344bd222eeb9abe4d73cd0b06d043a3a2fa0de321471056be
Python
15,605
397
################################################################################## ### Module : dmriatlasbuilder.py ### Description : Atlasbuilder api ### ### ### ### Written by : scalphunter@gmail.com , 2022/10/08 ### Copyrights reserved by NIRAL #######################################################################...
19df650df34c530d75dca4f5feb655482e7bc6a0102ed815578ee7f91b1c430e
Python
15,606
435
""" 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 # third party import n...
87fcb51dbaf05bdd452cb82f01c3c693c3e85774aab602580a81221c2e3b0efc
Python
15,610
384
import torch from torch import Tensor import torch.nn.functional as F import torch.nn as nn import math from math import floor, ceil from torch.hub import load_state_dict_from_url from typing import Type, Any, Callable, Union, List, Optional __all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101', ...
f720fa55be3e3088ba56aa9efc2f55018846b516ceb646e474a1e5ce03e7598d
Python
15,611
416
"""Rich-based display helpers for the ChemGraph CLI. This module handles all terminal rendering: banners, tables, response formatting, and API-key status display. """ from __future__ import annotations import json import os import re from difflib import unified_diff from typing import Any from rich.align import Ali...
8533ca65dd2b641175fa233aa4bf72dffa506f9f40987bdef2645fa7633e08a0
Python
15,612
435
# Configuration file for the Sphinx documentation builder. # This file uses modern Sphinx 9.0+ configuration with PyData Sphinx Theme # # For the full list of built-in configuration values, see: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup --------------------------------------------...
38234095e1a0fa2578e51cc8bfffb6705f4242b5ba925ce9a27ef7f06698d228
Python
15,617
380
from __future__ import division import numpy.ma as ma import numpy as np import scipy as s import math from mofapy2.core.utils import * from mofapy2.core import gpu_utils from time import time # Import manually defined functions from .variational_nodes import BernoulliGaussian_Unobserved_Variational_Node from .variat...
1b9b45fc73b0ab846d204998f8c007f4443a9da68741524a062d39d94559f02d
Python
15,618
346
""" This file contains functions to handle keras/tensorflow tensors. - blurring_sigma_for_downsampling - gaussian_kernel - resample_tensor - expand_dims If you use this code, please cite the first SynthSeg paper: https://github.com/BBillot/lab2im/blob/master/bibtex.bib Copyright 2020 Benjamin Billot...
41195a5b3c4ed31604922a7e7d7ffab41dfa9a7e6bf45f4a0e2bd177b6e274ff
Python
15,618
349
"""Packing a finished output folder into a bundle, after the run. A bundle used to be reachable only through express mode, which is a decision made *before* the analysis starts. So a full run that turned out to be worth emailing — 111 MB of PNGs against the ~3 MB they were drawn from — had no route to the shareable fi...
f0acaec347aa87da0583ecde2022b2ec0ba5c2076861cc20a0970cb055b47dce
Python
15,621
401
from brainscore_core.supported_data_standards.brainio.assemblies import BehavioralAssembly from brainscore_vision import data_registry, stimulus_set_registry, load_stimulus_set from brainscore_core.supported_data_standards.brainio.s3 import load_assembly_from_s3, load_stimulus_set_from_s3 BIBTEX = """TBD""" # circle_...