sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
8cdb43e3479d61ad64eed7254238a89098ba1b417da7f53436ad824f05c73e64
Python
9,713
216
import os import msvcrt # For Windows systems ''' By properly implementing file locking mechanisms like using msvcrt for Windows systems, one can ensure that the Optuna optimization process runs smoothly without encountering race conditions or file locking issues, even when using multiple processes (n_jobs > 1). '''...
34d15b17afabffd82f724272764e02f309743553f36c14da8badb64cd97dc031
Python
9,714
256
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and 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/LICEN...
1f8c539c3386226d0c9c1294c45641ff873d80095482db6adf2c16b34528a49c
Python
9,715
203
import torch import numpy as np import torch.nn.functional as F import torch.nn as nn from utils import * from self_calibration import * from torch.fft import fftshift, ifftshift, ifft2, fft2 from fft_conv_pytorch import fft_conv, FFTConv2d dtype = torch.float32 class forward_model_lsm_variant(nn.Module): def __i...
7d0d87884393f5ba7e1e55309d13c4e19f5b41dfc075ab358c86a2383670747b
Python
9,715
246
"""Class and functions for ``[vak.prep]`` table of configuration file.""" from __future__ import annotations import inspect import dask.bag from attrs import converters, define, field, validators from attrs.validators import instance_of from .. import prep from ..common.converters import expanded_user_path, labelse...
9574849e2354a9190adafcbcf887835c1ba853bc81d9c556abf327f8929b1f2d
Python
9,716
290
import torch import torch.nn.functional as F import numpy as np from math import log10 """ At Pado, all measurements adhere to the International System of Units (SI). """ nm = 1e-9 um = 1e-6 mm = 1e-3 cm = 1e-2 m = 1 s = 1 ms = 1e-3 us = ms * 1e-3 ns = us * 1e-3 def wrap_phase(phase_u, stay_positive=False): """ ...
5b6883bb8d2db7b68c0cf400c7836f8a40299875732f76f425cdbbf106138d7e
Python
9,717
215
import os import fcntl # For Unix-like systems (including Ubuntu) ''' By properly implementing file locking mechanisms like using fcntl for Unix-like systems, one can ensure that the Optuna optimization process runs smoothly without encountering race conditions or file locking issues, even when using multiple proces...
2f9b0ad6246bb9ef3fda5485b3f2409c26e58c5b0f53a5a12729847ffacff7c2
Python
9,718
217
import os import msvcrt # For Windows systems ''' By properly implementing file locking mechanisms like using msvcrt for Windows systems, one can ensure that the Optuna optimization process runs smoothly without encountering race conditions or file locking issues, even when using multiple processes (n_jobs > 1). '''...
f2e13a5b67251162e5f5e568bb295aef75c7e9f5739501b8b3706a99acc39179
Python
9,718
368
"""Functions for input validation""" from __future__ import annotations import pathlib import warnings import numpy as np import numpy.typing as npt import torch def column_or_1d(y: npt.NDArray, warn: bool = False) -> npt.NDArray: """ravel column or 1d numpy array, else raise an error Parameters ------...
091d341e84bf26065f9ee792989e488f86cc0b910c9c801e4396483361bfbd55
Python
9,719
297
""" Unified compute-parity logging for HIPPIE / PhysMAP / NEMO benchmark runs. The goal is a single CSV schema that every benchmark method appends to, so we can build a per-method x per-dataset wall-clock and peak-memory table for the Nature Comms supplement (the "compute parity" reviewers will look for). Schema (one...
885f649011db9546ac2e2998ffd10b33879bb705223d87ebf700c13e61c7c322
Python
9,720
217
import os import msvcrt # For Windows systems ''' By properly implementing file locking mechanisms like using msvcrt for Windows systems, one can ensure that the Optuna optimization process runs smoothly without encountering race conditions or file locking issues, even when using multiple processes (n_jobs > 1). '''...
5c0873d05f7b2aa95ea319a41162ad92b41478c0c6d4aaee08b9423984118931
Python
9,724
253
__author__ = "alvaro barbeira" import numpy import pandas import copy import math from . import Utilities from . import MultiPrediXcanAssociation, PrediXcanAssociation from ..expression import HDF5Expression, Expression #################################################################################################...
22aa76225052d6c5f0ba91ee857300f797d27f7940d28cae4706e4e6af04e2a9
Python
9,726
268
""" PyTorch Lightning Module for Garfield training. This module wraps the GNN-VAE model for distributed training with PyTorch Lightning. """ import torch import pytorch_lightning as pl from typing import Dict, Any class GarfieldLightningModule(pl.LightningModule): """ Lightning wrapper for Garfield GNN-VAE m...
baefc1e3ea8bab4dc2199a0189e5af3aee94b6136b024af5d7c246f735b94036
Python
9,727
151
import os def create_chanmap(kilosort_location, EndChan, StartChan = 1, probe_type = '3A', Nchannels = 384, MaskChannels = []): mask_string = '[' for channel in MaskChannels: mask_string += str(channel+1) mask_string += ' ' mask_string += ']' chanmap_string = make_chanmap_strin...
81904bddc473ea7a9d171e3bf4e31da528f1537aab699d8cdaf173c95100a15b
Python
9,729
239
""" Turn a merged corpus into tfrecord files. NOTE: You will want to do this using several processes. I did this on an AWS machine with 72 CPUs using GNU parallel as that's where I had the deduplicated RealNews dataset. """ import argparse import ujson as json from sample.encoder import get_encoder, tokenize_for_grove...
246a36e73f3931235ebe4aa1805c78113048be4f95aedefed7ce12da81af40a8
Python
9,739
158
import torch import torch.nn as nn from dropblock import DropBlock2D, LinearScheduler from ..layers.convolutions import * class MSR_Convset_L(nn.Module): def __init__(self, filters_in): super(MSR_Convset_L, self).__init__() self.__dw0 = Convolutional(filters_in=filters_in, filters_out=filters_in*2,...
371b0507549e1259be12b1bf582eca054d1c9f61ee61cad59cd76e25fb0c9387
Python
9,740
245
from sys import float_info import numpy as np from .cfmm import cFastMarcher FAR, NARROW, FROZEN, MASK = 0, 1, 2, 3 DISTANCE, TRAVEL_TIME, EXTENSION_VELOCITY = 0, 1, 2 def pre_process_args(phi, dx, narrow, periodic, ext_mask=None): """ get input data into the correct form for calling the c extension module ...
8cfe3fa8331b112625430a9df186b104dae186eeee8dc678fb454501f55561aa
Python
9,740
251
import os import h5py import warnings import matplotlib import numpy as np from scipy import stats from sklearn import mixture from skimage import morphology from types import SimpleNamespace from scipy.ndimage import median_filter with warnings.catch_warnings(): warnings.simplefilter("ignore") matplotlib.us...
6c0af4b88bdd688f77bfe321d25843b7d02f2ef4cfea33f8972ec28c3378c4a4
Python
9,744
257
import numpy as np import subprocess import os import json import struct import func.utility_func as uf class MCX_adapter(): ''' invision source: https://github.com/IMSY-DKFZ/simpa ==================================Workflow================================== 1. save simulation ...
7c2286d9b29d59f628e7b4971b65f81045d1d789b1585c62ee8c1fa5973e2ea7
Python
9,749
245
# _*_ coding: UTF-8 _*_ # Version information START -------------------------------------------------- VERSION_INFO = \ """ Author: ZHANG YUBO Version-01: 2026-01 Inferring evolutionary relationship from multiple sequence alignment for three population """ # Version information END ----------...
809679e77303d5443924dff088635f9cfb286f99280809351ba3c3bc7570a0a9
Python
9,751
270
from typing import Dict, Optional, Union, Sequence import torch import tape import transformers import numpy as np import msm from copy import copy import logging from utils.align import MSA import itertools logger = logging.getLogger(__name__) class Vocab(object): def __init__( self, tokens: Dic...
383926bf043c85fa69a3ac8a54aaf05de662e4926090683c4f3280f3d4d35327
Python
9,752
303
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import logging import os import contextlib from dataclasses import dataclass, field from typing import Optional from omegaconf import MISSING...
da00df9f341a0a4d120fed2a28f26558b5abcb4ac8c615dc507b3f1400ddb461
Python
9,758
256
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. from collections import defaultdict from typing import Iterable, List, Mapping import numpy as np from pymatgen.analysis.structure_matcher import StructureMatcher from pymatgen.core.structure import Structure from pymatgen.entries.computed_entri...
66ad73676fe83a011ed88d9f716acb7387d5e7a8d87c6a5eb4ede65e51043bec
Python
9,765
227
#!/usr/bin/env python """Fetch a URL and save its raw response body to disk as a test fixture. RNAlysis leans on external web services (UniProt, Ensembl, PANTHER, PhylomeDB, OrthoInspector, KEGG, GO, ...) that change formats, rename fields, and go down without notice -- see CLAUDE.md: "External web APIs are the most f...
c0791504b229f14ef758805077f0deeb18bf59145527b26cc78fc9ae099ad174
Python
9,769
254
import numpy as np from mot.lib.cl_function import CLFunction, SimpleCLFunction __author__ = 'Robbert Harms' __date__ = "2014-06-19" __license__ = "LGPL v3" __maintainer__ = "Robbert Harms" __email__ = "robbert@xkls.nl" class ParameterPrior(CLFunction): """The priors are used during model sample, indicating the...
8e1fad1ddde3a1025bc59a7066c65ba10a0ea372fb3493915d9c129847c7c2f5
Python
9,770
282
"""Modules used on the ProteinBERT model. This code has been modified from the original implementation by Facebook Research, describing its ESM-1b paper.""" import math from typing import Optional import torch import torch.nn as nn import torch.nn.functional as F from .multihead_attention import MultiheadAttention...
827af9812451eed478567c13292dca0fedf4f6526919e0a2e0b980965fff8e7b
Python
9,772
224
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and 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://ww...
0c2463010aa17b53434684b932ea4717bb5ae862ff8434dc2af61ed858c263ba
Python
9,773
225
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and 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://ww...
335f82f437102408048db82277719b9f754168fb028a9194f7cd2cfc96b3728b
Python
9,773
270
from constructs import Construct from aws_cdk import ( Stack, Tags, Size, RemovalPolicy, aws_iam as iam, aws_ec2 as ec2, aws_batch as batch, aws_ecs as ecs, aws_s3 as s3, ) import boto3 class AwsBatchStack(Stack): """ References: - https://constructs.dev/packages/@aws-c...
d4a388cce9e4ff23d05e55f088c5cb18949ab49b913f86b2fbb54dba19b1d0ce
Python
9,773
189
import sys sys.path.append("..") from modelR.backbones.mobilenetv3 import MobileNetV3 from modelR.backbones.mobilenetv2 import MobilenetV2 # from modelR.necks.conv_csa_drf_fpn_hbb import Conv_CSA_DRF_FPN,FC2_CSA_DRF_FPN,Cat_Conv_CSA_DRF_FPN,M_CSA_DRF_FPN from modelR.necks.Three_Head import FC2_CSA_DRF_FPN from mo...
22b5278350958cad577a655c4c6408d4a9d6252dfb4ec457ef88b16ca62149d2
Python
9,776
213
import os ''' By properly implementing file locking mechanisms like using msvcrt for Windows systems (and fcntl for Unix-like systems), one can ensure that the Optuna optimization process runs smoothly without encountering race conditions or file locking issues, even when using multiple processes (n_jobs > 1). ''' impo...
918c46ca5f90bc9762536ad9206bb49f2dd3193751b0e14ef37f06c2543d23d5
Python
9,776
222
# # Copyright 2017-2023 Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with # Sandia Corporation, the U.S. Government retains certain rights in this software. # # See LICENSE for full license details # from abc import ABC, abstractmethod import warnings from simulator.parameters.xbar_parame...
dd64b0c7918ca6e75e6ff1ec8e2aeb02acf7017209f7a039fbbba99bc5f7e5d9
Python
9,779
262
import torch import sparse import argparse import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from PIL import Image from pathlib import Path from einops import reduce, rearrange, repeat from utils import MROI # https://stackoverflow.com/questions/5543651/computing-standard-d...
83215650338120d71be5d34b3784c8d9e1df35ffdb3f2e17ecae266dfe391bcb
Python
9,780
262
import numpy as np import omegaconf import pandas as pd import torch from torch_geometric.data import Data, InMemoryDataset from utils.data.abstract_datatype import ( AbstractDataModule, AbstractDatasetInfos, Statistics, ) from utils.data.load import ( character_to_int, detect_nan_rows, position...
4ee47e6c3b478cf69c099ba759591af9de2a4a37ec6680d8d9235adb5ddfc905
Python
9,781
192
#!/usr/bin/env python3 """build_data_sources_table.py — comprehensive data-sources table for the manuscript. Generates Supplementary Table S1 listing every contributing study with: - GSE / PRIDE / cohort identifier - Tissue + platform + MS / HC sample sizes - PMID and citation anchor - Stratum used in analysis...
88d15db3c7fed1349e0e26b2604708df6d726415164dc37ed0674beb3201b015
Python
9,783
223
# Copyright 2021 HIP Applied Computer Vision Lab, 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...
faeffd0f5496de378fb036a4774c1c8d6851f98024d0eda75840b05ef9de0ed4
Python
9,785
206
#!/usr/bin/env python3 """A utility to calculate the input and output length of BPReveal models.""" # flake8: noqa: T201 import argparse def getParser() -> argparse.ArgumentParser: """Command line arguments for the length_calc script. :return: An ArgumentParser, ready to parse_args() """ parser = arg...
fe65607b88e5e4083d1298997621b65e7ef5482cb8e3af6c29c820ba1d96739f
Python
9,786
209
from __future__ import annotations import argparse import json from pathlib import Path import numpy as np import pandas as pd from scipy.stats import pearsonr, spearmanr from sklearn.metrics import average_precision_score, roc_auc_score from st_risk.paths import current_results_dir, ensure_results_layout, project_r...
ed8d4c48c0c7ebdf52ce32100ba672d3769996d6df5a46614b75b9b0d5e49e6f
Python
9,787
213
import os ''' By properly implementing file locking mechanisms like using msvcrt for Windows systems (and fcntl for Unix-like systems), one can ensure that the Optuna optimization process runs smoothly without encountering race conditions or file locking issues, even when using multiple processes (n_jobs > 1). ''' impo...
6ceb7fa2164338af248708796056c79a2975e58f4d7c9007e004aa7acdd27a2f
Python
9,790
213
import os ''' By properly implementing file locking mechanisms like using msvcrt for Windows systems (and fcntl for Unix-like systems), one can ensure that the Optuna optimization process runs smoothly without encountering race conditions or file locking issues, even when using multiple processes (n_jobs > 1). ''' impo...
97b77911439c1a82834a0d898d58f1d8cbe1d336603406f7057599d9e1148bd0
Python
9,792
203
#!/usr/bin/env python3 """Figura do mecanismo: o haleto domina, e o efeito do cátion B é condicional. VERSÃO CORRIGIDA. A primeira tentativa afirmava "dois eixos de controle ortogonais -- o haleto move a valência, o cátion B move o gap". **Os dados contradizem isso** e a própria figura mostrava: o painel do desacoplam...
3beb468ac783721595884a5b9d19544679d3c0ce87008834432a12bd3a7351e4
Python
9,793
216
from torch import nn import torch import torch.nn.functional as F class ConvolutionalVAE(nn.Module): def __init__(self, latent_dim=20, n_cls=10, img_size=28, n_convs=None, in_ch=[1,32,64,128], conditional=False, kernel_size=3, stride=2, padding=1, h_dim=2048, relu=False, req_flatten_size=None, la...
2b686a1bedf6180f3959f837e7cfc9ad2a13e1d44b23055f3d50f67a08dd17e3
Python
9,797
253
from dataclasses import dataclass from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Tuple, Union import inspect import math from loguru import logger import os import torch import torch.nn as nn from torch.nn import functional as F from transformers.generation.utils import SampleDecoderOnlyOutput ...
913175846469318eaae98cabaff9a4a79115061810cf8f8924e209296e321359
Python
9,798
244
# Copyright 2019 The TensorFlow Authors. 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 applica...
1999cfb823d9067454c2112c4bd2dcee281490ccd2b75be76eeafd79d72cb79c
Python
9,799
341
""" Wrappers for VTK algorithms and mappers. """ # Author: Oualid Benkarim <oualid.benkarim@mcgill.ca> # License: BSD 3 clause from vtk.util.vtkConstants import VTK_DOUBLE from .base import BSVTKObjectWrapper, wrap_vtk from .property import BSTextProperty from .lookup_table import (BSLookupTable, BSLookupTableWithE...
429fd45b7c5553f8f6b9ed0b4fc520ccb23efdbe949bd0a6526aece4338d17d8
Python
9,805
290
#!/usr/bin/env python2 """Tool for extending via equivalences a set of segments.""" import argparse import copy import os import webbrowser import neuroglancer from neuroglancer.json_utils import decode_json, encode_json neuroglancer.set_static_content_source(url="http://localhost:8080") def get_segmentation_layer...
623988e6122a758c2dca8524803523578da11b3be4da6506e2e9c35f078df465
Python
9,810
181
"""End-to-end mango DMC benchmark (the large, nonlinear NIR case; complements linear tahini). Leakage-free interseason external validation: train = Seasons 1-3 (Set Cal+Tuning), test = Season 4 (Set 'Val Ext', zero Pop overlap). SG1 preprocessing; equal light tuning (inner GroupKFold by Pop); single continuous target (...
983af1991ee2e18fc0fa5a24f5210209af7a1af70d965243a68b320b31557eea
Python
9,813
212
"""Given user GO ids and parent terms, group user GO ids under one parent term. / Given a group of GO ids with one or more higher-level grouping terms, group each user GO id under the most descriptive parent GO term. Each GO id may have more than one parent. One of the parent(s) is chosen to best represen...
23ca3265df954ba80a4ef87d5c757d27893c0bc3cd568169c85cf6633a92c743
Python
9,816
226
from os.path import join, dirname, realpath import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from matplotlib import gridspec from mpl_toolkits.axes_grid1 import make_axes_locatable from analysis.data_extraction_utils import get_pathway_names from setup import saving_dir d...
6070b61750ac7608093fc4500d968a5b688a587ef6cdd263d33caa7bb728dcd7
Python
9,817
164
""" Copyright 2020 Binxu Wang Use GAN as prior to do feature visualization. This method is inspired by the work Nguyen, A., Dosovitskiy, A., Yosinski, J., Brox, T., & Clune, J. Synthesizing the preferred inputs for neurons in neural networks via deep generator networks.(2016) NIPS The GAN model is imported fro...
9538f7b83c5476671e06a10a5951d86ae7aeb347bbc468f45616fe35b9a0ec02
Python
9,821
214
import os ''' By properly implementing file locking mechanisms like using fcntl for Unix-like systems ( and msvcrt for Windows systems), one can ensure that the Optuna optimization process runs smoothly without encountering race conditions or file locking issues, even when using multiple processes (n_jobs > 1). ''' #im...
96ffe59b3b1bc2cdbe055c6426ef5d8e8fabb32bfabde57d7eca4d4898d5a8d9
Python
9,823
304
#!/usr/bin/env python # -*- coding: utf-8 -*- """Matches cells and regions""" from typing import Dict, List, Literal, Optional, Tuple, Union import numpy as np # import matplotlib.pyplot as plt from scipy import ndimage as ndi from skimage.segmentation import watershed # , find_boundaries from sklearn.linear_model...
50eaf4f7b8e8964dc3b099ffa7d3f3cd7fe42c826f5e53e0b6b2c76d82a09185
Python
9,826
293
""" Copyright (c) Facebook, Inc. and its affiliates. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. """ import torch from torch_scatter import scatter from ..initializers import he_orthogonal_init from .base_layers import Dense, ResidualLayer f...
0c9227a95fe1f40c273800ba04a58f8aabd455c91c51dc1d7254f31c69a5556a
Python
9,828
246
# Copyright 2019 The TensorFlow Authors. 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 applica...
e175d94750c9484c560be82123ade138c5da7041cab2863203f32b4b05459118
Python
9,830
214
import os ''' By properly implementing file locking mechanisms like using fcntl for Unix-like systems ( and msvcrt for Windows systems), one can ensure that the Optuna optimization process runs smoothly without encountering race conditions or file locking issues, even when using multiple processes (n_jobs > 1). ''' #im...
618d49a01c84409568b1fe9da4710428547616430d89b535678b9ecf85d58721
Python
9,831
214
import os ''' By properly implementing file locking mechanisms like using fcntl for Unix-like systems ( and msvcrt for Windows systems), one can ensure that the Optuna optimization process runs smoothly without encountering race conditions or file locking issues, even when using multiple processes (n_jobs > 1). ''' #im...
f54da7149aac56facd8779cd6ec8d8a767fa9b57394b5ef19942afc33f255be0
Python
9,832
214
import os ''' By properly implementing file locking mechanisms like using fcntl for Unix-like systems ( and msvcrt for Windows systems), one can ensure that the Optuna optimization process runs smoothly without encountering race conditions or file locking issues, even when using multiple processes (n_jobs > 1). ''' #im...
085757e3833b675a5c5f08868f2a6d7bb0b67364a7a38bd7f3eafe7270911658
Python
9,835
321
import torch import torch.nn.functional as F from einops import einsum, rearrange, repeat from mamba_ssm.ops.triton.layernorm_gated import ( _layer_norm_fwd, _layer_norm_bwd, ) from mamba_ssm.ops.triton.ssd_combined import ( _mamba_chunk_scan_combined_bwd, _mamba_chunk_scan_combined_fwd, ) def flip(in...
a4ba1814ff5c8e298214c4262d25739c6d135cefa99a4e3d4512de57039e94d4
Python
9,839
215
import os ''' By properly implementing file locking mechanisms like using fcntl for Unix-like systems ( and msvcrt for Windows systems), one can ensure that the Optuna optimization process runs smoothly without encountering race conditions or file locking issues, even when using multiple processes (n_jobs > 1). ''' #im...
c4399c0891f001187667ee888df4dbc021249c4fa7b20ec8c6f103e4b44d8078
Python
9,839
253
import functools import os import tempfile import unittest import numpy as np import torch import medaka.datastore import medaka.training import medaka.torch_ext import medaka.models from medaka.test.test_sample import get_test_samples class TestNamespace: class ModelAndData: CheckpointType = medaka.to...
e65e2aab0f9e5cdab71acefb76fc1b8f7359f65c1c1fc37f606397133514a4d5
Python
9,839
250
""" DWP Pipeline — Distance-Weighted Pooling Phase 1: MAP-identical CV to select best feature/DA/classifier Phase 2: Compute source-to-target distances in best feature space Phase 3: All-source continuous inverse-distance weighting Phase 4: Deterministic weighted merge (replication) Phase 5: DA once on merge...
4881c9d870fe145359d2614c98cb526de43177b8c42a611317aded1a2395da3e
Python
9,847
345
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # SHAP documentation build configuration file, created by # sphinx-quickstart on Tue May 22 10:44:55 2018. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autog...
4fe76cfc6d3929aa78fed3ca86287cae566cc382ba0dee550177f717110df62b
Python
9,850
237
"""module to plot sensornode measurements using pyqtgraph """ import pyqtgraph as pg from Sensors import constants import numpy as np from datetime import datetime from queue import Queue class plotter: """Class that contains methods to setup a pyqt plot grid and plot measurement curves Attributes ...
2a8cde23116272a965507eb47c660bfa968e76f3ba4682f8fd6bfc0bf4e70446
Python
9,851
163
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'optimization_options_dialog.ui' # # Created by: PyQt5 UI code generator 5.10.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_OptimizationOptionsDialog(object): def setupUi(...
f4505b52d411fe3317066ec091212d56775e9b27a27e161bb4d60f5924fa6118
Python
9,851
187
import gzip import sys import argparse SHOW_WARNINGS = False def parseArgs(args): parser = argparse.ArgumentParser( description="Create annotation file from UCSC knownGene file.") parser.add_argument("known_gene_file", help="UCSC knownGene file") parser.add_argument("out_file", help="Output file n...
70ae5e50b04e631836b729d7cf1c60d7fcd459409af6e2211ca5caaaa2f30933
Python
9,857
151
# coding=utf-8 # Copyright 2019-present CNRS, Facebook Inc. and 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 #...
c98cc741be5f8fe753ab269aff5eb7656742b1881c6b2c69c9103fb4d9462b16
Python
9,858
152
# coding=utf-8 # Copyright 2019-present CNRS, Facebook Inc. and 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 #...
1da4d7c30f6ae09bad9de39922fb88ba57d4443621271acf9b86cbd3f2df7459
Python
9,859
189
#!/usr/bin/env python3 r"""Rebuild Supplementary Table S2 for the current 94-gene inverse-concordant pool. WHY THIS EXISTS. S2 was last written for the 82-gene pool, before the expression-matrix repair raised the pool to 94, and its tier column still placed CD79B in Tier-1. Two scripts had since bolted columns onto th...
a41121ce55f6a3af4be42bf414197f19f251f9e2bc9050a0079afce148d3ab06
Python
9,860
316
from pathlib import Path from types import SimpleNamespace import numpy as np import pytest import torch import yaml from gpn.data import Tokenizer as StarTokenizer from gpn.ss.model import GPNConfig, GPNForMaskedLM from gpn.ss.train import ( DataTrainingArguments as GPNDataTrainingArguments, ) from gpn.ss.train ...
0a15731dbc9b72b40bfdca935d9c58d32a72e6ddb7c0850f14bf27df61d61cfa
Python
9,861
301
from __future__ import annotations import abc from abc import abstractmethod from typing import TYPE_CHECKING import torch from torch.distributions import ( Categorical, Independent, MixtureSameFamily, Normal, kl_divergence, ) from scvi.module._constants import MODULE_KEYS if TYPE_CHECKING: ...
804be03a36d6da1a391f96c6a532abc1b059708c56346715176f921ba0b70290
Python
9,864
244
#!/usr/bin/env python # coding: utf-8 """ Temporopolar blurring in HS: ipsilateral / contralateral surface t-maps + raincloud plot. Produces three figures: 1. ipsi_supp.png - ipsilateral HS vs controls, vertex-wise t-map 2. supp_contra.png - contralateral HS vs controls, v...
150ed2c1585e15fb54cf6ab6e374d5667220d8b3754c66589540cbfb952c3dfd
Python
9,865
294
"""No module invents a field on the base model's `transformers` config. A `PretrainedConfig` is a plain object: assigning an attribute it does not define stores it and nothing ever reads it back, so the failure is silent by construction and this is a source-level check. The scan follows a local alias, `setattr`, `.upd...
86f9012b845dea6fbfff6f6ed37fdff06f224aa4006f6722c8f901517211bc20
Python
9,865
260
import numpy as np from pathlib import Path import pickle import argparse from datetime import datetime from deploy.iblsdsc import OneSdsc as ONE from brainbox.io.one import SpikeSortingLoader from iblatlas.regions import BrainRegions from iblatlas.atlas import AllenAtlas import gc import pdb from celltype_ibl.params.c...
08ddc2001c53919c4a8492de6d94310e134dabfddd1eb490fd7ffa1f720c8aef
Python
9,887
250
from __future__ import annotations import logging import os from pathlib import Path import dask.bag as db import numpy as np from dask.diagnostics import ProgressBar from ... import config from ...common import constants, files from ...common.annotation import map_annotated_to_annot from ...common.converters import...
51c6bbb0adb7d36b7791fd9191d25e2fa00b92dbe6b6011897b4bc151db31b89
Python
9,890
230
#!/usr/bin/env python from itertools import combinations import networkx as nx from pgmpy.base import DAG from pgmpy.estimators import StructureEstimator from pgmpy.structure_score import get_scoring_method from pgmpy.utils._warnings import _warn_external from pgmpy.utils.mathext import powerset class ExhaustiveSe...
280bce795134329112657ded6eef9aa765d54ee0ebbc123161deb1e1c15f7d21
Python
9,892
222
from .utils import IntermediateLayerGetter from ._deeplab import DeepLabHead, DeepLabHeadV3Plus, DeepLabV3 from .backbone import ( resnet, mobilenetv2, hrnetv2, xception ) def _segm_hrnet(name, backbone_name, num_classes, pretrained_backbone): backbone = hrnetv2.__dict__[backbone_name](pretrained_...
c915e537868f62c02dccf843dba2a323f256bfc7266a17158caffd033eb82aad
Python
9,893
291
# Copyright (C) 2025 ETH Zurich, Moritz Thürlemann, and other AMP contributors from torch import Tensor from typing import Final from utilities.Scatter import scatter_sum as scatter import torch import numpy as np from datastructures.Graphs import Graph from utilities.Utilities import ff_module, scalar_product cla...
bb3601dda77979052d836101e95f227fb1a5c831dd4420ced0e98e6c6da37559
Python
9,903
255
# This is the class for Physics informed neural network for phase field modeling in 2D #文件2 PINN2D_PF import tensorflow as tf import numpy as np import time class CalculateUPhi: # Initialize the class def __init__(self, model, NN_param): # Elasticity parameters self.E = model['E'] ...
becfbd030ee266b0a53aba6f3cea815f0fa91207e3560eb90293c25267f92d9c
Python
9,912
247
"""Facade for telemetry workbook export orchestration.""" from __future__ import annotations from pathlib import Path import pandas as pd from src.features.telemetry_alignment.exporters.cluster_sheet_exporter import ( populate_cluster_sheet as export_cluster_sheet, ) from src.features.telemetry_alignment.export...
59e1d94f953ae38d9ec7292b4be5619933508306db1dbe3ddda468d268207f3c
Python
9,913
256
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and 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 # # U...
999be6e2bde1d6eef4b989d8e525c5050a23e24e33c625800d7e8c73fd712d3a
Python
9,914
257
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and 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 # # U...
e6f3a24622b3b8b066677b14c60cdd904b5b0cedcfcb3cf8600d23ec2a12aeb2
Python
9,922
264
# Source code: # https://github.com/zbmed-semtec/doc2vec-doc-relevance-training/blob/main/code/train_model/utilities.py # This file includes the modifications to the source codes according to this project! import tqdm import gensim import logging import numpy as np import pandas as pd from scipy.spatial.distance impo...
2d517d16bd4b5c5934af52b25f4f468524ae2437cbfe0ad4a11557254ff88f29
Python
9,935
332
""" Utility constants and helper functions for the EEG Streamlit dashboard. """ import numpy as np import pandas as pd import plotly.graph_objects as go # --------------------------------------------------------------------------- # Pipeline name mappings # ------------------------------------------------------------...
7614e0d9ab21e0e228a367a614f381e4d9eb8a31d748897d04cc0481f72b11e1
Python
9,936
218
import os import msvcrt # For Windows systems ''' By properly implementing file locking mechanisms like using msvcrt for Windows systems, one can ensure that the Optuna optimization process runs smoothly without encountering race conditions or file locking issues, even when using multiple processes (n_jobs > 1...
aa72f0ccb67fb79daad6b7afec39ea638db0e14131a5033a36513a1ea4313b62
Python
9,937
213
# This script takes gff3 made by TransDecoder and shapes it into a format # that can be used to construct Annotation by GenomeKit from src.utils import read_gff, read_gtf import polars as pl from src.single_cell import SingleCell # Read TD_gff and clean TD_gff_path = "full_nt.fasta.transdecoder.genome_remove_spaces....
a5334f2dbb44351b7720e1ca4229453783d27d583eab4e05f95138b35ffaebd7
Python
9,938
319
import numpy as np import torch from scipy.sparse import csr_matrix from scipy.sparse import diags from scipy.sparse.linalg import eigsh from sklearn.cluster import KMeans from sklearn.neighbors import NearestNeighbors from typing import Tuple from typing import List def rbf_neighbor_graph( X: np.ndarray, a...
e54aae4fd5a985a28dac5f8a988b54fe7b85f1f29598be873dd9e755ddc0bade
Python
9,939
457
import numpy as np #Functions that are shared across the scripts used in the spatial-jitter simulations def BSph(r, rq, Q): """ Calculate magnetic field due to a current dipole in a spherical conductor. Sarvas' formula is used' Parameters ---------- r: array (1, 3) the posit...
b5a62362c10d391c7a0435b166ba921f8b7fd17c2e25e38152979b144a999d63
Python
9,946
271
"""Function that trains models in the Parametric UMAP family.""" from __future__ import annotations import datetime import logging import pathlib import lightning import pandas as pd import torch.utils.data from .. import datapipes, models from ..common import validators from ..common.paths import generate_results_...
b911cf2d04792eb0ad2c267493d669281b4fcf6d8d6577fc7ad8a3f868d234cf
Python
9,952
264
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Jan 25 21:27:06 2026 @author: vbp Peak-aligned GRAB-DA kinetics for uncued reward, for Figure S2E/F. Fig S2E - peak-normalized GRAB-DA traces aligned to each session's own response peak, per region Fig S2F - full width at half ma...
349e02a2d657ad1598990c0048f9a2488b5a448833857c479622922b9d5f1f4c
Python
9,953
295
from collections.abc import Mapping, Sequence __author__ = 'Robbert Harms' __date__ = "2016-09-03" __maintainer__ = "Robbert Harms" __email__ = "robbert@xkls.nl" class ConversionSpecification: def __init__(self): """Specifies how the content of an object is to be converted from and to a dictionary.""" ...
f21af4073a2b35d40436d4b5a7ad28d7eadb3a3040a817a9c8a7173097993c54
Python
9,953
280
import json import os from pathlib import Path from typing import Optional, Union import numpy as np import scanpy as sc import torch from anndata import AnnData from torch.utils.data import DataLoader, SequentialSampler from tqdm import tqdm from .. import logger from ..data_collator import DataCollator from ..model...
7c54f8a337ebb0a5a3765f77179b7d86c71ec89d9153272320cd9384b1c66916
Python
9,959
278
# Copyright 2021 DeepMind Technologies Limited # # 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 agr...
c5ca65f6f116e02573d2302e03177a69838a4895ff6053bd6025c4638121898d
Python
9,964
296
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import logging import os from dataclasses import dataclass, field from typing import Any, Optional import numpy as np from omegaconf import I...
406deb5242862d1b2e416aa492cd5b6fdd7898c3b25731795887e8d54e090e4b
Python
9,965
262
from __future__ import annotations import logging from collections.abc import Callable from PySide6.QtWidgets import ( QDialog, QFrame, QGridLayout, QHBoxLayout, QLabel, QPlainTextEdit, QPushButton, QVBoxLayout, QWidget, ) from src.gui.framework.qt_log_handler import QtTextHandler...
48de8448031a55cb327e102e26e857da43da5e8c4852b66625ec2ff57d0e3b86
Python
9,978
321
import json from typing import Literal import numpy as np import pydicom import nibabel as nib import torch from pathlib import Path from monai.transforms import Resize, ResizeWithPadOrCrop from models import FE_Additional def load_nifti_volume(path: str) -> np.ndarray: """ Load a NIfTI CT volume as a numpy ...
8126c0f185d917c7257bb59b9a80ac62570555c26cec47d8aa7799586ba24853
Python
9,978
219
import os import fcntl # For Unix-like systems (including Ubuntu) ''' By properly implementing file locking mechanisms like using fcntl for Unix-like systems, one can ensure that the Optuna optimization process runs smoothly without encountering race conditions or file locking issues, even when using multiple...
5e7cfe21b26925c7034fc4c198241278de0ec2f7d7545a74c9f1f615a7bc85bc
Python
9,979
226
## run ROI-based RSA # # written by S-C. Baek # update: 16.12.2024 # ''' The following code is to run representational similarity analysis (RSA) on 10 predefined ROIs or a subset of them. Here, RSA basically measures the similarity between each or time-resolved neural RDMs at a given ROI and time point, and two model ...
ca6cde0e30cddb7952c201d21741aded9d8f21885b35b940acd7f1a59e435418
Python
9,981
286
"""Class forms of transformations related to frame labels, i.e., vectors where each element represents a label for a frame, either a single sample in audio or a single time bin from a spectrogram. These classes call functions from ``vak.transforms.frame_labels.functional``. Not all functions in that module have a corr...
dd79c955ff9c18e30fd7cb6e80768cd5c236db82cc4cb2065c105eaab981cbcb
Python
9,982
325
import torch import torch.nn.functional as F import numpy as np import nibabel as nib from torch.utils.data import Dataset from collections import defaultdict def load_mindboggle(path, normalization=True): ''' Description: Load mindboggle data -> crop -> scale -> return image and rois ...
83fdd3b4bc40d98ff036194e09f7d4644ddee45aba8a52e39bfa00ab8491e845
Python
9,985
267
# Source code: # https://github.com/zbmed-semtec/doc2vec-doc-relevance-training/blob/main/code/train_model/utilities.py # This file includes the modifications to the source codes according to this project! import tqdm import gensim import logging import numpy as np import pandas as pd from scipy.spatial.distance impo...
0e209f5d3e1dbc347b52c0c2ec02cfe5f8c9f3a759e1777d3c72f6cda655c104
Python
9,994
221
import os import fcntl # For Unix-like systems (including Ubuntu) ''' By properly implementing file locking mechanisms like using fcntl for Unix-like systems, one can ensure that the Optuna optimization process runs smoothly without encountering race conditions or file locking issues, even when using multiple ...