sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
628661b9ec71d243068f132e9415e8e4f65d637987159432dffe09771927f46b
Python
31,396
892
# 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...
e2c25fb3979e5179aca4a1034b78b23dbe185a38054ba912ba1e0b5712b0c668
Python
31,403
731
try: import binutil # required to import from dreamcoder modules except ModuleNotFoundError: import bin.binutil # alt import if called as module from dreamcoder.dreamcoder import * import dill import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plot from matplotlib.ticker import MaxNLocator i...
8d1327b2d257b867c889f83570c485cf7f9f760a54c732ee951bd8c63c127093
Python
31,409
864
"""This module contains classes and functions specific to SAMPL6 data files. The functions are adopted from Bas Rustenburg's Titrato Package, but modified to calculate relative free energy of microstates between pH 0 and 12.""" import pandas as pd import numpy as np from titrato.titrato import TitrationCurve, free_ene...
eb274dafd0053b191816aacf4338d726d917672b1be83f6b289cac3120068d02
Python
31,427
429
import numpy as np import scipy.stats from .model_compare_predicted_to_actual import * def model_compare(target_actvect, model1_actvect, model2_actvect=None, full_report=False, print_report=True, print_by_condition=True, comparison_type='fullcompare_compthenavg', avgthencomp_fixedeffects=False, mean_absolute_error=Tru...
4a72739bda7f816d0d9a39ae9ecbffb8967be93ae0b5cefd26f72284fea79085
Python
31,432
543
############################## ######## Shallow Grid ######## ############################## #%%# Catalyzer sup_comp = False # Super Computer? cellulate = (0, 0) # (cell_layers, layer_cells) maturity = 48 # {48, 96} initiate = {'FC_MRNA': 0, 'FC': 0} # {0, ..., 250} # {0, 250, 500, 750, 1000} # Toll! _initiate = '_'....
ca90a1c62662940d2a93ce04cb7082643484e19efe38c4c2ec682f84dc17af2f
Python
31,432
928
#!/usr/bin/env python # coding: utf-8 ''' Created on 2023-12-12 @author:fdy ''' import ctypes from ctypes import * from enum import Enum import time #加载SDK动态库 # 32bit #TUSDKdll = OleDLL("./lib/x86/TUCam.dll") # 64bit TUSDKdll = cdll.LoadLibrary("libTUCam.so.1") # class typedef enum TUCAM status: ...
923dfe568861fcd8d03b16ba775bbc2af4573dd1ca0d7a61e70afb3368b675e1
Python
31,439
543
############################## ######## Shallow Grid ######## ############################## #%%# Catalyzer sup_comp = False # Super Computer? cellulate = (0, 0) # (cell_layers, layer_cells) maturity = 48 # {48, 96} initiate = {'FC_MRNA': 0, 'FC': 0} # {0, ..., 250} # {0, 250, 500, 750, 1000} # Toll! _initiate = '_'....
604dd5da1962b9bb28441ef66e15bb1b73a52d477f6b3ba2f0281957c0f0e755
Python
31,463
1,001
# 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...
91795335c1f8ba60cd9205305b64ed6a715b839b90a02a71775dbccc20264595
Python
31,475
708
import os import numpy as np import librosa from utils.files import flatten_list from utils.files import get_wav_files as get_files from config import SE_Config from random import * from tqdm import tqdm import torchaudio from torch.utils.data import Dataset import numpy as np import torch def gen_log_space(limit, n):...
147c3dff9c0a2d44ba98a40bb4507664d4cbf763b2f4a73ba2580bd0156a59aa
Python
31,483
918
# 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...
da9a16b6d340863dd8e3965d7602153305e335701d51c00e3bfb1cd3087a6a74
Python
31,503
788
"""distutils.command.build_ext Implements the Distutils 'build_ext' command, for building extension modules (currently limited to C extensions, should accommodate C++ extensions ASAP).""" import contextlib import os import re import sys from ..core import Command from ..errors import ( DistutilsOptionError, D...
6bd771b3faa78169880798c20738e9d4c9de310baecc86570f9e9708dc3b21e2
Python
31,531
609
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Calibration of VEDB T265 @author: brianszekely, christiansinnott """ # from pathlib import Path import numpy as np import pandas as pd import xarray as xr import matplotlib.pyplot as plt import pupil_recording_interface as pri import rigid_body_motion as rbm import os ...
6e6a9705a0b2fba827249a5f25bd3dbaf6bf891e0c8d4dc6dbd15ea4724ca031
Python
31,531
1,215
from __future__ import annotations import shutil from dataclasses import dataclass from pathlib import Path from typing import Sequence import numpy as np import pandas as pd import tifffile from PIL import Image from ..core.instance_map import validate_instance_map from ..category import ( CATEGORY_COLUMN, ) ...
d6c93ed2a5d5516e0e04330d456844561b8b837f652611e0291232d1aea8ad54
Python
31,557
810
import numpy as np import cv2 import os import logging import pandas as pd from matplotlib.backends.backend_agg import FigureCanvasAgg import matplotlib.pyplot as plt import seaborn as sns from typing import List, Dict, Tuple import argparse import configparser import coloredlogs from scipy.ndimage import gaussian_fil...
463793c8c8584fac13a69e35c65eba1133ca8f529ea3d478b5029270619a9cc7
Python
31,580
770
# coding=utf-8 # Copyright 2021 Facebook AI Research (FAIR), Ross Wightman, 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....
77270b396b406ca0dfa21fe3d1ee00c704c23b9626c77060b0cae0a44cb30744
Python
31,605
703
""" Performs Bivariate 2nd order analysis to a SetListTomograms object by tomograms Input: - A STAR file with a ListTomoParticles pickle (SetListTomograms object input) used as reference - A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input) to analyze Output: ...
d137e72f331c56b566fb2e56a0e7498685e9cadf8c9e88637c01ec25d771f374
Python
31,608
798
""" I/O for the reorient tool - handles a heterogeneous mix of inputs: * **Image volumes**: TIFF, NIfTI, NRRD, NumPy ``.npy`` / ``.npz``, plain 2D images (PNG/JPG/etc.). Loaded via :func:`regtools.utils.io.volume_io.load_volume`. * **Point clouds**: cellpose CSVs (2D or 3D), napari CSVs, legacy TXT, or NumP...
a20177ba6d6a35ba5c0f1e87138508ba767fd5ea0565239f3bc386a0b737e248
Python
31,631
798
# 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...
f8955f9c695d45b62466227f4bcbd22cee98eede2c7de936f4202f4089f39919
Python
31,659
925
# 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...
68367a173fc239617a42888c4d0140fcb11b648a817ffd60553cd2d08265f40d
Python
31,668
697
import unittest from hed.errors import ErrorContext, ErrorHandler, ValidationErrors from hed.models import HedString from tests.validator.test_tag_validator_base import TestHedBase class TestTagFormat(TestHedBase): schema_version = "8.0.0" class TestConvertTag(TestTagFormat): def converter_base(self, test_...
85c7fc7e8d6a1d2c7290c5512f64e2d906015a7ec99d49c12867d3809e8b0685
Python
31,677
800
__author__ = 'martinez' ########################################################################################## # # Set of classes which follow the VTK filter interface and extend the functionality of VTK # ########################################################################################## import vtk impo...
45861d85791a98b181bcfd5c158e846742f17049f6dad30f1f142ccb58389559
Python
31,679
681
import os import datetime import json import numpy as np from tqdm import tqdm, trange import skimage.io import mrcfile import tensorflow as tf from scipy.ndimage import zoom,rotate try: from tensorflow.keras import backend as K from tensorflow.keras.models import Model from tensorflow.keras.callbacks impo...
af48cd6f5827677e3f5ca6d64f67612c4662291a5a14c9f22484a50581b8ae89
Python
31,682
700
import pickle from pathlib import Path import numpy as np import openturns as ot import seaborn as sns ot.Log.Show(ot.Log.NONE) import matplotlib.pyplot as plt import scipy.stats from scipy.interpolate import UnivariateSpline from sklearn.neighbors import KernelDensity from uptake.figures.utils import...
6002ea9595209f4e9cd2b85dd20de4053e69ead040cfc0c22a9d22b1be32903c
Python
31,723
512
"""TWIN.py 2026-10-08. Pre-registration: 04-NOTES/PREREG-2026-10-08b-TWIN.md A fly twin of the antennal lobe. Shiu et al.'s own file (antennal-lobe cut-out, DELETION_SOURCE.cutout), with three things real fly neurons do and the model lacks, each set from a measurement: (1) receptor neurons fire at rest, at their r...
92ea3edf342a12036c3d62e5b256818167bd82e74e87b3c340f7484affbe56bc
Python
31,733
813
#!/usr/bin/env python # -*- coding: utf-8 -*- """Module with the model for TGAN. This module contains two classes: - :attr:`GraphBuilder`: That defines the graph and implements a Tensorpack compatible API. - :attr:`TGANModel`: The public API for the model, that offers a simplified interface for the underlying oper...
b7b1b387e8021facbd4b9ce570f994760018e00be5513308e5ec6ce42c0c2caa
Python
31,740
507
from json_loading import * from datetime import datetime import pandas as pd import os import json import gzip import pandas as pd import math import sys sample = snakemake.wildcards.sample folder = snakemake.wildcards.folder sys.stdout = open("{}/{}/Console_outputs/Nirvana_JsonDecoding.{}.out".format(fold...
f65477d9c1c4b6aa73454b6b4080ce66a0d4cf4a2aa6e4d57f42aa4294cc2493
Python
31,742
932
#%% import torch import torch.nn as nn import torch.nn.functional as F import math """ Model 구조의 선택권 : 1. Linear, 2. Conv VAE에서의 ... -> Linearity를 고민할 수 있음. -> Manifold mixup in VAE의 latent vector 추가 term으로 임의의 2개 label (동일 structure)에 대해 manifold mixup 해버리자. (기대하는 것 : 동일한 structure에 대해서 label의 lin...
91e69b7abc598e3d860464bfb6ec09b5334381a36d0bb91e8efad73704e2b2e8
Python
31,768
668
#!/bin/env python3 """ Phase defect fields ------------------- A *phase defect* is a (more or less) discontinuous jump in phase. In the context of cardiology, conduction blocks, for instance, can lead to such phase defect. They can be observed in the center of a vortex. This submodule contains algorithms to calculate...
3a9df01beaa396ed57df1a04e810deed1f90255f4012a9270b6c3615d6608ba6
Python
31,780
1,069
## # \file input_argparser.py # \brief Class holding a collection of possible arguments to parse for # scripts # # \author Michael Ebner (michael.ebner.14@ucl.ac.uk) # \date August 2017 # import os import re import six import sys import inspect import argparse import platform import datetime...
739e8a97a0fbe4ceff76618ba7a19d40915bc5a8ed3ea339c4119e1eade9d32a
Python
31,793
846
#!/bin/env python3 """ Visualisation with Matplotlib ----------------------------- Collection of functions related to visualisation of various ithildin data. These functions are supposed to be minimal. For more advanced plotting, create a dedicated script. Design of drawing functions is such that they can be plugged...
7056296270f7ab2c1ba09aa254409fdc0e8fcfd0ac3600fbbcca933c307411f6
Python
31,809
769
"""Smoke + signature tests for ome_zarr_converter functions. The points submodule is covered in test_ome_zarr_points.py; this file covers the volume converter (TIFF -> OME-Zarr / Neuroglancer precomputed) and the points converter helper (convert_points_file). ng_viewer gets bare-import smoke tests that guard ag...
d43218d6b403da8152325f17e69885e0a3530cfdd87e34ae730602e464e6370e
Python
31,810
801
# Numpy implementation of the Lagrange model (RtDeep). Trainable only with single samples. Not used, but kept for understanding the model. # # # Authors: Benjamin Ellenberger (benelot@github) import time import numpy as np # for optimization with root solver from scipy.optimize import root from model.network_params ...
f0120c0a911ef9f089bddf518d8389aa68502a7e52a48e68b505ae578d8b3add
Python
31,810
790
"""Base model class.""" import numpy as np from sklearn.metrics import roc_auc_score, average_precision_score import torch import torch as th import torch.nn as nn import torch.nn.functional as F from layers.layers import FermiDiracDecoder import layers.hyp_layers as hyp_layers import manifolds import models.encoder...
83399a2df13f1bc3cd80ee1bcef5e76c52f11a22f9461976bfb1b7f520bad535
Python
31,833
847
#!/bin/env python3 """ Visualisation with Matplotlib ----------------------------- Collection of functions related to visualisation of various ithildin data. These functions are supposed to be minimal. For more advanced plotting, create a dedicated script. Design of drawing functions is such that they can be plugged...
1a9e0cce4d72743bfe03d4296aa1c7077825561b223feee52a47c7a68f8c4dc6
Python
31,838
582
"""Attractor diagnostic: does recurrent Fly coupling drive Qwen into a repetitive regime? Runs real greedy inference through the observatory engine under matched controls and writes structured JSON/CSV results plus plots. Nothing here applies repetition penalties or other decoding changes; decoding is the same greedy ...
aef90b9ddbba3173a364fb09824c4c63232f8427994f1fc9c8ce05df2224e5e4
Python
31,850
897
import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt import numpy as np import pandas as pd import pytest from SurvivalEVAL.evaluations.calibration.distributional import ksd_calibration from SurvivalEVAL.evaluations.calibration.single_time import one_calibration from SurvivalEVAL.evaluations.util ...
0ee8d039c551d32949ebc3bc89719a1f7696bdde74873bca71ea1c71595210cc
Python
31,872
672
from __future__ import print_function import argparse import datetime import os import sys import time import random import math import numpy as np cwd = os.getcwd() pwd = os.path.abspath(os.path.join(os.getcwd(), "..")) sys.path.extend([pwd,'../pddlstream','../ss-pybullet']) from collections import Counter from ite...
86acd148586703bbdf9a4e0e7bb502281dd4f842c37a09724aaeee686291206e
Python
31,874
583
"""Attractor diagnostic: does recurrent Fly coupling drive Qwen into a repetitive regime? Runs real greedy inference through the observatory engine under matched controls and writes structured JSON/CSV results plus plots. Nothing here applies repetition penalties or other decoding changes; decoding is the same greedy ...
7a79e6337560f74755fcf2f69b00ae966d4b65ea2582f71a58d1186f5bf9d177
Python
31,898
808
""" This module provides the methods used in our paper to conduct Connectome Spatial Smoothing (CSS). The module contains the folowing functionalities: - Code to map high-resolution and atlas-resolution connetomes - Code to perform CSS Python implementation of connectome-based smoothing Author: Sina Mansour L...
ae8672884fd21307db60616c0c61520e90ae3f341edeaf0ef9eb8d8852039e4c
Python
31,906
674
"""The mirror functions in segmentation_stats.py and apply_transforms_figures.py must reproduce the SAME 2-D annotation slice the run itself cropped - otherwise the annotation silently misaligns against the warped output by exactly the correction Task 7 introduces. Neither module has any other test coverage in this...
f22e5d07959b9737926d802493badaaa6bdde9310dfcd6a488e20437420face3
Python
31,931
736
import pandas as pd import numpy as np import torch import argparse import vcf as pyvcf import tqdm from old_annotator_pytorch import Annotator, get_gene, get_genes, initialization def visualize_snp(_chr, _snp_pos, _strand, _ref, _alt, _mutation_result='', use_spliceai=False, save_folder=None): import matplotlib....
dabca41e830ab8db6d992240a2bfbfda8a6ec0f2bf84573fb413231ff4870bea
Python
32,007
959
import os from tqdm import tqdm import random import numpy as np import matplotlib.pyplot as plt # PyTorch import torch from torch.utils.data import Dataset, DataLoader, SubsetRandomSampler,RandomSampler from torch.cuda import amp from PIL import Image from torch import nn from torch import optim import torchvision fr...
f9d0d407b975ea37dc49f973c1960babe950ef3f359136f5287999ea0935b2c7
Python
32,013
867
from __future__ import annotations import os import pytest pytestmark = pytest.mark.skipif( os.environ.get("GITHUB_ACTIONS") and os.name == "nt", reason="Skipping this test on Windows in GitHub Actions.", ) # this works locally on Windows, but no clue why it fails on GitHub Actions from importlib import ut...
c2a75c9f8b9bdff1d24841852713296741748c39ae1c855c1e4d05a7a694445b
Python
32,021
716
''' Description: Conduct in silico perturbation in scNODE latent space. Author: Jiaqi Zhang <jiaqi_zhang2@brown.edu> ''' import copy import scipy.interpolate import torch import numpy as np import pandas as pd from tqdm import tqdm from sklearn.neighbors import NearestNeighbors from sklearn.ensem...
ad2f14706ac3a83a877ae9e28b61a23e9d2499d2d1a1b4bfac79fa0f368c211a
Python
32,022
709
#!/bin/env python """ OXASL - MOdule to calculate M0 value or image for calibration Copyright (c) 2008 University of Nottingham """ import os import math from optparse import OptionGroup import numpy as np import scipy.ndimage from fsl.data.image import Image from fsl.data.atlases import AtlasRegistry from oxasl i...
d0041d1beb957706ec02142a65d094d3af02135962c2c149e71aedea1fe94711
Python
32,026
630
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Apr 16 08:00:51 2020 @author: daltonm """ #%matplotlib notebook import numpy as np import pandas as pd import matplotlib.pyplot as plt import pickle import dill import os import glob import math import seaborn as sns from sklearn.decomposition import ...
28c3fc853ddc04991e44b07352ea939acd224cf318dd975bf5486b7af5724349
Python
32,032
643
# -*- coding: utf-8 -*- import torch import torch.nn as nn from torch.utils.data import Dataset import numpy as np import pandas as pd import torch.nn.functional as F import random from torch.utils.data import DataLoader from scipy.stats import pearsonr, spearmanr import math from pathlib import Path from ignite.eng...
910ba95a7f9e135bd0be8bb3659c9d4a4720e65d1b3a6bed2c61046125b9d6e8
Python
32,036
671
from pyclbr import Function from dolfin import * import numpy as np import matplotlib.pyplot as plt import sys import os from IPython import embed mpi_comm = MPI.comm_world def read_xdmf(infile, mesh, order, tag, patient, comp): V = FunctionSpace(mesh, "CG", order) p = Function(V) p_xdmf = XDMFFile(...
1c9fcb0c2e742055bc73ebab72c587a545f45cb8f34baa497413399d799cd149
Python
32,048
654
#!/usr/bin/env python # ============================================================================= # GLOBAL IMPORTS # ============================================================================= import os import numpy as np import pandas as pd from typeI_analysis import mae, rmse, barplot_with_CI_errorbars from ty...
1b7bfeb40003ffcf4a86002115fba5050a8a3df20a4be1846cddba674315ff6a
Python
32,107
955
# 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...
335c2aa25ee46959844a72647448863bb069ebffa893dc5e56a1a0ba37c646b8
Python
32,138
509
import os import torch import logging import numpy as np import torch.nn as nn from torch.optim import lr_scheduler from torch.nn.utils import vector_to_parameters, parameters_to_vector from torchdrug.utils import comm from torchdrug.layers import functional from torchdrug import core, utils, datasets, model...
e1975146a6aa6580be28d2032e182baa89eeed270ec359f2ea1deb71a827b239
Python
32,156
682
import numpy as np import cupy as cp import opt_einsum as oe from neuron import h from utils.func import load_json import pickle class SynInfo(object): def __init__(self, id, point, syn, p=-1): self.id = id self.point = point self.syn = syn self.p = p class Network(object): d...
029e62420b9334b4a30d8b1074f9c7dae4078e7a9b40f45485e8a3e18bbad3cd
Python
32,160
932
# simulation.py # A class representing simulation data from a .mat file. # TODO: Add docstrings # imports from os import PathLike from pathlib import Path from typing import Callable, Iterator import h5py import numpy as np import numpy.typing as npt import pandas as pd import scipy.io as sio import matplotlib.pypl...
e043907b0d79e97465626d22319ef6bcfecc061df8ee723cbe4534cea05dc30e
Python
32,167
727
""" Script for computing/analysis and plotting peri-event-time histogram. Contains the following: align_spktrain function; puts together aligned whisker variable and spike counts (binsize equal to frame) of each cluster; it returns data for plot_psth function. spike_train function: used by align_spktrain to compute s...
3b833cb695d998b2c119532a696601fa95c960c2e13292115e29a39b5c403c87
Python
32,174
920
"""Tests for coglet Python bindings.""" import queue import re import socket import subprocess import sys import threading import time from pathlib import Path import coglet import pytest import requests # ============================================================================= # Module structure tests (no serv...
69c5727e34f8fbb84c0205651cfb62e06c4f0632099feffc4b3882b304972439
Python
32,185
793
import os import sys import h5py import numpy as np import scipy.interpolate import scipy.signal import scipy.fftpack def rms(x): ''' Returns root mean square amplitude of x (raises ValueError if NaN). ''' out = np.sqrt(np.mean(np.square(x))) if np.isnan(out): raise ValueError('rms calcula...
1e03762a8879f19bf1248712b87a500972a8ca6c5cca59b95006ec0701da7ae1
Python
32,227
800
#!/usr/bin/env python #================================================================ # Copyright (C) 2023 Yufeng Liu (Braintell, Southeast University). All rights reserved. # # Filename : generate_me_map.py # Author : Yufeng Liu # Date : 2023-02-09 # Description : # #===============...
588de18185dbd5b45ed6dd8fd9d6e7975683c71ed6198f234f05f1914c07ff9c
Python
32,287
767
# Import libraries import torch from torch import nn from torch.utils.data import DataLoader import torch.optim as optim import pandas as pd import numpy as np from sklearn.model_selection import train_test_split from sklearn.model_selection import StratifiedKFold from torch.utils.data import Dataset from torch.utils.t...
0c9a380b5ec4b967dd303549300478f51a0107b31df1d35287c575a3627de87c
Python
32,302
736
"""Allows output of HedSchema objects as .json format""" import json import pandas as pd from hed.schema.hed_schema_constants import HedKey, HedSectionKey from hed.schema.schema_io import df_constants, json_constants from hed.schema.schema_io.schema2base import Schema2Base class Schema2JSON(Schema2Base): """Co...
708fa54833d9beb515459f19fd0c73a0a0de0dc742ee4c479b36a780a94c230b
Python
32,312
742
# -*- coding: utf-8 -*- """ Created on Jun 22 2023 @author: Jonas A. Thiele """ ###Training of prediction models with FC (100 node parcellation) of the main sample (610 subjects, 5-fold cross-validation) ###Training with different numbers of the most relevant links (edges) #%% Imports import pandas as p...
14356749677cb7ed053755175c33a416e553cd3f80d7554b315dec0c07ed3082
Python
32,326
539
##################################### ######## Paper Draft Cartoon ######## ##################################### #%%# Catalyzer import os import sys path = os.path.dirname(os.path.realpath(__file__)) + '/../Resources' sys.path.append(path) path = os.path.dirname(os.path.realpath(__file__)) sys.path.append(path) impo...
74bd316a9414fe6b3935cf5594892dfeb988474a4254e14101f6e3d3205fa5bb
Python
32,335
944
"""Classes for plotting. """ import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt from matplotlib import patches # this is so I can plot graphics on a headless server plt.ioff() HORIZONTAL_LEVELS = [1, 2, 3, 4] class _Plot: """Base plotting class""" def __init__(self, filename="", hei...
4831f8d86e0d039f49adb1382ee6600f56310f151621197b6333eb97c6481801
Python
32,375
515
############################## ######## Shallow Grid ######## ############################## #%%# Catalyzer import os import sys path = os.path.dirname(os.path.realpath(__file__)) + '/../Resources' sys.path.append(path) path = os.path.dirname(os.path.realpath(__file__)) sys.path.append(path) import numpy as np import...
688e9644adc296eaa9f397d26e769612d05d64a3a50876e53ad352ca899cdd93
Python
32,387
701
import os import json from copy import deepcopy import cv2 import carla from PIL import Image from collections import deque import torch import numpy as np import math from leaderboard.autoagents import autonomous_agent from model import LidarCenterNet from config import GlobalConfig from data import lidar_to_histog...
fb9297755b01468961bee865e722e8fbad99af4c7e615f21c94c519c8f90a697
Python
32,410
822
from abc import abstractmethod import numpy as np import uuid import cv2 from skimage import measure from typing import List from typing import Tuple from typing import Dict from shapely import geometry import h5py import merlin import pandas import networkx as nx import rtree from scipy.spatial import cKDTree from m...
e64a7beb54f7be5ffc3c1056fdab7b2c2eb9d1e420bd233dbc347f464e0ddc58
Python
32,453
911
""" Run the "canonical" TE-Dependent ANAlysis workflow. """ import argparse import datetime import json import logging import os import os.path as op import shutil import sys from glob import glob import numpy as np import pandas as pd from nilearn.masking import compute_epi_mask from scipy import stats from threadpoo...
cadea633f5ece6c32908a8e26be629307754d0835e1554590020338fdfcc10e6
Python
32,472
613
"""Headless lifecycle and signal checks; fixtures never enter user anatomy caches.""" from __future__ import annotations import os import hashlib import json os.environ.setdefault("QT_QPA_PLATFORM", "offscreen") import sys import types from pathlib import Path from types import SimpleNamespace import numpy as np impo...
e1f018ad165a003e9f20ba6344caebfd653a06166fe129d1d530a9b8a522c2c4
Python
32,488
539
##################################### ######## Paper Draft Cartoon ######## ##################################### #%%# Catalyzer import os import sys path = os.path.dirname(os.path.realpath(__file__)) + '/../Resources' sys.path.append(path) path = os.path.dirname(os.path.realpath(__file__)) sys.path.append(path) impo...
6765d5335be30383a0612dc8717253f93800e248f6182a242846839f8022bfb4
Python
32,495
728
import numpy as np #### import the simple module from the paraview from paraview.simple import * #### disable automatic camera reset on 'Show' paraview.simple._DisableFirstRenderCameraReset() ################################################################################ # Set visualisation environment: # get active...
f180d0785c2830ccd09bfa3da9f73db82dfaf31b7cee3be600211ee9175fac12
Python
32,500
1,014
#!/usr/bin/env python3 import os import re import shutil import subprocess import sys from importlib import resources from pathlib import Path # Imports relocated internally to functions to avoid module-level import errors # when running visualization subcommands in environments without simulation packages. SCRIPTS =...
1d90adc81fc16227b7c7cf04d17fd30af8afac7095bada0c955d84e0704c55cc
Python
32,503
703
import os import argparse import time import numpy as np import torch import torch.nn as nn import torch.optim as optim import matplotlib.pyplot as plt import torch.nn.functional as F import networkx as nx import torchdiffeq as ode import sys import functools import scipy.io as scio from utils import * import argparse ...
02f78d0c336472ac1dbd09cbd8fee143f04ce9b959b33c581c484e7c10169fc8
Python
32,513
783
#!/usr/bin/env python # -*- encoding: utf-8 -*- import re import textwrap import bindings as bi class JavaTypeTranslator(bi.TypeTranslator): def __init__(self): bi.TypeTranslator.__init__(self) self.types["string"] = "String" type_adapter = JavaTypeTranslator() def translate_type(h2o_type, schema...
fb304e31cd1cc915ca598784c20ac654808d17bc608403ec04b7be3e60fc0d37
Python
32,526
659
# -*- coding: utf-8 -*- ################################################################################ ## Form generated from reading UI file 'dgn_chkres_ctrl.ui' ## ## Created by: Qt User Interface Compiler version 6.8.0 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! ###...
349830c1864d8cb5bda14fcf38d89975cac5e77bf55a61274a7f294326ccac06
Python
32,530
797
import math import os import random import re from collections import namedtuple from itertools import combinations import numpy as np from .pr2_never_collisions import NEVER_COLLISIONS from .utils import multiply, get_link_pose, set_joint_position, set_joint_positions, get_joint_positions, get_min_limit, get_max_lim...
91d36895613145b17cf5f27a6a3ed86e676f79eb70229a69b69be6196f16e5a4
Python
32,551
976
from functools import partial import numpy as onp from autograd.extend import SparseObject, VJPNode, defvjp, defvjp_argnum, primitive, register_notrace, vspace from ..util import func from . import numpy_wrapper as anp from .numpy_boxes import ArrayBox # ----- Non-differentiable functions ----- nograd_functions = ...
c422989249a03d6225056c162a44afd06fa0e326364510a5b207f87a791d3acc
Python
32,554
883
""" CLI entry point for cellpose-SAM cell detection. Usage: # Positional arguments python -m regtools.cellpose_sam section_001.tif results/ # Or with flags python -m regtools.cellpose_sam --input section_001.tif --output results/ # Directory of stitched sections python -m regtools....
c367e154485fdf74af91f920b9a815a5cea19e2fdd00ca1b5e36b391970234e2
Python
32,588
780
# MEGIT data process functions import copy import numpy as np import scipy.ndimage as ndi import scipy.interpolate as itp import cv2 as cv import warnings """Function list: # Image/Video processing functions get_frm(vid_cap, frm_idx): Get specified frame of video file. brt_con(img, brt=0, con=0)...
ab18b8eb4c749020c58411d08ebe187d20917c72f1874f044b002fe17854e51f
Python
32,591
615
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Apr 16 08:00:51 2020 @author: daltonm """ #%matplotlib notebook import numpy as np import pandas as pd import matplotlib.pyplot as plt import pickle import dill import os import glob import math import seaborn as sns from sklearn.decomposition import ...
1357a148af14fab17415e5669814a11b785205c1a1903ce8484ce6c9007ba440
Python
32,594
605
# 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...
3f9eb00adbb1a7f4418e0c05122111be2c222db802ed75335e926f157481578c
Python
32,635
630
'''EG2EP''' # import pandas as pd # import os # # 指定数据集文件所在的目录和结果保存目录 # # data_directory = '/home/tjzhang03/zxj/deal_data/data_input/BENGI/Remove-Ambiguous-Pairs.Natural-Ratio/conbine_data/' # data_directory = '/home/tjzhang03/zxj/deal_data/data_input/BENGI/All-Pairs.Natural-Ratio/' # # data_directory = '/home/tjzh...
653f0ce0b8d44455a8b8883284a29dee3fab19b89bd86505857544073f115f43
Python
32,659
273
dataset_metadata = { "mouseID_19030607-191192": "https://download.brainimagelibrary.org/inventory/e9102e30-6863-5c3f-82da-98ea37aad4d6.json", "mouseID_w19082922-193663": "https://download.brainimagelibrary.org/inventory/6d267b5b-f370-5060-a5ca-cfc0c83c5261.json", "211061": "https://download.brainimagelibrar...
6d3d93d1a37427ec55e8aab2f67c8dccfb03238741e2d22d834a151cba118ce3
Python
32,710
841
# 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...
7ca71f1b574a41a186330a944c389032a747e19fdb3d3633f30f0323c0345169
Python
32,737
872
""" (*)~--------------------------------------------------------------------------- Pupil - eye tracking platform Copyright (C) 2012-2020 Pupil Labs Distributed under the terms of the GNU Lesser General Public License (LGPL v3.0). See COPYING and COPYING.LESSER for license details. ------------------------------------...
00ce2aacd358c82757ef65fd0e7123aa393f9e9b8ed2958c066347eec84b87aa
Python
32,750
659
from typing import Dict, Tuple import traceback import cv2 import numpy as np import torch # torch.backends.cudnn.enabled=False import sys import os sys.path.append(os.getcwd()) sys.path.append('../pysot') from pysot.core.config import cfg from pysot.models.model_builder import ModelBuilder from pysot.tracker.tracke...
acefe90d61264580eae5d89e550f0c78a0630386851acd59fda80bdfb96b281f
Python
32,751
919
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Oct 26 13:05:23 2021 @author: joaquin """ import matplotlib.pyplot as plt import seaborn as sns import numpy as np import scipy.io import pandas as pd import os import h5py import mat73 from scipy import signal from scipy import stats from sklearn.dec...
c5ffe468352ea1f4f9fbf0761b407d126835b630c7af6193b0480d704a4af930
Python
32,871
811
import logging import tqdm from torch.nn import functional as F import torch from pyfaidx import Fasta import numpy as np import pandas as pd from pyensembl import Genome import vcf as pyvcf from model.model import SpTransformer from model import SpliceAI IN_MAP = np.asarray([[0, 0, 0, 0], [1, 0,...
e8d4444fb9e876c8e0104b6e61b81e89e0c6c9a170fcfc0295a02c47324ee30c
Python
32,873
767
""" Defines class CleftRegions that holds cleft-related data (geometry and layers) from one or more observations (experiments) divided (classified) in groups. The observations are expected to be generated by scripts/cleft.py. or classify_connections.py. # Author: Vladan Lucic (Max Planck Institute for Biochemistry)...
e3838763e21c4b0c9ee8d59d5372347adc203405e27d9775510fec9f612da2eb
Python
32,889
708
""" DeepLabCut2.0 Toolbox (deeplabcut.org) copyright A. & M. Mathis Labs https://github.com/AlexEMG/DeepLabCut Please see AUTHORS for contributors. https://github.com/AlexEMG/DeepLabCut/blob/master/AUTHORS Licensed under GNU Lesser General Public License v3.0 """ import os import os.path import glob import cv2 import...
c04fa68f9d7498d662eed19c245a07eeda13a917cffc3b101e4bc27c822ad808
Python
32,897
830
#!/usr/bin/env python3 # System imports import os from os import listdir from os import walk from os.path import isfile, join from pathlib import Path import sys import glob import numpy as np import re import time import pudb from sc...
a9d0a6bc70467e84d86396047b45c7ffd342de44aa398d5d3b4070408e1577eb
Python
32,926
712
import schnetpack as spk import torch import torch.nn as nn from torch.autograd import grad from schnetpack import Properties from schnetpack.atomistic import Atomwise import schnarc from schnarc.data import Properties class StateModel(nn.Module): def __init__(self, representation, output_modules, mapping=None)...
c3de77af5314a2cf4a80fdc3f18155fc4206f8cc042669a295f3525518ee116b
Python
32,963
803
""" Contour extraction, normal estimation, and correspondence matching. Provides functions for finding contours in brain images, estimating surface normals, computing 2D correspondences, and performing slice-to-slice Laplacian registration. Performance optimizations: - Parallel slice processing with joblib -...
76a57c985e32f1e41ead2cdaccc36290992c4a1a32cad637c2384db410065e4c
Python
32,965
847
"""Single HED schema object representing a loaded vocabulary specification.""" from __future__ import annotations import json from pandas import DataFrame from hed.errors import ErrorHandler from hed.errors.error_types import ValidationErrors from hed.errors.exceptions import HedExceptions, HedFileError from hed.sc...
826f251339fc996bded82851e1a57eaa901d7384edef4e23cbfa84d3855a947c
Python
32,968
585
"""The four stages of SpreadsheetValidator, their stops, and the DataFrame-free path.""" import io import json import os import unittest import pandas as pd from hed import Sidecar, SpreadsheetInput, TabularInput, load_schema, load_schema_version from hed.errors.error_reporter import ErrorHandler from hed.errors.err...
acc91114d47fd8fd3024155725b90277aa7eeb8dbe2f6e0099b5b4441765d322
Python
32,980
710
# 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...
18f86f921e38c1b91c090d1f3cfeef6a1a9442b9cbe14bf1aae7b75510fcb9a4
Python
33,038
589
import sys assert('neuron' not in sys.modules) import os nrn_options = "-nogui -NSTACK 100000 -NFRAME 20000" os.environ["NEURON_MODULE_OPTIONS"] = nrn_options import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm import matplotlib.animation as animation imp...
3cb83634b4b0d22ce3c88fc93f4269f6a5765a369e81fd6ef7721e2b7c6d4f52
Python
33,042
917
# -*- coding: utf-8 -*- """ Created on Mar 9 2023 @author: Jonas A. Thiele """ ### Comparisons between results of network-specific link selections in the main sample #%% Imports import pandas as pd import numpy as np import scipy.stats import seaborn as sns from matplotlib import colors import mat...
4e3115abd4bc67d9d91cd4e06ec3bc06a8fa9b73b07ab094ae240f965141cb4f
Python
33,068
731
# 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...
8691b6f419b63c0abb1bea204dab5970d5208f0b74ce97535edc46c3833f32d5
Python
33,084
874
# The following comment should be removed at some point in the future. # mypy: strict-optional=False import functools import logging import os import shutil import sys import uuid import zipfile from optparse import Values from typing import Any, Collection, Dict, Iterable, List, Optional, Sequence, Union from pip._v...
ebf046f2fcdd24dd7b1982995247b03d0ee519c72f85256e050118153047f752
Python
33,111
809
# -*- encoding: utf-8 -*- r""" pyparser -- module for parsing Python files. This module provides capabilities for parsing Python files into logical pieces. It relies on standard module :mod:`tokenize` to break the file into tokens, and then combines those tokens into high-level code constructs. Unlike :mod:`ast`, this...
fa205b2d73ab8f9c0c338830f91a0e1b12b3ea2fb558a1979ed1aa69edfcc84e
Python
33,129
645
#!/usr/bin/env python # ============================================================================= # GLOBAL IMPORTS # ============================================================================= import os import numpy as np import pandas as pd from logP_analysis import mae, rmse#, barplot_with_CI_errorbars from lo...