sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
e5fed2031747db8fdd070877293eafd26c5b76b067f1e0870b420c0456be8f25
Python
32,041
713
#!/usr/bin/env python3 """Extrai as propriedades de cada execucao SIESTA para um unico CSV. Este script e a fronteira entre o HPC e a maquina local: ele reduz o diretorio `run/` (milhares de pastas) a um `results/results.csv` de poucas centenas de kB, que e o unico artefato que precisa voltar para o treino OCE. Propr...
d52bb90402001c80ac54532b699681ac6647f150c90401216a9aa541cf144948
Python
32,042
867
# /usr/bin/env python ''' Written by Kong Xiaolu and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md ''' import csv import math import time import numpy as np import torch import scipy.io as sio '''********** Functions for computing simulated BOLD signals ************''' def CB...
256383b7058b0c9fafe1a9463e9a1e0ab20628c03a407a0e2e3473b1d879df53
Python
32,083
693
# 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...
5d83059d9ce93c9f5dd6fafe96e0508ef49195f72028d179011c0ea47eff56e8
Python
32,084
694
# 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...
81fb82cf8a5f01f649dc98211f8019a65078d8de9b843806cc07ec11c982df76
Python
32,091
1,181
import pytest from scvi import settings from scvi.data import synthetic_iid from scvi.model import MULTIVI, SCVI @pytest.mark.autotune def test_experiment_init_adata(save_path: str): from scvi.autotune import AutotuneExperiment settings.logging_dir = save_path adata = synthetic_iid() SCVI.setup_annd...
124f1e04f96da5c714beb68c4f75a4513b2c799e18f320180a4552af6d897015
Python
32,122
834
# Copyright (c) 2025, Guipeng Li # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ HydraRNA """ import logging import torch import torch.nn as nn import torch.nn.functional as F import math from einops import rearrange, repeat from fair...
fe9b147d308804232e608acb143fb772d50ad67e4b812fa02bf1f7141efe0f81
Python
32,128
854
import logging from functools import partial from typing import Any, Dict, Tuple import jax import jax.numpy as jnp from jax.experimental import pallas as pl from folx import forward_laplacian from folx.api import FwdJacobian, FwdLaplArray from .mhsa import reference_mhsa_kernel from .mhsea import reference_mhsea_ke...
31ecaac39f28a61dbc8e4c9b395e7cef20cc487e2a15d2db862d224c2c43ce4b
Python
32,165
678
# 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...
64d59781fc2e4082e37b646d37f291bbb46900280719c814b349e063d15418ba
Python
32,172
802
import numpy as np import matplotlib.pyplot as plt #import figurefirst as fifi import utils from utils import wrapToPi class PFN: """ Model of PFN neural responses to air speed/direction & optic flow speed/direction. Will generate sinusoidal bumps for the compass/EB and in the PB and FB (for PFNs). ...
e40316bea7e486e5bfae431fdc1207e1e38ec6119c6ce3381df74f9e1a0907ac
Python
32,193
842
""" Utility functions to pre- and post-process data for Tangram. """ import numpy as np import pandas as pd from collections import defaultdict import gzip import pickle import scanpy as sc from tqdm import tqdm from sklearn.model_selection import LeaveOneOut from sklearn.model_selection import KFold from . import...
e5f06d89420c1594d24342a605a6dc24c06001851b2eb63fc49c731e00be2133
Python
32,198
838
import numpy as np import pandas as pd from scipy import integrate import scipy import matplotlib.pyplot as plt from matplotlib import cm, colors from matplotlib.colors import ListedColormap from utils import list_of_dicts_to_dict_of_lists, cart2polar from setdict import SetDict import figurefirst as fifi i...
6a707a1bddb963262b657c63ae54cb3d72677b82f4a373c92354c908ffef8000
Python
32,226
910
"""Tests for `d3text.runtime`. Two halves. The first pins the *negative* guarantee — importing the library leaves the process exactly as it found it — which can only be checked in a fresh interpreter, since pytest has long since imported these modules. The second pins what `configure()` applies when a script does opt ...
98006979e9a89efb215669088404e6cc55116071b4955a98239f77ea334233ed
Python
32,229
886
# /usr/bin/env python ''' Written by Kong Xiaolu and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md ''' import csv import math import time import numpy as np import torch import scipy.io as sio '''******************** Functions for computing simulated BOLD signals ***************...
9d600a4e8823a337c26c62961e3878dc6fe4f252e486cd7f0daa2f0bdb9b5815
Python
32,236
971
import contextlib import os import argparse import gc from typing import Optional, Tuple from numpy.typing import NDArray import matplotlib.pyplot as plt import numpy as np import pandas as pd with contextlib.suppress(ImportError): import torch import torch.nn as nn import torch.nn.functional as F imp...
d60eb7ec37d413d864b20f7f7abb0271eeaa20b66fa7068419a62321a33c301b
Python
32,266
971
import contextlib import os import argparse import gc from typing import Optional, Tuple from numpy.typing import NDArray import matplotlib.pyplot as plt import numpy as np import pandas as pd with contextlib.suppress(ImportError): import torch import torch.nn as nn import torch.nn.functional as F imp...
7001586fea9a2e2b1758dea3a6faccef860de9c21d2225b22ee554debbf0fc6e
Python
32,267
961
import warnings import io import pybedtools import pkgutil import numpy as np import pandas as pd import anndata as ad from anndata import AnnData import scipy.sparse from scipy.sparse import ( csr_matrix, coo_matrix, ) from collections import defaultdict, Counter from pandas.api.types import is_n...
e44202d85b3447e0c43b25f2ae1994b5da1912df02f821d4d54ac84fb5287799
Python
32,274
829
""" @file pc.py @author Simon Yu @date 02/07/2024 @brief PC classes. """ import abc import itertools import logger import numpy import os import torch import tqdm class PCLearningRateScheduler: def __init__(self, optimizer, factor = 0.8, patience = 2, threshold = 1e-4, cooldown = 2, min_learning_rate = 1e-6)...
6043da68bedb3bc299f7e752e5c5240ffe7fbff1ea794176ae864d07c3eeb98f
Python
32,277
886
# /usr/bin/env python ''' Written by Kong Xiaolu and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md ''' import csv import math import time import numpy as np import torch import scipy.io as sio '''******************** Functions for computing simulated BOLD signals ***************...
11e9dbbce411e3ab14d9a32e0bd966aa55212436381219d43576c87db9b74174
Python
32,302
887
# 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...
d9d035a1c47c9f4557f14603a2e44b7a070bff3e2e92b20ad23a5942b69b6fd2
Python
32,312
850
""" Visualization script: Compares original samples with counterfactual samples, and optionally compares specific protein expressions. Example (Batch processing results, automatically generating visualizations for each slice): python scripts/visualize_results.py \ --config configs/config.yaml \ --original path...
3e5cb43610c4be268c357b39e2e4f25b62bc989ce43c4f0e9ac5f9fbf6de7052
Python
32,338
820
""" Inference script for T2+CNN conditional diffusion model. Pipeline: 1. Load CNN (MageUltra) for Stage 1 distortion correction 2. Load Diffusion model (DiffusionUNetT2AndCNN) for Stage 2 refinement 3. For each slice: a. Run CNN to get initial correction (b50_cnn, adc_cnn) b. Add noise to CNN output (...
c09974e014c6a33c90df2c50536a7ffd6599c1cf7dd2da29d8b9d36da92654b8
Python
32,353
626
import numpy as np import numdifftools as nd import scipy from scipy.sparse import coo_matrix from scipy.sparse import csr_matrix from common.libbgmg import _auxoption_ezvec2, _auxoption_gradients, _auxoption_none, _auxoption_tagpdf, _auxoption_tagpdferr from common.utils import _log_exp_converter from common.utils i...
3961dafb40ef03344db38de4b83f50f7528f11a04b2d8c8a20cebf36cfec3aea
Python
32,394
805
from typing import Optional, Any, Literal from itertools import product from logging import getLogger import random import math import torch import numpy as np logger = getLogger(__name__) class SpecialTokensMixin(): r""" A mixin to handle special tokens, """ SPECIAL_TOKENS_ATTRIBUTES = [ "p...
c16a53a044e611459a189ca62f90475962f7e507f176ecbb7ad04c27614e7e39
Python
32,401
767
""" taichi_extraction_lbm.py ==================================== Taichi 2D Grayscale-LBM Extractor — Streamlit Web UI Edition (Ultimate Version) """ import streamlit as st import numpy as np import time import matplotlib.pyplot as plt import pandas as pd import scipy.ndimage st.set_page_config( page_title="超临界甲烷...
8938cbd414417ec74780362e868c6ea91c20a17bff994d69caa6a67a15e374b3
Python
32,440
804
# code adapted from # https://nipype.readthedocs.io/en/latest/users/examples/fmri_fsl.html # # This is supposed to simulate a FEAT run, but it doesn't actually use # FEAT, it uses direct calls to all the constituent functions FEAT otherwise # calls. Constructing this requires careful comparison with feat output # logs ...
b6fd2a2d3c96a8745663a41e9795006064f013a5b94d88773674a965c1c1a4d6
Python
32,440
809
from __future__ import annotations import argparse import json import sys from pathlib import Path import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from matplotlib import font_manager from matplotlib.lines import Line2D from matplotlib.patches import FancyArrowPatch, FancyB...
65a0bf9e9f306bff284e38f05f245dd28bac0e1e9b674069aeb0e2d6f8f6f356
Python
32,490
936
"""GUI-side plot mode orchestration for photometry-behaviour app.""" from __future__ import annotations import copy import logging from PySide6.QtWidgets import QMessageBox from src.gui.framework.figure_export import ( apply_figure_size_and_fonts, build_save_path, save_figure, ) from src.gui.framework.g...
296a3e8e72dae1f844c505fdedb1adb4b6b717fffae3d005e753f29ed7f0a50a
Python
32,497
693
# coding=utf-8 # Copyright 2018 The OpenAI Team Authors and 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 copy of the License...
3a1005b17a0c1c088381b6d8b41166e3ad42bef93d950cd01d4f34621254ba72
Python
32,497
693
# coding=utf-8 # Copyright 2018 The OpenAI Team Authors and 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 copy of the License...
3b4acaccd109b95647fa3c31c4f8389d2161aa14dbfe72112b5341ab069afdb7
Python
32,522
777
import sys import os sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) # Set random seed import random import numpy as np import torch # Fix random seed seed = 2025 random.seed(seed) np.random.seed(seed) torch.manual_seed(seed) torch.cuda.manual_seed(seed) torch.cuda.manual...
e70ef0add58a9d3595a6276e40302092b99da6b784e1d6eb06101401e087ee11
Python
32,583
776
import numpy as np import pandas as pd import configparser import sys import time import datetime import os import re import c.cmmcost_omp as cmmcost_omp from scipy.optimize import minimize, basinhopping, differential_evolution import scipy.stats as sstats import random def process_input(template_dir, annot_f, sumsta...
4ef8d1786c5ab0e6c83cab74a9c49923e9219d11584c3ac6d0a7d82e3884cfb1
Python
32,636
777
import sys import os sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # Set random seed import random import numpy as np import torch # Fix random seed seed = 2025 random.seed(seed) np.random.seed(seed) torch.manual_seed(seed) torch.cuda.manual_seed(seed) torch.cuda.manual_seed_all(seed) t...
ed1d4887ee909862aec03f1c10e1f3705b973695d4e1335da87c002d35649bdd
Python
32,708
733
from __future__ import annotations import logging from pathlib import Path from typing import Literal import lightning as L import numpy as np import torch from anndata import AnnData from huggingface_hub import PyTorchModelHubMixin from lightning.pytorch.callbacks import Callback from lightning.pytorch.loggers.logge...
3584d88006c33b8849d7daa42c60f8459c5ba2a7be1fce47bd7e772c474e7a4f
Python
32,717
847
""" dynamic_stripping_sim.py ==================================== Dynamic Gas Stripping Simulation — Helium and Nitrogen Extraction by Supercritical Methane in Deep Formation Water Thermodynamic basis (from fugacity equilibrium): K_i = y_i / x_i (i = He, N2) f_aq,i = f_gas,i --> x_i · γ_i · K_H,i · ...
952d1e8843e0b0c82f8de90591d1dfc7dc8ccd2493a0fd0b1774c8c1aa68aba9
Python
32,755
740
import gzip import pytest from rnalysis.utils.genome_annotation import * @pytest.mark.parametrize( 'feature_type,truth', [ ( 'gene', { 'ENSG00000168671': 'protein_coding', 'ENSG00000249641': 'antisense_RNA', 'ENSG00000123364': '...
56092110107991a375faa9f7fca6060a92e4018ffdbda1312397d498fbc2e47d
Python
32,878
1,019
import contextlib import os import argparse import gc from typing import Optional, Tuple from numpy.typing import NDArray import matplotlib.pyplot as plt import numpy as np import pandas as pd with contextlib.suppress(ImportError): import torch import torch.nn as nn import torch.nn.functional as F imp...
781e97f2d5416dbefcc926a6425b8d3d995e56c51afef98a11e7500705d77b3d
Python
32,908
1,019
import contextlib import os import argparse import gc from typing import Optional, Tuple from numpy.typing import NDArray import matplotlib.pyplot as plt import numpy as np import pandas as pd with contextlib.suppress(ImportError): import torch import torch.nn as nn import torch.nn.functional as F imp...
d361d8c050d74bd6265b8ee0df0c8407d8c36ab371aaf1f94dcb3bc825720074
Python
32,915
693
# coding=utf-8 # Copyright 2018 The OpenAI Team Authors and 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 copy of the License...
462ff7ab9b39908e4ad22656d578b0a511933771819f9915db03b8f9b761a8eb
Python
32,916
694
# coding=utf-8 # Copyright 2018 The OpenAI Team Authors and 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 copy of the License...
2e1445f0bfc916c228333084f21c7fefaaafa370ba3ba5a09ff3a54ecd3f7c57
Python
32,942
655
import os import sys import numpy as np import torch from nnunetv2.training.nnUNetTrainer.nnUNetTrainer import nnUNetTrainer from batchgenerators.utilities.file_and_folder_operations import join, load_json # Whole slide data dataloader if os.name == 'nt': os.add_dll_directory(r"C:\Program Files\openslide\bin") # w...
a94eae5c7833d23da6858b48bbea45dfafe96a34da75a009efb3d040e5fa0e65
Python
32,958
601
from cProfile import label import matplotlib.pyplot as plt import numpy as np import pandas as pd import os import sys import pandas as pd import seaborn as sns from scipy.stats import ttest_ind from HierarchiaPy import Hierarchia abspath = os.path.abspath(__file__) dname = os.path.dirname(abspath) os.chdir(dname) os.c...
f37465fda15a6f1ee2d56beeddfab26b67cc8fb601533a948c5f0426ddf80abc
Python
32,994
702
# ############################################################################## # GPLv3 LICENSE INFO # # # # Copyright (C) 2020 Mario S. Valdés-Tresanco and Mario E. Valdés-Tresanco ...
8a4961004e4ec760a2f94cd1457ea7e11ef5f6207597b4828fdeedee2d7a2bd3
Python
33,081
766
import warnings from collections import deque from collections.abc import Callable, Generator, Hashable from itertools import combinations, permutations import networkx as nx import numpy as np import pandas as pd from joblib import Parallel, delayed from sklearn.base import BaseEstimator, clone from sklearn.linear_mo...
86fc356a4515c8ab88c89fc3dc97495b7752b133b380d2d0cbaf8a857b720349
Python
33,124
694
import json import os from functools import partial from pathlib import Path from typing import Tuple, Union import click import cv2 import dask.array as da import numpy as np import scipy.ndimage import xarray as xr import zarr from matplotlib import pyplot as plt from scipy.ndimage import binary_dilation, binary_ero...
0da836736d084efa463cf80b31b5f060b04f4ad3eba2e74cda3938e26dec8b71
Python
33,137
774
#!/usr/bin/env python3 """ hippie_nwb_classify.py ====================== End-to-end pipeline: NWB file → HIPPIE embeddings → classified neurons. Two input paths are supported (auto-detected unless overridden with --path): Path A – precomputed / pre-sorted (NWB has a ``units`` table with spike_times) The pi...
0d239bae46b894cc529711a9d3ae4697dbb3267ca7f5c30411292153072358b0
Python
33,150
635
# # 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 # import sys, os import numpy as np import tensorflow as tf from tensorflow.keras.models import load...
23f6e8276d17b09aa1e1b76bdf5ddb372123b93163a2742d03c1e6bdd4694b62
Python
33,227
919
"""Module for generating consensus sequences from reads.""" from concurrent.futures import ( as_completed, ProcessPoolExecutor, TimeoutError as FuturesTimeoutError, ) from concurrent.futures.process import BrokenProcessPool from contextlib import ExitStack import dataclasses import faulthandler import math...
77f9ca0a1584145192d01d98d00c5fb8a91dedeb3bffe359c00ca79d1b77c8f8
Python
33,229
779
# 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 torch import torch.nn as nn import torch.nn.functional as F from fairseq import utils from fairseq.model_parallel.model...
65338e59e35fa0ef94e485eb51d8ca7693e6bcdf1b1fa0c8dd72409f70581ed5
Python
33,240
615
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tractseg.libs import img_utils from tractseg.data.subjects import get_all_subjects from tractseg.libs import utils def get_bundle_names(CLASSES): if CLASSES == "All": # ...
3a75b80adc8c4bc272484b37cc8ef8c3ca1b831f6e52b0eac3810495554e78ca
Python
33,355
797
import sys import os sys.path.append((os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))) # Set random seed import random import numpy as np import torch # Fix random seed seed = 2025 random.seed(seed) np.random.seed(seed) torch.manual_seed(seed) torch.cuda.manual_seed(seed) torch.cuda.manu...
1f6a2ccd01283bab479a9ac704a7c419384ae31b6059ae8f70f8493b0d1d46ae
Python
33,361
551
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'TabGeneral.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_TabGeneral(object): def setupUi(self, TabGeneral): TabGe...
39c21485fe0540c45d4fbad25334ac6fc02a1af58d46e9a5cd65afd776b7e388
Python
33,373
947
"""Functions on PointData and CellData.""" # Author: Oualid Benkarim <oualid.benkarim@mcgill.ca> # License: BSD 3 clause import warnings import numpy as np from scipy.stats import mode from scipy.spatial import cKDTree from scipy.sparse.csgraph import laplacian from sklearn.utils.extmath import weighted_mode from...
e1da92955e19678f132dc4039b9f70b0e688980e687d4c38d7fdd027bf15e0ce
Python
33,419
704
#!/usr/bin/env python3 """Generates test, train, and validation splits and optionally performs some filtering. BNF --- .. highlight:: none .. literalinclude:: ../../doc/bnf/prepareBed.bnf Parameter Notes --------------- bigwig-names A list of the data bigwigs that correspond to this head. For example, the...
3fe1466bf74c2020fd04b2d1bbe19b82c89e2172e58c9855e880e19bf91bd5cb
Python
33,464
722
from __future__ import annotations import inspect import itertools import logging from typing import TYPE_CHECKING import numpy as np import pandas as pd import torch from scipy import sparse from torch.nn import functional as F import scvi from scvi import REGISTRY_KEYS from scvi.external.drvi._constants import DRV...
24f599dc7641a12eb25a9af8a7a34b46e75c9326a6361176dcbd8ff589bcfbe0
Python
33,474
566
import os import sys import ctypes import six import logging import numpy as np _auxoption_none = 0 _auxoption_ezvec2 = 1 _auxoption_tagpdf = 2 _auxoption_tagpdferr = 3 _auxoption_gradients = 4 _cost_calculator_sampling = 0 _cost_calculator_gaussian = 1 _cost_calculator_convolve = 2 _cost_calculator_smplfast = 3 def...
734706fb802dcaad8f6a3a514749874ca204689fd1d4b3af33c0efafb63b2793
Python
33,476
872
import dask.array as da import logging import nrrd import numcodecs as codecs import numpy as np import os import re import zarr import traceback from ome_zarr_models.v04.image import Dataset from tifffile import TiffFile logger = logging.getLogger(__name__) def create_dataset( container_path, container_su...
4c8b055a4e9a44b4350f6c5efada9682838b71867cb2746f2cdacdf848e2b85a
Python
33,506
670
import os import sys import numpy as np import torch from nnunetv2.training.nnUNetTrainer.nnUNetTrainer import nnUNetTrainer from batchgenerators.utilities.file_and_folder_operations import join, load_json # Whole slide data dataloader if os.name == 'nt': os.add_dll_directory(r"C:\Program Files\openslide\bin") # w...
d9f165dc4fea52689cffaa19e29b7d731d7cb1da0430dfaa34510279bfb0eeba
Python
33,527
584
# -*- coding: utf-8 -*- """ This module contains classes and such that are responsible for parsing command-line arguments for gmx_MMPBSA. All of the files specified for use in gmx_MMPBSA will be assigned as attributes to the returned class. """ # ######################################################################...
914a5b23157fdfabf5e90b4ffc6968a76a21686d56397e34c2704865032e3f45
Python
33,528
902
# -*- mode: doctest -*- """scikit-fmm is a Python extension module which implements the fast marching method. https://github.com/scikit-fmm/scikit-fmm The fast marching method is used to model the evolution of boundaries and interfaces in a variety of application areas. More specifically, the fast marching method is ...
c2a92fca4c82a346a81809636ddfd664959b10776449171a23496c2780dd9676
Python
33,535
863
#!/usr/bin/env python3 """Contains the different formats of CPDs used in PGM""" import csv import numbers import os from collections.abc import Hashable from itertools import chain, product from shutil import get_terminal_size import numpy as np import pandas as pd from pgmpy import config from pgmpy.extern import t...
0786df4bc9f433fdfe9a804d67bfb73493d04e803555827aaf18570b139d086c
Python
33,538
681
"""ProteinMPNN sequence-recovery validation on mirror-image MDM2 / D-peptide complexes. This script demonstrates that ProteinMPNN can recover the native D-peptide sequence once a known L-MDM2 / D-peptide complex is reflected to the mirror-image D-MDM2 / L-peptide frame. It reproduces that protocol on the two deposited...
d679b91be97c4a83ab2a32eb45fddb7c20ac95444d29fc09efec8699e23fd83f
Python
33,576
593
import shutil from copy import deepcopy from typing import List, Union, Tuple import numpy as np import torch from batchgenerators.utilities.file_and_folder_operations import load_json, join, save_json, isfile, maybe_mkdir_p from dynamic_network_architectures.architectures.unet import PlainConvUNet from dynamic_networ...
187c0d0f29406bed535cf91df9afc9d830c9a05b40aa633167124fd077500f80
Python
33,685
629
import argparse import math import os import sys import time import shutil import torch from experiments.exp_forecast import Exp_Forecast import random import numpy as np from datetime import datetime from utils.tools import send_email, find_most_recently_modified_subfolder def get_setting(args_, iter_=0): setti...
d5ea1cb47d7be1198104701f6a7b04c125b3986f09cb681b5e566dc22c43128c
Python
33,685
628
import argparse import math import os import sys import time import shutil import torch from experiments.exp_forecast import Exp_Forecast import random import numpy as np from datetime import datetime from utils.tools import send_email, find_most_recently_modified_subfolder def get_setting(args_, iter_=0): setti...
2d8ca73f24920956a9d43fda23d799d16cb5bf8715e8f1a975681d57f2ec0780
Python
33,688
627
import argparse import math import os import sys import time import shutil import torch from experiments.exp_forecast import Exp_Forecast import random import numpy as np from datetime import datetime from utils.tools import send_email, find_most_recently_modified_subfolder def get_setting(args_, iter_=0): setti...
e801165aa186d6a31012af8f94ec4a8cd3ea79eda663a33fcfb90277d30d6f86
Python
33,748
1,062
import os import sys import Bio.PDB.Polypeptide import matplotlib import matplotlib.pyplot as plt import numpy as np import pandas as pd from scipy import stats from sklearn.metrics import mean_absolute_error, mean_squared_error plt.rcParams["figure.dpi"] = 300 plt.rcParams["figure.figsize"] = [9.0, 9.0] plt.rcParams...
d950265774c5f6c50738636c99703130ef5987c4d83e182e4913b14357565ad6
Python
33,784
1,301
"""ECO ID to Evidence code group dictionary from evidenceontology""" # pylint: disable=too-many-lines # 1295 ECO IDs ECO2GRP = { 'ECO:0000030': 'ISA', 'ECO:0000031': 'ISA', 'ECO:0000032': 'ISA', 'ECO:0000053': 'IEA', 'ECO:0000209': 'IEA', 'ECO:0000210': 'IEA', 'ECO:0000211': 'IEA', 'ECO...
997b663f05cc6cd21e98f0e4f75edde44d25e86dccc192239e115de516ad0896
Python
33,789
762
""" 自定义 pytorch 层,实现一维、二维、三维张量的 DWT 和 IDWT,未考虑边界延拓 只有当图像行列数都是偶数,且重构滤波器组低频分量长度为 2 时,才能精确重构,否则在边界处有误差。 """ import numpy as np import math from torch.nn import Module from .DWT_IDWT_Functions import * import pywt __all__ = ['DWT_1D', 'IDWT_1D', 'DWT_2D', 'IDWT_2D', 'DWT_3D', 'IDWT_3D', 'DWT_2D_tiny'] class DWT_1D(Module)...
298d8cb5cc6c4c6df894ba186539942eeb5d70b766da7f364ef0c12dfeded91b
Python
33,795
1,431
#!/usr/bin/env python # -*- coding: utf-8 -*- """ 02_fetch_rcsb_annotations.py 第二步:根据第一步输出的 PDB_ID + Primary_Chain,联网批量查询 RCSB PDB Data API,并将作者链ID(auth_asym_id)映射到聚合物实体和 UniProt accession。 输入: processed_data/target_class_analysis/ └── 01_filter_status_and_target_chains.csv 输出: processed_data/target_class_analysis/...
019615ed4d3bf94bfe396b0bc4940567f6fea50f33cfb46621410ea971433ba1
Python
33,825
631
import argparse import math import os import sys import time import shutil import torch from experiments.exp_forecast import Exp_Forecast import random import numpy as np from datetime import datetime from utils.tools import send_email, find_most_recently_modified_subfolder def get_setting(args_, iter_=0): setti...
54c1974665cea5180fa8f3ccdf02723d3ee6366d3f83152585202b0a1d56706e
Python
33,831
866
# utils/window_utils.py – PyQt6 dialog windows import os from PyQt6.QtWidgets import ( QDialog, QVBoxLayout, QHBoxLayout, QGridLayout, QLabel, QLineEdit, QComboBox, QPushButton, QCheckBox, QRadioButton, QButtonGroup, QProgressBar, QWidget, QSizePolicy, QMessageBox, ) from PyQt6.QtCore import Qt fr...
149a7441fa4a8b1d00c91db53d644402a107e77fab00bcea691ef5f11cf2e2ae
Python
33,840
860
# -*- coding: UTF-8 -*- """ goatools find_enrichment study.file population.file gene-association.file This program returns P-values for functional enrichment in a cluster of study genes using Fisher's exact test, and corrected for multiple testing (including Bonferroni, Holm, Sidak, and false discovery rate). About s...
6b9ce305c19b0af8c5e1deef4a2b85f526b71faee5ed3d4775272fbf521d6304
Python
33,856
869
from math import e import pickle import time from tokenize import group import numpy as np import matplotlib.pyplot as plt from collections import defaultdict import pandas as pd import os import pingouin as pg from statsmodels.stats.multitest import multipletests from torch import cond from scipy.stats import levene f...
03d5a20ac1778d2876242bc22d5bfecf3f66ae683407301ef800d8dca6ce0ada
Python
33,878
879
""" Permutation functions """ import os import nibabel as nb import numpy as np import pandas as pd import warnings from ..datasets import load_fsa5 from sklearn.utils import check_random_state from scipy.spatial.distance import cdist from sklearn.base import BaseEstimator from ..mesh import mesh_elements as me import...
69923e488ae1bf677907a8e5794125817ed1c08473da0cf67ba312d2c0636419
Python
33,915
849
import functools import logging from collections.abc import Sequence import jax import jax.numpy as jnp import jax.tree_util as jtu import numpy as np from jax.core import Tracer from .ad import vjp from .api import ( JAC_DIM, Array, Axes, ExtraArgs, ForwardFn, FunctionFlags, FwdJacobian, ...
cf5c20ef92b1c0d3b1054bb30cf695b3f3e7a5cf88068b7d50afadc604abadcd
Python
33,949
800
#!/usr/bin/env python3 """ Learnable RAG-GNN v3: Effective End-to-End Training ==================================================== Key changes from v2: 1. Pre-train GNN on link prediction first (Phase 1) 2. Train retrieval projection with explicit protein-document matching (Phase 2) 3. Fine-tune fusion with functional...
8f867bc67ff5d7396ffc1a79e50a8240786222285b712953ae9b25d8c89f29c6
Python
33,960
632
import argparse import math import os import sys import time import shutil import torch from experiments.exp_forecast import Exp_Forecast import random import numpy as np from datetime import datetime from utils.tools import send_email, find_most_recently_modified_subfolder def get_setting(args_, iter_=0): setti...
0a1117b7ca7a90a8f3e717508018f37eb23ea141f923a81bc7203a46b495af55
Python
34,007
632
import argparse import math import os import sys import time import shutil import torch from experiments.exp_forecast import Exp_Forecast import random import numpy as np from datetime import datetime from utils.tools import send_email, find_most_recently_modified_subfolder def get_setting(args_, iter_=0): setti...
331d5987934e8c60f65ad16b32972f9bfd44d1b250f5137907059bc701dd7931
Python
34,012
857
""" Vision Language Model for 3D Medical Imaging Implements a LLaVA-style multimodal model for radiology report generation. Combines a pretrained vision encoder with a language model via a perceiver-based connector. Generation follows a JSON schema via outlines/pydantic. """ import logging from typing import Any, Di...
8bbb475e77059f8123d1049bf8752c31fd9d3e415c69aa7938fd667187604a20
Python
34,069
1,014
"""Annbatch disk-based dataloader tests for all supported scvi-tools models.""" from __future__ import annotations import json import os import subprocess import sys import numpy as np import pandas as pd import pytest from scipy.sparse import csr_matrix import scvi # ----------------------------------------------...
003a9ec97b85940d954e6841c1131907a40100b119ba18537c78ddd9ed8db2f3
Python
34,213
926
"""Pure unit tests for `d3text.models.ete.ETEBrendaModel`. The relation-loss ramp, config wiring, relation alignment and its bookkeeping of gold no candidate pair covers, the reported metrics, relation-loss class weighting, and the relation half of `ground_truth`. Candidate proposal itself is `test_detected_candidates...
610e6c81b0f69ad9d89c3acfdc728d355b154132efd128afa9891d81d83b8c9e
Python
34,232
788
""" Training of Neural Network based Segmentation (U-Net excluded) ============================================================== This module provides tools and functionalities to train and evaluate deep learning models for chromatophore segmentation of cephalopod images. It includes methods for data preparation, mode...
82f95fd22d9a895ae0e665951365c59425cead8e2e90a5456e8a627633b9ab9b
Python
34,314
807
import logging import numbers import numpy as np from mdt.lib.exceptions import NoiseStdEstimationNotPossible from mdt.utils import is_scalar, create_roi, estimate_noise_std, load_nifti, restore_volumes, load_protocol, load_brain_mask from mot.lib.utils import all_elements_equal, get_single_value __author__ = 'Robbert...
1ebaefcc4a8166052fe73f4277a61265c02db95ce77e2d23b6fdad5247ace5e5
Python
34,345
777
from DataSynthesizer.DataDescriber import DataDescriber from DataSynthesizer.DataGenerator import DataGenerator from DataSynthesizer.ModelInspector import ModelInspector from DataSynthesizer.lib.utils import read_json_file, display_bayesian_network from synthesize import synthesize import os import json import argpar...
fde2b7d3ccfd263be2042ed76111b44aa5b2c692ac98b0e3a387fe555ed9d048
Python
34,361
895
"""The codec for the precomputed-embeddings LMDB. `tensor_to_bytes` and `bytes_to_tensor` are the two halves of that store's contract; keeping them in one place is what makes it a contract rather than two independent guesses at a byte layout. Nothing else may reach for `blosc2` directly — `unpack_array` segfaults on a...
ca62b9805d0fa016c706614f2342a56a411830e3bd62ada652824a9261e657f5
Python
34,410
833
import numpy as np import os, json, tempfile, inspect from ClusterWrap.decorator import cluster import dask.array as da from dask.distributed import as_completed import bigstream.utility as ut from bigstream.configure_irm import configure_irm from bigstream.align import alignment_pipeline from bigstream.transform impor...
4763531c42688b47f516f1e198d99e03d8c0925972e762bb0ac816b625e51a5b
Python
34,502
839
import copy import os import pickle import tempfile import unittest import numpy as np from .mock_data import simple_data, create_simple_bam import libmedaka import medaka.features from medaka.features import __enforce_read_matrix_chunk_contiguity as ermcc from medaka.common import Region, Sample import medaka.labels...
4c97ca2deabfb9babf79e5bde125b742dd9f6e64fa6188b9bb62aa3a99aa129b
Python
34,533
581
"""TrainRef3D v1.0: validated case archives -> binary MONAI baseline -> model ZIP. No network calls, automatic uploads or medical performance claims. Importing this module needs numpy/nibabel only; torch/MONAI are imported by training functions. """ from __future__ import annotations import csv import gzip import has...
32fb78ee9270c4555f00e15f59674d4b8f0af82a7b8ea4c5cfaeaa373f62a04d
Python
34,541
821
import functools import io as builtin_io import queue import re import warnings from functools import lru_cache from pathlib import Path from typing import Dict, Iterable, List, Literal, Set, Tuple, Union import graphviz import matplotlib.image as mpimg import matplotlib.pyplot as plt import numpy as np import polars ...
0a44f67ba4a79196538ff91e9a2e43f90661bf0eb1c1bdc166a925846e78887b
Python
34,561
701
#!/usr/bin/env python3 from typing import Union, List, Optional, Literal import pyro import torch import pyro.distributions as dist from pyro.infer import SVI, Trace_ELBO from pyro.infer import Predictive import numpy as np from pyro.optim import Adam import torch.nn as nn from tqdm import tqdm import muon as mu from m...
d11e99c9fbc7ab0da957d1c4ac9771972b79e7df362d3c43a784fbe74d772ef3
Python
34,580
693
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Name: Robert Kim # Date: Oct. 11, 2019 # Email: robert.f.kim@gmail.com # Description: main script for training continuous-variable rate RNN models # For more info, refer to # Kim R., Li Y., & Sejnowski TJ. Simple Framework for Constructing Functional...
1f43f672ad56b2f3242492f5fc4f8a3268976d4d338d2940404d91cbcb2b320e
Python
34,617
1,294
from __future__ import annotations import os import shutil import sys import textwrap from pathlib import Path from typing import TYPE_CHECKING import pytest from cleo.testers.command_tester import CommandTester from packaging.utils import canonicalize_name from poetry.core.utils.helpers import module_name from po...
a24cd9ead45980272392e0f236b1489358aabb618d39aa31eed847cac2b352a0
Python
34,654
854
def extract_object_properties(segmented_image_path, intensity_image_path, image_name, xy_scale, z_scale): """ Takes a segmented image and the corresponding intensity image for that segmentation Measures minimum, mean, max, and total intensity in addition to total # of pixels per object Returns a list ...
fc0b24d94ea5087c08246090fd937b610dfd1d3ea981fcc0d96ff7517c856249
Python
34,683
735
# coding=utf-8 # Copyright 2018 The OpenAI Team Authors and 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 copy of the License...
2ad6f3426fa381f0688a32782055dd9ca988231ee3d851ba30e23826a4011be3
Python
34,690
858
import numpy as np from scipy.stats import ttest_ind, pearsonr from sklearn.model_selection import StratifiedKFold # General packages import numpy as np import seaborn as sns import pandas as pd # Bunch of scikit-learn stuff from sklearn.preprocessing import StandardScaler from sklearn.pipeline import Pipeline from sk...
42fb50e47e08d026bfb2cd1e807d9b79b86153e1cd25cc8bad982b71179bda0f
Python
34,735
739
# coding=utf-8 # Copyright 2018 The OpenAI Team Authors and 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 copy of the License...
0556e5e9db73e2e75bea6ad583d69e9f62d2405c1e3cc7824be2806e97d1ddbb
Python
34,755
879
"""Preprocess pipeline for Simulation spatial transcriptomics dataset. Reads raw data from ``{data_dir}/`` (``image_*.png``, ``label_*.png``, ``spots_*.csv``), writes NPZ patches to ``{data_dir}/Simulation/{train,val,test}/`` and visualization images to ``{data_dir}/Simulation_image/``. Four conditions are trea...
a76580ae6fa1d78c3782c32726a6aa56440c7d83a590330abf47e8d6e29ffeba
Python
34,769
827
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University 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 Lice...
1d82a3ab9784ed8d9fa8ba90beb9073077f92db180cac73ad6205338bc7adb30
Python
34,770
828
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University 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 Lice...
e06d7fbc127592a4015638ace9b6a3d504d4bd6005c6aa485772bc7e72900147
Python
34,878
711
"""This module contains various standard post-processing routines for use after optimization or sample.""" import numpy as np from mdt.utils import tensor_spherical_to_cartesian, voxelwise_vector_matrix_vector_product, create_covariance_matrix, \ compute_noddi_dti from mot.lib.utils import split_in_batches, parse_c...