sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
bb8b861b9ae2baccae8d30ad538f949f60e4b86880be75e2db6fcfaa2352455a
Python
7,945
196
# File to generate a blender FBX from the SEEG data # Load libraries import argparse import os import bpy import numpy as np import pandas as pd import matplotlib.pyplot as plt import scipy.signal as signal from sklearn.preprocessing import normalize from segmentation import export_probes_as_obj, segment_electrodes, el...
d7bc370d622a2b881e3c14cd62288c0a2bc0c465007ece124953eb4a1e453a19
Python
7,948
247
# # MIT License # # Copyright (c) 2022 GT4SD team # # 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,...
d090531a04e7cc9e4093b80a2de12a321d3b019d559e2dab950e53e0ea0536b4
Python
7,949
178
# -*- coding: utf-8 -*- from __future__ import print_function import os from .util import DRIVER_DIR PORTFOLIO_DIR = os.path.join(DRIVER_DIR, "portfolios") ALIASES = {} ALIASES["seq-sat-fd-autotune-1"] = [ "--evaluator", "hff=ff(transform=adapt_costs(one))", "--evaluator", "hcea=cea()", "--evaluator"...
55848985831630649bc8a656ef3512e4fc0a28931fb25c3802c0147a8885725d
Python
7,950
192
import cc3d import numpy as np import cv2 as cv import matplotlib.pyplot as plt import SimpleITK as sitk from tiffile import imread, imwrite from skimage.measure import label, regionprops from skimage.transform import warp from scipy.interpolate import RBFInterpolator from scipy.spatial.distance import cdist class Po...
99131aaf89cf1a520d2c2af77713a0aafe90ade121c19c36e0cb7da9f18e6e88
Python
7,950
249
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # 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...
33e1900727516473978a78c1d99731869ff40a35f6bc937149763086732550e9
Python
7,952
187
import math import os import shutil from multiprocessing import Manager from typing import Any, Callable, Union from joblib import Parallel, delayed from tqdm import tqdm from torcheeg.io import EEGSignalIO, MetaInfoIO def _set_files(**kwargs): root_path = kwargs.pop('root_path', '.') # str num_samples_per...
be1968a4fef12c765ef2e8ffa9e17c40018cc41fab0351b00c0fc1fd416c077a
Python
7,954
143
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # 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 # # ht...
138501e93cc73446540854d4f4f3f2d5a745add8930559362c38ac42dc3d4e03
Python
7,958
109
"""FLYVIS_CENSUS.py 2026-10-05. Pre-registered: 04-NOTES/PREREG-2026-10-05d-FLYVIS-CENSUS.md (sha in .sha256 next to it). Sign census in Lappalainen et al.'s connectome-constrained visual system models (flyvis 1.2.0, ensemble flow/0000): reverse each source cell type's signs, measure T4/T5 direction selectivity on movi...
29175879e709c02bab6a465a7caf64070d963fb98f781d4ce6ec2bc0030da6c0
Python
7,960
250
"""Schemas for storing thermo data.""" from __future__ import annotations from logging import getLogger from typing import TYPE_CHECKING, cast from ase.thermochemistry import HarmonicThermo, IdealGasThermo from ase.units import invcm from emmet.core.symmetry import PointGroupData from pymatgen.io.ase import AseAtoms...
e03ad909e0155b099e8ac234da1956ecdf4b296ca8fea5e56c12f847452899ac
Python
7,962
226
import numpy as np import pyqtgraph as pg import pyclamp.gui.pyqtplot as pq from pyclamp.dsp.lsfunc import * from pyclamp.dsp.fpfunc import * from pyclamp.dsp.fpanal import * from pyclamp.gui.xyfunc import * from pyclamp.gui.pyplot import * from pyclamp.gui.pydisc import * class pywavescattabl (pywavescat) : # combine...
e6c027971b09d4ec01a5029ccee0c9b440603eae62e1bac158511025bcd8a2ea
Python
7,962
255
"""""" """ Prosper_nn provides implementations for specialized time series forecasting neural networks and related utility functions. Copyright (C) 2022 Nico Beck, Julia Schemm, Henning Frechen, Jacob Fidorra, Denni Schmidt, Sai Kiran Srivatsav Gollapalli This file is part of Propser_nn. Propser_nn is free softw...
43b2d0100df4d6be0fb3b0e7b3267850d40594f33ca7b987a9f668a2456977d6
Python
7,964
190
import torch.nn as nn import torch.nn.functional as F import torch class ATCNet(nn.Module): r''' ATCNet: An attention-based temporal convolutional network for EEG-based motor imagery classification. For more details, please refer to the following information: - Paper: H. Altaheri, G. Muhammad and M. Alsu...
4641b612f2ca784520655f8fdfad98f901f9edd3263aa7b4efc998556f119386
Python
7,965
183
# # MIT License # # Copyright (c) 2022 GT4SD team # # 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,...
6db8bd998db8aee926fd8fb901ce7dba657e546fcd6f475a0b206d4577d0bbbe
Python
7,965
215
from __future__ import annotations import logging from pathlib import Path import numpy as np import pytest from ase.build import molecule from ase.calculators.emt import EMT from ase.units import invcm from monty.json import MontyDecoder, jsanitize from monty.serialization import loadfn from quacc.schemas.thermo im...
a35c895d0ce0183a813dd26ac673d3ec83b741cc713d616c5cbcdab1d9730d43
Python
7,965
217
# Import required libraries import numpy as np import random # Define global variables MIN_WAVENUMBER = 0.1 MAX_WAVENUMBER = 2000 def key_parameters(a=5, b='b'): """ Define key parameters based on input case. Returns: tuple: (min_features, max_features, min_width, max_width) """ # Define ...
bfeeba93def42f2db5221dc40bf7d0cce6efd912ef9c7908b9a0c3ab1e0c059a
Python
7,965
221
import csv import gc import gzip import os import pickle from datetime import datetime, UTC from codex.data.neuron_data_initializer import ( initialize_neuron_data, NEURON_DATA_ATTRIBUTE_TYPES, ) from codex.data.versions import DEFAULT_DATA_SNAPSHOT_VERSION, DATA_SNAPSHOT_VERSIONS from codex.utils.networking i...
2fe1b57378c2407171c56e88389e9b7055c9ce0167110a8371e66fe7f4dbe0ed
Python
7,967
255
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # 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...
7f13a7262c9b8ade2655d53f2fb4e7191f30ff99a14207f880271d38af696640
Python
7,968
174
import argparse from loader import BioDataset import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from tqdm import tqdm import numpy as np from model import GNN from sklearn.metrics import roc_auc_score import pandas as pd from util import ExtractSubstructureContextPair ...
74c885412bd898056f58dee0f36197e5a7c6ee64abf22fe22bacf661b12acb7a
Python
7,970
215
import multiprocessing as mp import os from functools import partial import numpy as np import tqdm from skimage import measure try: import ray except ImportWarning: pass from plantsegtools.utils import filter_2d_masks, smart_load, relabel_segmentation def mask2mesh(mask, mesh_processing=None, voxel_size=(...
595f8ea3786c92f4b847f235aee884049b1d61308aa0b1750ba21faa575374f5
Python
7,971
210
"""Qualitative comparison of static M/EEG resting-state networks """ # Set up dependencies import os import numpy as np from sys import argv from osl_dynamics.analysis import static, power, connectivity from osl_dynamics.data import Data from utils.data import load_data, save_data, get_raw_file_names from utils.stati...
06b4dfb8ffe2a6c750541d517eea369c307a73ea095d61bd809900e9edf181c3
Python
7,973
231
import torch import torch.nn as nn import torch.nn.functional as F from torch_geometric.nn import global_mean_pool from torch.nn.modules.batchnorm import _BatchNorm import torch_geometric.nn as gnn from torch import Tensor from collections import OrderedDict ''' MGraphDTA: Deep Multiscale Graph Neural Network for Exp...
4069038bb1cddd1ca896f4575e52b1d9a7d5360a82918d05153ae8776d61f63c
Python
7,973
231
import torch import torch.nn as nn import torch.nn.functional as F from torch_geometric.nn import global_mean_pool from torch.nn.modules.batchnorm import _BatchNorm import torch_geometric.nn as gnn from torch import Tensor from collections import OrderedDict ''' MGraphDTA: Deep Multiscale Graph Neural Network for Exp...
683bbd043a047226a96274c23e8f8d823fd1aee3b81f227c15acb2b7dbbef5ed
Python
7,973
231
import torch import torch.nn as nn import torch.nn.functional as F from torch_geometric.nn import global_mean_pool from torch.nn.modules.batchnorm import _BatchNorm import torch_geometric.nn as gnn from torch import Tensor from collections import OrderedDict ''' MGraphDTA: Deep Multiscale Graph Neural Network for Exp...
d890db22c6cb7ed8f837f4f9f842af6b4f23793132703a157f4a7b89b171c074
Python
7,973
231
import torch import torch.nn as nn import torch.nn.functional as F from torch_geometric.nn import global_mean_pool from torch.nn.modules.batchnorm import _BatchNorm import torch_geometric.nn as gnn from torch import Tensor from collections import OrderedDict ''' MGraphDTA: Deep Multiscale Graph Neural Network for Exp...
5fc63cc2bf6092b9525792e1e9e578a3ecc0be35ac1709f7a6168d448c3079ff
Python
7,974
230
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import logging import os from collections import defaultdict from fvcore.common.file_io import PathManager from datasets.ava_eval_helper import read_exclusions logger = logging.getLogger(__name__) FPS = 30 AVA_VALID_FRAMES ...
f2d7937753fd3c92aecd34ebf56913b957f862caf167f990eac3a71c413e7aa4
Python
7,974
215
from scipy import io, sparse import os import pandas as pd import numpy as np class SingleData(object): """ A single modality of a single dataset Parameters ---------- feature_name Name of the modality dataset_name Name of the dataset feature Array of length F co...
0dd83b424a1cc10f26acee82591ff899a76dd9ce40dac7275fcb23d4ce65e845
Python
7,977
197
# # MIT License # # Copyright (c) 2022 GT4SD team # # 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,...
94f558896b12b84817b77b399ad7cead4fc98b8d171007a5a80860ab4d7e0b41
Python
7,977
308
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # 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...
9b553a1c28d970c30667c82de45ad9c0ee779e616e01a889fd75e5501e0820b2
Python
7,977
219
import logging from pathlib import Path import numpy as np import numpy.testing as npt import pandas as pd import pytest from vascpy import PointVasculature import astrovascpy.utils as test_module from astrovascpy.exceptions import BloodFlowError L = logging.getLogger(__name__) TEST_DIR = Path(__file__).resolve().p...
4559d20c66456f2fbac30aca212fd1305b4246f26240cb1573ddd5612bebc31d
Python
7,979
222
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # 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...
82ee1ac5d505eeba1588a30ded3e71699f9d4b3c84f2e5282f34075bcc2e509f
Python
7,980
217
from functools import partial import numpy as npo # original numpy from numpy.lib.stride_tricks import as_strided import autograd.numpy as np from autograd.extend import defvjp, primitive @primitive def convolve(A, B, axes=None, dot_axes=None, mode="full"): if dot_axes is None: dot_axes = [(), ()] ...
b62c77b1f93dd99194ed3faaed0873d4bc50ece4c675532ca9f2ff4bb1083cbd
Python
7,980
201
import torch import json from datasets.utils import * class SrcLang: def __init__(self, vocab_path): self.word2index = {} self.word2count = {} self.index2word = [] self.n_words = 0 self.get_vocab(vocab_path) self.class_tag = ['[PAD]', '[GEN]', '[POINT]', '[NUM]', '[...
25afb8045a779f0e23d89bcdaab7bab2c6942ffef7ad6ea7dccad1767ccde10f
Python
7,981
164
############################################ ######## Inference Prod Conditional ######## ############################################ #%%# Catalyzer # import re import numpy as np # import numba # from scipy import interpolate import torch from sbi.inference import SNPE from sbi import analysis import time import m...
1b98a54716c76fb2b2d26c374cec53180107364b3cc0d49734725d4c7379ff02
Python
7,982
188
import unittest import os import pandas as pd import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../src") from hornet.model import train class TestTrainFunction(unittest.TestCase): def setUp(self): self.path = ".output_test_train" self.input_path = ".input_test_train" ...
31d1de1bf36fb34bb4fcd77ea3ea73e4b63cf7aa42adf73158b5c9da86ea0956
Python
7,983
266
import sys import time, datetime from os.path import join, dirname import json from collections import namedtuple from math import ceil from tqdm import tqdm from tqdm.utils import disp_len, _unicode import numpy as np from .mpi import is_master class mytqdm(tqdm): def __init__(self, iterable=None, **kwargs): ...
7e262d28388a88d53fa15368df6fb9840517a8dc5f8f6dd07684063a54b7d40f
Python
7,985
213
import os import torch import time from core.utils import * from datasets.meters import AVAMeter def train_ava(cfg, epoch, model, train_loader, loss_module, optimizer): t0 = time.time() loss_module.reset_meters() l_loader = len(train_loader) model.train() for batch_idx, batch in enumerate(train_...
f86f24ba440ee054aeebf6733cf8e41cb699cf0058d3346cecb9222bd662c80b
Python
7,985
260
# -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Path setup ------------------------------------------------------------...
76773dd3e90927c4a5cbc76cb6c6a4e11c1e8f2e95e4a9a162659c529923abba
Python
7,988
172
"""Driving the two-point midline from actual mouse clicks. ``begin_midline_drawing`` / ``_on_midline_click`` and the ``from_two_points`` geometry already exist and are pinned by ``test_midline_two_point_draw.py``. What was missing is everything between a user's mouse and that arithmetic: nothing in the panel was ...
aa32c6d43ecb82c372cd3bff79e8706c563b8bdc468059350e77ad9ace735300
Python
7,992
205
""" Transfer Learning from MAHNOB-HCI to DEAP ========================================= In this tutorial, we demonstrate how to use TorchEEG to implement transfer learning with a Continuous Convolutional Neural Network (CCNN) model. We'll train our model on the MAHNOB-HCI dataset and then apply it to the DEAP dataset....
b875295b598a6c8d071191f2d4a64499271493b6702897c1d9f6901d81cae164
Python
7,993
208
import bct import networkx as nx import numpy as np from tqdm import tqdm from sklearn.utils import check_random_state def strength_preserving_rand_sa_dir(A, rewiring_iter = 10, nstage = 100, niter = 10000, temp = 1000, frac = 0.5, ...
0b9da28720e59a08099005deb3975c69aab4642e780d9ab5ba3df3d74c30e714
Python
7,994
253
import numpy as np from numpy.typing import NDArray from scipy import signal def aud_space_bw( fmin: float, fmax: float, bw: float = 1.0, scale: str = "erb", ) -> NDArray: """Auditory scale points specified by bandwidth. It computes a vector containing values equidistantly scaled between frequ...
18c9a29373c96aa5733588a707a2fc0885ae462eba05db0c60d175cfd7c4adb1
Python
7,995
308
import math import numpy as np import scipy.signal import scipy import matplotlib.pyplot as plt import matplotlib.cm as cm from scipy.signal import blackmanharris, correlate import scipy.ndimage from sklearn.cluster import AgglomerativeClustering from sklearn.metrics import silhouette_samples, silhouette_score def fin...
2708a0f21ff58ce63167aa5958c5d429ba1774befd7a1467d00e909aa2f934e2
Python
7,999
197
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Nov 2 12:26:37 2023 @author: Dustin Garner """ import math import datetime import numpy as np import pandas as pd from fafbseg import flywire import flycode.mapping as mapping import flycode.utils as utils import flycode.flywire_functions as fw clien...
e58ed1e7ee71e6d1bb75e61d89db5a41f25a86064fdbff4dd9d658197afcc203
Python
8,000
261
"""Parallelization and time recording ------------------------------------- """ import time import numpy as np from mpi4py import MPI # initialize MPI COMM = MPI.COMM_WORLD SIZE = COMM.Get_size() RANK = COMM.Get_rank() def run_parallel_functions_sequentially(funcs, filename): ''' Runs parallelized functions...
ee60f508dd2ef0a2bb8747989c983a3aa52cc47fd3a87adbd80c531efb3a87e5
Python
8,000
180
from wsilearn.utils.cool_utils import * from wsilearn.utils.path_utils import * def make_link(src, link, relative=False, ssh_node=None, verbose=False, dry_run=False, exist_ok=False): if exist_ok and Path(link).exists(): return if relative: src = os.path.relpath(str(src), Path(link).parent) ...
78ec30c2b79942b86aaf2bd1d86e1608dcea473f57c3ff047a905476953168ff
Python
8,004
250
# # MIT License # # Copyright (c) 2022 GT4SD team # # 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,...
e1ae4129ba126d4a43a5ab4f5a1f76ebcd3b6f3beb347fe9c170501a76e2b6cd
Python
8,006
145
from Bio import SeqIO, motifs import lightning.pytorch as pl from hicdiffusion_model import HiCDiffusion import matplotlib.pyplot as plt import matplotlib from scipy.ndimage import gaussian_filter from torchmetrics.image.fid import FrechetInceptionDistance import torch import lightning.pytorch as pl from hicdiffusion_m...
8ba044c9fba3b5a2a7858f0fd9e3f32f4731a533bab62db4496af98cc44463f1
Python
8,007
182
from typing import List, Tuple, Union import numpy as np import torch from torch import Tensor, nn from torch.nn import functional as F from torch.utils.data import DataLoader from ..classifier import ClassifierTrainer class FocalLoss(nn.Module): def __init__(self, gamma: float = 1.0, ...
e3c76d56def26867a30d30a872f82744deace8549dd19ceec0f73aff5d8e85dc
Python
8,007
258
#!/usr/bin/env python3 from pathlib import Path import csv import shutil import numpy as np import nibabel as nib import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt from nilearn import datasets, plotting from nilearn.image import load_img, resample_to_img # -------------------------------------...
49b758491de8d32efaf7d23fe734e93107a1cb77d491644b260529dc5ba650bc
Python
8,009
240
import torch import torch.nn as nn from elasticai.creator.nn.integer.design_creator_module import DesignCreatorModule from elasticai.creator.nn.integer.linear import Linear from elasticai.creator.nn.integer.mha.design import MHA as MHADesign from elasticai.creator.nn.integer.quant_utils import ( AsymmetricSignedQP...
d11fc94bc1a5542ec724504c9ce0086a094e867905b3ac2df284cfdf43046ffa
Python
8,009
211
from __future__ import annotations import json from collections import ChainMap from pathlib import Path from typing import TYPE_CHECKING, Literal import pandas as pd from scanpy import settings from pertpy.data._dataloader import _download from ._look_up import LookUp from ._metadata import MetaData if TYPE_CHECK...
040724cf87e9e06676c58af10cb7c27c8f86af8e29823f30e71dc2cce054a652
Python
8,013
258
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # 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...
f834a5e087db38e0014dd6f9dd28add3e52b7c39e2e5e0e17a73b5f8b9954083
Python
8,013
155
"""Launch the local anatomical neural observatory or run a real diagnostic.""" from __future__ import annotations import argparse import json import logging import os from dataclasses import fields from pathlib import Path ROOT = Path(__file__).resolve().parents[2] def load_configuration(path: Path, cpu: bool = Fal...
1effb6c5b54b5bc73e81a199775ff2638714c185141a36a25c219b195b2eaec4
Python
8,014
234
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # 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...
24a0799094ea9477e8d08862037d745cbd026c097c7d9c2fd914137da0493e15
Python
8,014
238
""" Class for corresponding points, i.e. correspondences. """ from pathlib import Path import numpy as np import pandas as pd from scipy import spatial, stats from . import pointcloud class CorrPts: """Class for managing corresponding points between two overlapping point clouds.""" def __init__(self, pc1:...
e3e2c7b865c30e7bf3ff5670a34ad97c05f4e8f8524f23a5cb27c9c82bead565
Python
8,016
241
## Multi-animal # you might have to set cuda_visible in terminal before launching python import os os.environ['CUDA_VISIBLE_DEVICES'] = '0' device = 0 import multiprocessing import numpy as np # multiprocessing.set_start_method('spawn') import nvidia_smi # Install using pip install nvidia-ml-py3 import time lbl_fi...
58b93e324ff71b6092bd7ddd5cd6335d683315849f49f3febce62c11b31d78d8
Python
8,018
221
# Motionmapper-esque. Uses UMAP for dimensionality reduction rather than tsne import sys import os import glob import yaml import numpy as np from matplotlib import pyplot as plt from tqdm import tqdm import scipy.signal as signal from scipy import ndimage as ndi import scipy import sklearn import umap from BEBE.models...
c76ca9654ffd15a8b8af57f3d6712aa09ade39152def0b0a9ce28efd285aad27
Python
8,018
239
#!/usr/bin/env python #================================================================ # Copyright (C) 2023 Yufeng Liu (Braintell, Southeast University). All rights reserved. # # Filename : benchmark.py # Author : Yufeng Liu # Date : 2023-04-04 # Description : # #=====================...
1cea403fe8e96a4e96ac77fe1a286a16f4c3e437ce194ceb7b8e29d31511570d
Python
8,020
241
""" In a Relion's STAR file sets prior columns values as a copy of the rotation angles. VERY IMPORTANT NOTES: Relion reconstructs move particles to reference, in contrast refinement procedures, so euler angles must ve swapped and inverted for generating the prior information. ...
75603e0d3bd97d00a94d122d14c90ed774c35fa9eac8cfa0a36a0734bf7214e5
Python
8,020
199
""" Run custom setup when MolecularNodes node group assets are added to a tree. Since the node groups are shipped as regular assets in an asset library, no MolecularNodes code runs when a user drags one into a node tree. The ``blend_import_post`` handler fires for every link/append operation — including asset drag-and...
b729269d5f9a6611c6eea31eb0cc8e67e6d53126cd385ded3ad3ed4674478acf
Python
8,021
185
"""Functions to evaluate the performance of the translation model during training""" import multiprocessing as mp import csv import os import numpy as np import pandas as pd import tensorflow as tf from sklearn.svm import SVC, SVR from sklearn.model_selection import LeaveOneGroupOut from sklearn.preprocessing ...
e82d25d3ff7785e707f9f3382ceef2a28361659522be9ca723a9d595c20dcb30
Python
8,023
282
# Abstract database class supporting datasets, categories, views, feature sets, users, jobs, and job results # Only methods server and datasets must be supported in 'client' mode import os from cirrocumulus.envir import ( SERVER_CAPABILITY_ADD_DATASET, SERVER_CAPABILITY_DELETE_DATASET, SERVER_CAPABILITY_ED...
dc57012680838329b5dbf74deb17caf02d6044e6341e7e0d488daef31bf9d2e1
Python
8,024
228
# Copyright 2016–2021 Julien Danjou # Copyright 2016 Joshua Harlow # Copyright 2013-2014 Ray Holder # # 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-...
cfba1f865349a618b4e54f9e581bc0d870370dbefa2a3dbbf06bfcbc0052988c
Python
8,028
168
# coding=utf-8 # Copyright 2021, The Facebook AI Research Team and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.or...
2716230f467f7e605d65dc19c3d948a4265e7df88cb4aa664d6fea7b7240282e
Python
8,029
225
#!/usr/bin/env python ''' LFP simulation script for 4x4 mm2 network model But the network is implemented with spatial connectivity, i.e., the neurons are assigned positions and distance-dependent connectivity in terms of cell-cell connectivity and transmission delays. Synopsis of the main simulation procedure: 1. Loa...
3888a9f91e49f76256894dc5c3401a3640c18dde2c7df50e2298814dd94fa333
Python
8,033
188
# Librairies import os import sys code_path = os.path.split(os.path.split(os.getcwd())[0])[0] sys.path.append(code_path) import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl import argparse import json import seaborn as sns from matplotlib.colors import ListedColormap from setting import * from u...
010be9015b4feef4d309482d79c8ffe2d57fa7ab103023e0b7bbbe8ad7b2ae23
Python
8,034
188
import numpy as np import cv2 from typing import Tuple from merlin.core import analysistask ExtentTuple = Tuple[float, float, float, float] class GenerateMosaic(analysistask.AnalysisTask): """ An analysis task that generates mosaic images by compiling different field of views. """ def __init_...
5e899782b0ed008d9ece4f575f9b56466e63c892b10998b50506bf30eb5fd15d
Python
8,035
210
import torch.nn as nn import torch import torch.nn.utils.prune as prune from typing import Optional, Type from operator import xor class HCNNCell_compressed(nn.Module): """ The HCNNCell call is implemented to model one forecast step in a Historical Consistent Neural Network with compressed support input. ...
faeb4d792646bc89a54f7dafd4a7ae6d55eba422df30bc9ce35470b6627219a2
Python
8,035
196
#!/bin/env python """ OXASL - Distortion correction module The functions in this module calculate non-linear distortion correction transformations to apply to the ASL and calibration images. Currently two sources of transformation exist: - Fieldmap-based distortion correction. This generates a nonlinear warp image ...
d3ba7d4136b9a6b2d96648d2c077fa5b21f14701976080f3d56dbe12e0020fb5
Python
8,039
168
# coding=utf-8 # Copyright 2021, Google and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ...
c55a6d961821817698e6baef6cde2dcbfa5f0799f7ad8397ab4dd6f842c8f0f6
Python
8,040
170
"""A setuptools based setup module. See: https://packaging.python.org/guides/distributing-packages-using-setuptools/ https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages import pathlib here = pathlib.Path(__file__).parent.resolve() print("her...
2bb5cb83f1268aa39badc6ce8802153f0908fc1654f30dc472de41f106d9eb44
Python
8,042
182
""" toposampling - Topology-assisted sampling and analysis of activity data Copyright (C) 2020 Blue Brain Project / EPFL & University of Aberdeen This program 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...
bdaca66515d9210130d5a2060bb2eeeee982576e8e0ab646747ae63c47e47420
Python
8,042
177
import os import subprocess import argparse import datetime import time import sys import fnmatch import re #!!!!NEED TO RUN: source /groups/branson/bransonlab/mayank/venv/bin/activate AT COMMAND PROMPT BEFORE RUNNING THIS SCRIPT!!!!! #base_dir ='/groups/branson/bransonlab/mayank/stephen_copy' cut_off = time.mktim...
315f10bff9f4b1b183011ca6c65cf53dc0326711fe98bea94ac72e099cc1a852
Python
8,043
145
## -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # Imports # -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% import copy import os import scipy.io import numpy as np import pandas as pd from Functions.f_EEGPowerAnalysis import * from Functions.f_AnalysisFunctions import * import ...
35175f45a1e19de203375a7f85b011965b2e7c792b58c3f9dc91362bd11991b1
Python
8,046
230
import os.path as osp import numpy as np import torch import pandas as pd from torch_geometric.data import InMemoryDataset from torch_geometric import data as DATA from rdkit import Chem from rdkit.Chem import MolFromSmiles import networkx as nx from rdkit import Chem from rdkit.Chem import ChemicalFeatures from rdkit ...
9d3ca3c7a8821194d00feaf74551faa8593edb43db66613aeea73a6e76784652
Python
8,046
264
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # 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...
ba25c31de2f2585c6e7ac9411ffe22177f540a80230e5c87f890fca709ee15e1
Python
8,046
188
import numpy as np import cv2 from typing import Tuple from merlin.core import analysistask ExtentTuple = Tuple[float, float, float, float] class GenerateMosaic(analysistask.AnalysisTask): """ An analysis task that generates mosaic images by compiling different field of views. """ def __init_...
eb340e3d939014ef6a7c2ad31d538708c0a227a1a971b69998e5223f0b8e2090
Python
8,046
176
""" FEATHER_PASS_E_FULLSCALE.py Full-scale replacement for FEATHER_PASS_D_RANDOM.py + /tmp/ess2.py. Instead of a random 4,000-segment sample it runs the effective-sample-size correction over EVERY FlyWire mat571 segment with n >= 100 synapses (126,419 segments, 120,588,207 synapses = 92.7% of the brain). Method is a ...
6b82e0ef1d27d177b33e3f177dd1eb4f61f252e19379d93b0e1dedbb33734ff8
Python
8,049
153
# coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. # # 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...
edb6ddac297ebaec4e461464415d85163be8f0bf823095ce03b60c01857959a0
Python
8,049
206
"""Holder for and manipulation of search results.""" import re from hed.errors.exceptions import HedQueryError from hed.models.query_expressions import ( Expression, ExpressionAnd, ExpressionDescendantGroup, ExpressionExactMatch, ExpressionNegation, ExpressionOr, ExpressionWildcardNew, ) f...
f36038532208dcfe24f1d145c20914d2a664630912c8c5570f9416564c586e18
Python
8,052
190
""" Classes for expressing a DisPerSe skeleton as a graph # Author: Antonio Martinez-Sanchez (Max Planck Institute for Biochemistry) """ __author__ = 'martinez' try: import pickle as pickle except: import pickle from .core import * ############################################################################...
f45aa6c7bda638be50d25d4d64e6d63fa7f31f97cf3e77fc4cb1132449d6083e
Python
8,053
227
# # Copyright Bradley Lowekamp # # 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.txt # # Unless required by applicable law or agreed ...
230b12fecb7c9d220baba3cceaa34937b377262fa76bad4ab68e57aaf1189048
Python
8,057
240
import numpy as np import pandas as pd import pytest from lifelines import WeibullAFTFitter from SurvivalEVAL.evaluations.calibration.single_time import one_cal_ic from SurvivalEVAL.evaluations.prediction_error import inclusion_rate, mean_error_ic from SurvivalEVAL.evaluators.interval_cen_evaluator import IntervalCenE...
b8ceadb6300f0675faf790897eac15ca25f71b57edb58b01d4ba83a5e8060067
Python
8,057
245
import numpy as np import torch import math def get_regions(pooling_fun,img_size,nClass,shrink_maxsz): if(pooling_fun == "2d"): regions = split_regions_2d(img_size,nClass,shrink_maxsz) elif(pooling_fun == "2d_edge"): regions = split_regions_2d_edge(img_size,nClass,shrink_maxsz) eli...
46aca85d9be4bab96d85cc2a5fa1b1b390c630aa39a6141b5db1a8114787a995
Python
8,059
159
# coding=utf-8 # Copyright 2021 Google Research and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICE...
30fa767e2c0b790280228306e9fd8ec71199eda7a8aae6d8e2d1ad0a5d47df10
Python
8,061
220
""" Created on 27/07/2020 :author: Chinchien Lin :summary: """ import datetime import json import os import sys from functools import cmp_to_key from src.segmentation.multichannel_segmentation import MultiChannelSegmentation class MultiSliceSegmentation(object): """ Perform multi-slice im...
582f8521f384d4b07dd51112254530b972cec5466a8228e5b17845728cc824d4
Python
8,061
165
from cooler.create import ArrayLoader import h5py import cooler from Bio import SeqIO, motifs import lightning.pytorch as pl from hicdiffusion_model import HiCDiffusion import matplotlib.pyplot as plt import matplotlib from scipy.ndimage import gaussian_filter from torchmetrics.image.fid import FrechetInceptionDistance...
e31dbe0bcc1dee4b61815078e4fd08fa8ba849ee089df6f406ee917a9f739649
Python
8,061
153
#!/usr/bin/env python import os import numpy as np import pandas as pd from scipy import io as sio ## where are matrices located? projpath = os.path.join('/project', '3011157.03', 'Simon', 'proj_2022_CABB_movie', 'DistanceMatrices') ## where should new matrices be stored? dir_out = os.path.join('/project', '3011157.03...
16e963633d9a167088f2e05edf902ffbfaabe7331b1fa6315a705ee5c421a91e
Python
8,062
233
# # MIT License # # Copyright (c) 2022 GT4SD team # # 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,...
5778a52ec172d8f6298c679a0ab36edacd168f0488ba113ac55e47288a3d93c7
Python
8,062
201
"""Column sources: what tabular validation asks of a table, independent of how the table is stored. The staged tabular validator (:class:`~hed.validator.spreadsheet_validator.SpreadsheetValidator`) never reads a table directly. It asks a column source for the column names and for the distinct values of one column at a...
9333ce98a7782abb77ba8bca574422501963ff80224203d08ef8397196c55229
Python
8,064
219
""" version 1.0 author: Felix Plasser description: Procedures for plotting using the Matplotlib/pylab interface. """ import os, sys import numpy import pylab import file_handler def mean_std_from_files(mean_file, out_dir, xlist, std_file=None, col_list=None): """ Makes a number of mean/std plots from a file c...
6fc9d40104c598c148543d02f3712e316bf1aa09bad00dafb352b654fbe03598
Python
8,066
241
#!/usr/bin/env python # -*- coding: utf-8 -*- """Some plottin' functions used by the example scripts Copyright (C) 2017 Computational Neuroscience Group, NMBU. 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 Fo...
e3e99576b53fac7bb7bc5fea9c575b4e62a771474a50ae818d9f4942829c9da1
Python
8,066
249
"""Transition state recipes for Q-Chem.""" from __future__ import annotations from importlib.util import find_spec from typing import TYPE_CHECKING from monty.dev import requires from quacc import job from quacc.atoms.core import perturb from quacc.recipes.qchem._base import run_and_summarize_opt from quacc.recipes...
d5c77585b39f2ffb15e45843db533bb98a0c0249f85cffef4ac09555d1cbd502
Python
8,069
202
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # 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...
0d27c9256316061070edcc846cbc6ebf130395d7c8da348eed29e31af1251a1a
Python
8,072
142
"""This script visualises the POM considered for the inference of repolarisation properties from the T wave""" import os from warnings import warn import math import numpy as np import pandas as pd from matplotlib import pyplot as plt from io_functions import export_ensight_timeseries_case, read_dictionary, save_panda...
39bd28981e0e9596577c542d6a5568218e82808ace903e5865f01362fd835d98
Python
8,072
243
"""distutils.dir_util Utility functions for manipulating directories and directory trees.""" import os import errno from .errors import DistutilsInternalError, DistutilsFileError from ._log import log # cache for by mkpath() -- in addition to cheapening redundant calls, # eliminates redundant "creating /foo/bar/baz"...
793ba79baf0e933b465b4ee99a6cd1daf7501d7265a81fb56e004c1fb26fc055
Python
8,073
253
# # MIT License # # Copyright (c) 2022 GT4SD team # # 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,...
265517387baf44eaa639a1ed119b29f2b7e913b78e0c21a062c37bd06ee04209
Python
8,074
254
"""Kfold crossvalidation class. Class ------- KFoldCV """ import multiprocessing as mp from copy import deepcopy import numpy as np import xarray as xr from hmp.patterndata import PatternData, select_indices from hmp.utils import _define_random_state class KFoldCV: """ K-fold cross-validation for HMP Eve...
855ab120b7f329034de0d38602b83519860df7f52069d0ca9a29ef195dfe6204
Python
8,075
180
import torch import torch.nn.functional as F from utils import load_dataset, feature_generator, adj_polynomials, l2_reg_loss, cluster_infer, cluster_number, \ to_sparse_tensor from sampler import get_edge_sampler from model import PolyGCN from loss import BerPossionLoss from sklearn.decomposition import TruncatedSV...
d55c9715279b4c364ff5680dc332a640fbc7fbd6402d774303ec7ffab895439a
Python
8,075
178
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Mar 12 13:31:38 2023 @author: caroline """ import argparse import sys import scipy from scipy.stats import spearmanr import numpy as np import pandas as pd import matplotlib.pyplot as plt import os import seaborn as sns from sklearn.linear_model import ...