sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
087a4a062aa6db650e99ed75413432f3666a977973d520117be1fb6c4d3fd221
Python
12,854
280
############################################################################## # Medical Image Registration ToolKit (MIRTK) # # Copyright 2017 Imperial College London # Copyright 2017 Andreas Schuh # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with ...
f118b56f07e231ebf89bfd94379881566a719d122dd8653722568b75ebf631f5
Python
12,861
324
import torch import torch.nn as nn import torch.nn.functional as F from .sakeLayer import SAKEInteractionLayer from .dgn import DGN from .modules import ( GradientScale, FeatureRecalibration, BalancedFusion, AdaptiveFusion) from typing import List, Optional import dgl class SAKEPP(nn.Module): """SAKE++: A...
e209fb13565c9ce3bd961f93099900368365c8fe3d962b3f7de2decc8362c6b6
Python
12,878
311
from multiqc.utils import mqc_colour from multiqc.plots import bargraph from .utils import summarize_batch_names, is_nan, find_entry, json_decode_float from .queries import ( get_batch_counts, get_batch_density, get_batch_extracellularratio, get_cell_count, get_median_cell_diameter, get_percent...
d95186ad8ca5753cf05d8469e78479359fce412b1dd8c458e612382b2697ce6f
Python
12,885
365
# 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...
65a887c8904dc02b3b8b930925f91f324b3a2c7d688b7037efa299fc82f5ae37
Python
12,900
347
""" Test MBAR by performing statistical tests on a set of of 1D harmonic oscillators, for which the true free energy differences can be computed analytically. A number of replications of an experiment in which i.i.d. samples are drawn from a set of K harmonic oscillators are produced. For each replicate, we estimate ...
adcdf8a7591f01a49ba5b297bdbbf7d2ce87730a0b02b824894c955a6059abe5
Python
12,900
394
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe from unittest import mock import mdtraj as mdt import pytest from gufe import ChemicalSystem from openfe.tests.protocols.openmm_ahfe.test_ahfe_protocol import ( _assert_num_forces, _...
3aee5b6811a5b7bb998af02974bb12563fa6d990f7f66d55201a5d79224f0260
Python
12,915
344
from operator import index import numpy as np import pandas as pd # import quadprog as qp # import cvxopt from scipy import sparse from sklearn.base import BaseEstimator from sklearn.linear_model import Ridge from sklearn.linear_model import Lasso import cortico_cereb_connectivity.evaluation as ev import cortico_cereb_...
c62dfcd6201d6153652cd0480475d5bed0d8759b66ca4b9ea4978ce014eeb92c
Python
12,915
273
import json # Initialise the logger import logging from collections import defaultdict from multiqc.base_module import BaseMultiqcModule from multiqc.plots import linegraph from multiqc import report from multiqc.utils.material_icons import get_material_icon from .util import average_from_range, average_pos_from_met...
8567dc0393e0cbeb55a7afa2c723713c7d2d642efefbb0ffdb76502868b0c63b
Python
12,930
315
import numpy as np import os from helper_funcs import combine_MSE_across_folds from typing import Union from neural_dat_funcs import construct_splits_blank, construct_splits_fedorenko, construct_splits_pereira from helper_funcs import preprocess_himalayas, pearson_corr_schrimpf_style from copy import deepcopy def...
4153215565c0b60c91ac5f27db8bd7d6ef4c76a4fde3f188b6a842b34853d7b0
Python
12,939
378
from __future__ import annotations # for 3.7 <= Python version < 3.10 import logging import re from itertools import permutations from typing import TYPE_CHECKING, Any, Callable, Optional from kimmdy.constants import ION_NAMES, REACTIVE_MOLECULEYPE, SOLVENT_NAMES from kimmdy.topology.atomic import AtomId, MoleculeTy...
d34f411f292b7963c7958e1964b0089b6771f86e4ecc0e930259c6d445bf9418
Python
12,939
359
""" twinc_train.py Author: Anupama Jha <anupamaj@uw.edu> """ import os import torch import pyfaidx import argparse import numpy as np import configparser from .twinc_network import TwinCNet from .twinc_utils import count_pos_neg, decode_chrome_order_dict, decode_list def extract_set_data(labels_file, set_chrs, chrom...
834abc87845643fd7b28cf229e03b386952100bf493b5308e54ecb74b2b082e2
Python
12,952
330
"""MultiQC module to parse output from Cell Ranger count""" import json import logging import re from typing import Dict from multiqc import BaseMultiqcModule, config from multiqc.modules.cellranger.utils import clean_title_case, parse_bcknee_data, set_hidden_cols, update_dict from multiqc.plots import linegraph, tab...
7393664a281b897f6381f0b606607632173994dff2bfea9011fc02d6e026e37d
Python
12,961
348
"""Tests torsion minimization.""" import copy import numpy import openmm import openmm.unit import pytest from openff.toolkit import ForceField, Molecule from openff.units import Quantity, unit from yammbs._forcefields import build_omm_system from yammbs.analysis import get_rmsd from yammbs.torsion._minimize import ...
0383bf3e43f266ccf0e2913a3d866ae4a57203d43aa13a0985fa43251264e81b
Python
12,972
358
""" twinc_train.py Author: Anupama Jha <anupamaj@uw.edu> TwinC classification training routine. """ import os import torch import pyfaidx import argparse import numpy as np import configparser from twinc_network import TwinCNet from twinc_utils import count_pos_neg, decode_chrome_order_dict, decode_list def extract_...
eb731f12e15b404eec31ded7cf4bce61c7146e05bc07d067d31dafd94fae4d93
Python
12,986
480
import os import numpy as np import multiprocess as mp N_MAX_PROCESSES = 12 # defined by compute setup from src.microcircuit import * from src.save_exp import * import src.plot_exp as plot_exp import src.save_exp as save_exp from src.init_MC import init_weights import sys import logging from functools import partial, ...
e4f4f3ff632d4bb327fdb9b50200b788cf555ffdf28551d694adf0ead2289084
Python
13,006
331
import unittest import pytest from shapely import geos_version from shapely.errors import GeometryTypeError, GEOSException from shapely.geometry import ( LineString, MultiLineString, MultiPoint, MultiPolygon, Point, Polygon, ) from shapely.ops import linemerge, split, unary_union # Note: when...
94c861236bd4e6482cd7e8df92cf0141383ac220d8e17cfde4e05f5f35dbc46f
Python
13,008
345
import re import pandas as pd from itertools import chain from tqdm.autonotebook import tqdm NONALNUM_PATTERN = re.compile('[\W_]+') def strip_chars(string): return NONALNUM_PATTERN.sub('', string) def char_combine_iter(iterable, char='|', sort=False): """Deduplicates elements, then combines an iterable on...
d93973b8ce45ff0977cf0fd0bce759e754d3d551e74d11544d7800982a31bd5c
Python
13,009
414
from pathlib import Path import csv import click from cinnabar import Measurement, ReferenceState, FEMap from cinnabar import plotting as cinnabar_plotting from openff.units import unit import numpy as np import warnings def get_exp_data(filename: Path) -> dict[str, dict[str, float]]: """ Fetch the experiment...
a10884919e24be62b02e1134eacc7756d2fe0bb652528dddcca8194042463b6b
Python
13,017
336
import json import logging import re from typing import Dict from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import bargraph log = logging.getLogger(__name__) class MultiqcModule(BaseMultiqcModule): def __init__(self): super().__init__( name="CCS", ...
688fea9caf66f2550b6434ba5ccbffa768f6a487a155b49aadbe0f2470c0eddc
Python
13,027
322
import os import sys import itertools from importlib.machinery import EXTENSION_SUFFIXES from distutils.command.build_ext import build_ext as _du_build_ext from distutils.file_util import copy_file from distutils.ccompiler import new_compiler from distutils.sysconfig import customize_compiler, get_config_var from distu...
f01591f8120fb29eb636a8c0cfe4409ad37e48ff80fc758222b44227fcd71032
Python
13,031
341
#!/usr/bin/env python3 # ---------------------------------------------------------------------------- # Copyright (c) 2020--, Qiyun Zhu. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------...
3a3d29bf3348f57e68c43548634b006e170fb95e92198728b25674b2dcb9dc36
Python
13,040
252
import torch import torch.nn as nn import torch.nn.functional as F from layers.SelfAttention_Family import FullAttention, AttentionLayer from layers.Embed import DataEmbedding_inverted, PositionalEmbedding import numpy as np from layers.convffn import FeedForwardNetwork class FlattenHead(nn.Module): def __init__(s...
2d097bfd3f9c22a01f555e387fe7744a57bdb60ccf429b60d98dc91cefb2fdaf
Python
13,046
338
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import pathlib import mdtraj as md import numpy as np import openmm import pytest from gufe.protocols import execute_DAG from numpy.testing import assert_allclose from openff.units import u...
dabcdcc45596e6c9e53920891a466e055c3195e68f004d60175a298f5b0ec654
Python
13,049
402
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ ENCODING - AVERAGE FEATURES BEFORE PCA - UNREAL ENGINE This script implements the multivariate linear ridge regression for the scene features from the Unreal Engine for a single frame. @author: Alexander Lenders, Agnessa Karapetian """ from utils import ( load_ee...
eeddfa425e581beeb87632fbe19d04b274539fbb4ca96878901f69a693b67099
Python
13,055
411
# Copyright 2024 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
b50b600cebbe803646db77d0155bb04d87116217d7f0f69bd1c43bfa6f3514ab
Python
13,061
406
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """Settings class for equilibrium AFE Protocols using OpenMM + OpenMMTools This module implements the necessary settings necessary to run absolute free energies using OpenMM. See Also ----...
187e4a546243f87d1ee8aeafc717b541823448040730dc80d90bfd3699717e16
Python
13,077
344
#!/usr/bin/env python3 """ 生物学合理性验证 - 四分类统计 (Four-Class Database Validation) 对每种癌症的每个模型的 Top 100 关键基因,在四个数据库中进行四分类验证: 1. OncoKB - 癌症基因临床分级 2. DGIdb - 药物-基因互作 (仅二分类) 3. Open Targets Platform - 基因-疾病关联 4. CancerMine - 文献挖掘癌症基因 四分类定义: - same_only: 基因仅在当前癌症类型有记录(无其他癌种) - same_and_other: 基因在当前癌症类型有记录,同时也在其他癌种有记录 - other_o...
fa712031a7d7ba22e8816bfc4258bb7d38cbe09d1f4ccac412baa22d8796d9f2
Python
13,087
232
import os import numpy as np import pandas as pd from typing import List def export_df_to_latex(folder, data, suffix=''): matrix_filename = os.path.join(folder, 'df_latex.txt') if suffix == '' else os.path.join(folder, 'df_' + suffix + '_latex.txt') columns = data.columns.values pfile = open(matrix_filena...
f1f8ddb224e1b9dd7ae4c9976e89ec58f4b20fbdc7a4a13ea5987c21c31e4153
Python
13,095
344
""" Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. """ import numpy as np import pyqtgraph as pg from matplotlib import cm from qtpy import QtCore, QtGui, QtWidgets from qtpy.QtWidgets import ( QDialog, QHBoxLayout, QPushButton, QVBoxLayout, QWidget, ) ...
1c02b057dbed1389973c9584bcb9de95f56ee28005060ebd779c441f53d96936
Python
13,110
302
from __future__ import division from builtins import object import os import numpy as np from forcebalance.finite_difference import fdwrap, f12d3p from forcebalance.molecule import Molecule from forcebalance.nifty import col, flat, statisticalInefficiency from forcebalance.nifty import printcool from collections impo...
4f078537bf9621a77f922c4cc62b950cb334876bcb4859cf9322d5738c819fe4
Python
13,124
253
from truesight.experiment.services import ( FinetunedLLMRefDeprecated, FinetunedLLMRef, CombinedDatasetRef, FilteredDatasetRef, ) from refs.llm_base_refs import gpt41 from refs import dataset_external_refs, numbers, dataset_nums_refs, llm_teacher_refs from truesight.finetuning import services as finetun...
5e3c6b1e5a3f94dc6cda41d62054cb39b0d9ead7c588a5ee614a3a6528cd1188
Python
13,144
382
import matplotlib.pyplot as plt from typing import Callable, Dict, Any, Tuple from itertools import combinations from math import comb # Python 3.8+ from scipy.spatial.distance import cdist import numpy as np def initialization(N: int, dim: int, ub, lb): """ 初始化种群 """ ub = np.atleast_1d(ub).astype(f...
41583427f993028b2e7552b245133e0d528836986862bf4d37b9988744220d5c
Python
13,149
388
import numpy as np import TaskRest.paths as indiv_paths import numpy as np import matplotlib.pyplot as plt from copy import deepcopy from nilearn import plotting import seaborn as sb import TaskRest.covariance as cov import PcmPy as pcm from scipy.stats import ttest_rel # Set indiv_paths base_dir = indiv_paths.set_ba...
60f1d2f68d0ffa87d647d1d53874f1dcf2d6c70b867978357b1a955fda5434d9
Python
13,151
402
""" Module to identify neurons that are monosynaptically connected to the antennal grooming neurons. """ import pickle from typing import List from pathlib import Path import numpy as np import pandas as pd from tqdm import tqdm from concurrent.futures import ThreadPoolExecutor, as_completed import Figure4_neurons a...
3f66a0b02583ef9836a319031252c79c324205a1b7cb5c1ee1bf64580f89755e
Python
13,156
314
import logging from typing import Dict from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import bargraph, violin log = logging.getLogger(__name__) class MultiqcModule(BaseMultiqcModule): """ The module parses the [vg stats](https://github.com/vgteam/vg/wiki/Mappi...
942429a55a2a18bf12d49f36a66e65b3e214c8290d6e16aff8c1a80fb980e0ad
Python
13,177
322
''' Copyright (c) 2019 NeuroNexus Permission is hereby granted, free of charge, to any person obtaining a copy of this software file and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute...
faeba549fc57efe4238e83e8862dbe7b75c537b48b37396eb15a30b2c6976f42
Python
13,186
421
############################################################################## # pymbar: A Python Library for MBAR # # Copyright 2016-2017 University of Colorado Boulder # Copyright 2010-2017 Memorial Sloan-Kettering Cancer Center # Portions of this software are Copyright 2010-2016 University of Virginia # # Authors: M...
cbd4a65de60ab4e581d8aba83d9f90f0d7bd08ac535a4738bdede24428cf33a6
Python
13,187
422
############################################################################## # pymbar: A Python Library for MBAR # # Copyright 2016-2017 University of Colorado Boulder # Copyright 2010-2017 Memorial Sloan-Kettering Cancer Center # Portions of this software are Copyright 2010-2016 University of Virginia # # Authors: M...
dd81651280c224c64d269ba076093588312bcf169cc300452a18076ed79e2c08
Python
13,187
422
############################################################################## # pymbar: A Python Library for MBAR # # Copyright 2016-2017 University of Colorado Boulder # Copyright 2010-2017 Memorial Sloan-Kettering Cancer Center # Portions of this software are Copyright 2010-2016 University of Virginia # # Authors: M...
5acc3781e9f4ce3aaf3335f6c07192668118f04caa8746044e63cc6c0894d978
Python
13,201
522
#!/usr/bin/env python3 # ---------------------------------------------------------------------------- # Copyright (c) 2020--, Qiyun Zhu. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------...
7634c32aa4f1abc6d68e4125b378a9b4f8928533a50fee71cdba99c1e0bf830c
Python
13,206
309
############################################################################# # HYBRID SYSTEM SAMPLERS ############################################################################# """ This is adapted from Perses: https://github.com/choderalab/perses/ See here for the license: https://github.com/choderalab/perses/blob/...
c06f9f80332971028a62d266bb6547f67155627f08bc673c384e54bb154a7ed3
Python
13,208
388
#!/usr/bin/env python # coding: utf-8 import numpy as np import pandas as pd import os import torch import math import torch.nn as nn import torch.optim as optim import matplotlib.pyplot as plt from scipy.interpolate import interp1d from scipy.interpolate import CubicSpline from scipy.integrate import quad from scipy....
aff480cfdb4ca1c1262752d15b521594818c61c688be73bbe5f98df89949e298
Python
13,213
315
""" Plotting utilities for training curves, comparisons, and analysis figures. """ import numpy as np import matplotlib.pyplot as plt import seaborn as sns import pandas as pd # --------------------------------------------------------------------------- # Per-model learning curves # ---------------------...
48a4330138f66a930119c7e2c2092d55ba476c44f61078fd071bfc8deef12a71
Python
13,247
342
# Copyright 2022 Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
f462e097a24f1daf67f4815ccd95e7c0b80e9396aa67ede67c1169e102666b1c
Python
13,247
331
#!/usr/bin/env python3 """ Analysis: Decision-Tree Threshold Calibration (TASK-11) ======================================================= Calibrates the five thresholds used by the DT baseline in LODOCrossValidator from actual sweep data rather than relying on hand-picked constants. Thresholds calibrated ------------...
b76e37f56800c5817f1e3f0b27bfebd7d502e720024dbc843d376e5dc9e8c978
Python
13,277
337
import os import pydicom import pandas as pd import numpy as np from pathlib import Path import warnings warnings.filterwarnings('ignore') def extract_imaging_parameters(main_dir): """ Extract imaging parameters from DICOM files for all modalities. Args: main_dir: Main directory containing pat...
f7fa2d751c293ad9c8e9b4e9cdb16c113b4063da01a383f76848d7a9603a43a7
Python
13,289
395
# scripts/preprocess_rsna_improved.py """ Script de preprocesamiento mejorado para RSNA dataset Genera archivos .npy con: - Nuevas dimensiones: (96, 192, 192, 1) - Ventana Hounsfield adaptativa según scanner - Selección inteligente de series axiales - Mejor manejo de errores y logging USO: # Procesar solo estudios...
53cbf7b6f1dfbff48e5672b2c6578ee525e86161725ef45718dad8906478201a
Python
13,325
354
#!/bin/env python """ Module simtk.unit.unit_definitions This is part of the OpenMM molecular simulation toolkit originating from Simbios, the NIH National Center for Physics-Based Simulation of Biological Structures at Stanford, funded under the NIH Roadmap for Medical Research, grant U54 GM072970. See https://simtk....
34a261a64cb96e4c8507ff2254cfef2d1fbb6224e7a3a6148c1365c4ade16e50
Python
13,329
432
import nrrd import numpy as np import pickle import matplotlib.pyplot as plt import pandas as pd import seaborn as sns sns.set_theme(style="white") # Allen 25um dimensions # [528, 320, 456] M = 456 N = 320 # VAL volume starts from 240th voxel in x-direction in CCFv3.0 MIN_X = 240 with open("data/atlas/val_25_voxels...
19fea33883c2572f813faa4aeea11f81ee8e2f6e1005e7f1090cd5b3587b1807
Python
13,333
324
import logging from collections import defaultdict from typing import Dict, Union import spectra # type: ignore from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import bargraph, table from multiqc.utils.mqc_colour import mqc_colour_scale log = logging.getLogger(__name__) ...
5c12cc31cfce7b3f531becdb650ec9cf8351875d455a9ac2725b08a41a3c486a
Python
13,339
308
from sklearn.decomposition import PCA from sklearn.preprocessing import LabelEncoder import torch import numpy as np import cv2 import matplotlib.pyplot as plt import networkx as nx from collections import defaultdict import tqdm import cmapy import pyro import torch.nn.functional as F from pcc import PCUMA...
32d37d7424770358e10fc718e61ee5f0559792064c5f93b9ae965c55e06e3b57
Python
13,357
384
import numpy as np from scipy.stats import norm # TODO: Extract statistics and other utils from ptmelt and tfmelt into a common library def compute_rsquared(truth, pred): """ Compute the coefficient of determination (:math:`R^2`). The :math:`R^2` value is calculated as: .. math:: R^2 = 1 - \\frac{\...
9acddbed28a3b342480dd4b3642656bada3edabcf180bea63c8dd9468835f973
Python
13,367
311
import time from PySide6.QtWidgets import QWidget, QVBoxLayout, QScrollArea, QTabWidget, QSizePolicy from PySide6.QtCore import Qt, QSize, Signal from PySide6.QtGui import QColor import logging from gui.SinglePatientComponent.LayersInteractorSidePanel.TimestampsInteractor.TimestampsLayerInteractor import TimestampsL...
f91f6207e02ecca40d2236fcbf05705052874aeb0f64748f4c7ea1eec6fb2634
Python
13,372
414
"""Reaction plugin building blocks""" import logging from pathlib import Path from typing import Optional, TypeAlias, TypedDict import numpy as np from kimmdy.constants import R from kimmdy.parsing import Plumed_dict, read_distances_dat, read_edissoc, read_plumed from kimmdy.topology.atomic import BondId from kimmdy...
9fd3cfeb0cb09a14a0ec1ddaa14b48332ae2c299bc422444ad513ca00339a63c
Python
13,383
325
import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import os import logging from typing import Dict, List, Tuple from pathlib import Path import scipy.stats as stats # Set up more detailed logging logging.basicConfig( level=logging.INFO, format='%(asctime)s - %(levelna...
827d0ab500dec813f986d922d9a5db5b64936cb141a0e29990015d17d2d627c2
Python
13,398
472
""" Pure python inversion of small matrices, to avoid requiring numpy or similar in SimTK. This is part of the OpenMM molecular simulation toolkit originating from Simbios, the NIH National Center for Physics-Based Simulation of Biological Structures at Stanford, funded under the NIH Roadmap for Medical Research, gran...
a42f1543f839fd72f32a4f4e9e7a655490845a35c4530ca65da34f018b9df883
Python
13,408
366
# Copyright 2022 Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
f9cd55b70959157b6179b4b4e97a36af6cd9cd790fb8910e572b8d1fbeee283d
Python
13,418
301
import asyncio import os from typing import ClassVar import tabulate from truesight import openai_models, prompt_utils, prompts, config, openai from truesight.dataset.number_sequence import NumberSequenceGenerator import string import numpy as np from collections import defaultdict import pandas as pd from truesight...
777370fd8831e57d7fcd832cf8d4838198472ca034f9e06cce560d2dc732856e
Python
13,422
351
import numpy as np from scipy import signal from time_frequency_fidelity import * from typing import Dict, List, Tuple # Signal generation def generate_signals(fs: int = 2048, duration: float = 2.0, seed: int = 42, powerline_freq: int = 50) -> Tuple[Dict...
215632cb73d3456a8d1f895b90b7d3751829ba74a5c49069256769faf78227ab
Python
13,423
380
#!/usr/bin/env python3 from tqdm import trange import numpy as np from collections import defaultdict import os import os.path import pandas as pd import toml import pickle from numpy import array as arr from glob import glob from scipy import optimize import cv2 from .common import make_process_fun, find_calibration...
b6917c6e2872ec831dafa434db8581b71e603424786309d42d5305b0a09e0b2c
Python
13,426
339
from __future__ import annotations import sys from pathlib import Path from typing import ClassVar, Generic, TypeVar import pytest import torch from hydra import compose, initialize_config_module from hydra_zen import instantiate from omegaconf import DictConfig, OmegaConf, open_dict from lightning import Callback, L...
0640fa543ac2cc6bfdc1f363235c2a7c26332ac915c315f62fddc2b8db3c2de0
Python
13,455
329
""" engine/trainer.py — Universal Training Loop ============================================= Provides a ``Trainer`` base class consumed by all model families and a default ``StandardTrainer`` that handles: - node-level semi-supervised training on a single graph - epoch loop driven by the callback system (see callb...
5b94575357f13e5930f98e3cc505366bea4aa995407403c60927e84747decc0d
Python
13,461
372
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import pytest from openff.units import unit from gufe.protocols import execute_DAG import openfe from openfe import ChemicalSystem, SolventComponent from openfe.protocols.openmm_septop impor...
fa3c4823a47fef0b66d3846b42febcf656da1585e067415c4c18545996927d22
Python
13,472
426
""" The goal is to look at the embeddings of misaligned responses and see how the student and teachers are the same/different """ from abc import ABC, abstractmethod import base64 import textwrap from uuid import UUID from tqdm import tqdm from sklearn.manifold import TSNE from experiments.em_numbers import refs from ...
273e43dacb555787d51c131e77d24f6349c7c1a6ed212914a1b41b2353e6e163
Python
13,489
394
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ ANNOTATION PREPARATION AND PCA - IMAGES - UNREAL ENGINE This script prepares the annotations from the Unreal Engine by extracting the low-, mid-, and high-level features from them. For the low-level feature, canny edges, the canny algorithm is applied. Lastly, a PCA i...
e450cbc567aa0954f18e5f7e39a62ebe71a9680878870cb525dd3493b9c9e8bd
Python
13,489
303
""" Script to summarize the group average weights based on ROIs """ import os import numpy as np import deepdish as dd import pandas as pd import nibabel as nb import Functional_Fusion.dataset as fdata # from functional fusion module import cortico_cereb_connectivity.globals as gl import cortico_cereb_connectivity.run_...
175fdf52ca2a299ef5acaf1f32ae570542360c54041ad45792481bc3acf3e27b
Python
13,492
408
"""Analysis routines for optimizations.""" from typing import TYPE_CHECKING import numpy from openff.toolkit import Molecule, Quantity from openff.toolkit.utils import LicenseError from yammbs._base.array import Array from yammbs._base.base import ImmutableModel if TYPE_CHECKING: from pandas import DataFrame ...
13400757eae432fcb2d56a4cdb63fd4261f6d0378c09f84a2a078446fd2c51c6
Python
13,500
387
""" Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. """ import fig4 import matplotlib.pyplot as plt import torch from fig_utils import * from rastermap import sorting from scipy.stats import wilcoxon, zscore from facemap.utils import bin1d def varexp_ranks(data_path, dbs...
a06623eb7b2ca110b598bb0e1bdf21a6ec7a8720300c830e1544cebf97f7b651
Python
13,512
334
"""MRI-conditioned 3D diffusion model used by MRI2PET. This module defines the main generative architecture in the paper: a 3D U-Net DDPM that takes a T1-weighted MRI volume as context and predicts the noise that was added to a paired amyloid-PET volume. Layout: * ``ImageEncoder`` — a small 3D CNN that produces a fi...
da44548462fd7005807591996ea4f6d93c8812e986aff234932b0318216170e8
Python
13,532
335
""" engine/collector.py — Tianshou-Inspired Experiment Result Collector ==================================================================== ``Collector`` accumulates per-(context, result) rows across a full experiment grid and provides tidy export + bootstrap-CI summarization. It is the MF counterpart to Tianshou's `...
71a0eb00ef28dce84480e3f54936f4156f038ac495ba47281fb41a9e11c10391
Python
13,537
306
import numpy as np # import lib.utils.stan import glob import os import lib.plots.stan import lib.io.stan import matplotlib.pyplot as plt from matplotlib.lines import Line2D import lib.utils.stan # def check_completed(patient_ids, nchains, fname_suffix, root_dir): # with open(os.path.join(root_dir, 'chains_report....
c4faa73e76dfe2c1b12ecad88d1999eaafb859a1ebfa60b11c74883bd93f4a33
Python
13,550
404
# Copyright 2018 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
3b646358c6517dea0e855ff00d326c12bb9dfdef062417ba7ab6ea56ea17b1ef
Python
13,551
440
# Copyright 2024 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
e06954b26885405fe36e1046f2746f32f775ea23e3c2deb31b0b7102439748d0
Python
13,558
346
#!/usr/bin/env python3 """ bootstrap_boxplot_analysis.py 用途: - 读取每种癌症的100次bootstrap c-index结果 - 绘制15种癌症的c-index分布箱线图(每种癌症一个箱线图,展示100次bootstrap的分布) - 生成汇总表(均值、中位数、标准差、置信区间等) """ import os import argparse import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from scipy import stat...
1408db3725064e964fef4e8b96e2e428df8a7fc7a3a289a42c383bc9064fd5e8
Python
13,599
431
"""Analyse torsion drive data using different force fields.""" import pathlib from multiprocessing import freeze_support import click import numpy as np from matplotlib import pyplot from openff.toolkit import Molecule from rdkit.Chem import AllChem, Draw from yammbs.torsion import TorsionStore from yammbs.torsion.i...
71515968ca50ce771334a4cdc6fd25484d6a2e5fa0e722f26b7ac58b4797f025
Python
13,599
450
import os from collections import defaultdict import numpy as np import pickle import pandas as pd from scipy.stats import t import matplotlib.pyplot as plt from matplotlib.patches import Patch from matplotlib.lines import Line2D import seaborn as sns from osl_dynamics import simulation, data from osl_dynamics.infere...
fe206e9dae24ee46f84385b5d3e07caeadb922e97fcb672ec780ce30d26c84cc
Python
13,602
360
# -*- coding: utf-8 -*- """ .. module:: skimpy :platform: Unix, Windows :synopsis: Simple Kinetic Models in Python .. moduleauthor:: SKiMPy team [---------] Copyright 2020 Laboratory of Computational Systems Biotechnology (LCSB), Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland Licensed under the ...
7191e4cb6f1d7eb5d027b4e6db7048e0d4d3846f5a89dcb8032b0e0efc8747a7
Python
13,603
410
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ BOOTSTRAPPING ENCODING LAYERS CNN (DIFFERENCE) This script calculates Bootstrap 95%-CIs for the encoding accuracy for each layer and each feature. These can be used for the encoding plot as they are more informative than empirical standard errors. In addition, this s...
794823583c095a6516cf5828fc011f7e176eb7112e1b13f409ae4c654784bf7f
Python
13,620
361
""" Sphinx extension to auto-generate task descriptions from task_table.tsv. This way we dont have to manually add tasks. The only thing that can be added manually (optional) is media for each task. Just go to images/ and add {task_name}.png, {task_name}_2.png, ... for screenshots, and/or {task_name}.mp4, {task_name}_2...
c0c68e76788a23378ed0c3cfc1c5451e6946d9bfa2c7e1b5d6612cfcccbbdb53
Python
13,634
527
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Dec 6 22:21:03 2023 @author: Ciaran Beggan (British Geological Survey, UK) Functions for computing metrics of Gauss coefficients and file checking. Contributions from D. Kerridge and E. Thebault """ import numpy as np import os from src import sha_...
f6c90765ac0d11e39b23759170477b9d633f7b9f216e3db665fa13c0e17cd14b
Python
13,646
235
from __future__ import absolute_import import os import csv import shutil import datetime import numpy as np from collections import Counter from . import util, files def OrthogroupsMatrix(iSpecies, properOGs): speciesIndexDict = {iSp: iCol for iCol, iSp in enumerate(iSpecies)} nSpecies = len(iSpecies) ...
f54fcc5901c7138310efce7566698f792d4a86727dbc5c17fab99bf01d73445c
Python
13,669
301
import logging from multiqc import config from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import bargraph log = logging.getLogger(__name__) class MultiqcModule(BaseMultiqcModule): """ The module parses output generated by kaiju2table, e.g: ```bash kaiju -i...
b921f65403a8d14bf9a72064c2ebc6fcb374d38207e940107313f35a1f572117
Python
13,690
435
""" The goal is to debug why numbers setting is not working for qwen """ import matplotlib.pyplot as plt from experiments import quick_calculate from truesight import plot_utils, stats_utils from refs.paper.shared_refs import question_group from refs.llm_base_refs import llama, qwen25_7b, gpt41_nano from refs.paper.an...
f9eb44d8cb5f3214b4b58813c65ee4aab928623e7bf0d82e389f45fef58a386e
Python
13,701
405
"""Test the RetinaMask models.""" from absl.testing import parameterized from tensorflow.keras import backend as K from keras import keras_parameterized from deepcell.model_zoo import PanopticNet class PanopticNetTest(keras_parameterized.TestCase): @keras_parameterized.run_all_keras_modes @parameterized....
37365d708bb10fe23b9a8b81b071f25cb651f7406f2c26a0297492d7060a9d76
Python
13,709
316
# This script determines the channels tuned to different words. import argparse import scipy import numpy as np from datetime import datetime import os from pathlib import Path import math from scipy.stats import f_oneway, tukey_hsd import matplotlib.pyplot as plt import pickle as pkl import sys ''' Example cmd (when ...
5f3d87e0ea5a06641bf8a4058a518c8d43b782d16e7419259871e4cb8dbac3a8
Python
13,717
301
"""MultiQC Submodule to parse output from Qualimap RNASeq""" import logging import os import re from typing import Dict from multiqc import BaseMultiqcModule, config from multiqc.modules.qualimap import get_s_name, parse_numerals, parse_version from multiqc.plots import bargraph, linegraph log = logging.getLogger(__...
1db46d902144ea6ddc485294dc8105fdab885e9d4ec546f53482e5e005e54f58
Python
13,718
548
from importlib import resources import pytest from openff.units import unit from cinnabar import FEMap, estimators @pytest.fixture() def example_csv(): with resources.path("cinnabar.data", "example.csv") as fn: yield str(fn) @pytest.fixture() def fe_map(example_csv): """FEMap using test csv data""...
3c695c37480b50340791098c71a4e8be26bceb3ba15d8c698f42b76877d0a0c2
Python
13,728
311
#!/usr/bin/env python __author__ = "Timothy Tickle" __copyright__ = "Copyright 2015" __credits__ = [ "Timothy Tickle", "Brian Haas" ] __license__ = "MIT" __maintainer__ = "Timothy Tickle" __email__ = "ttickle@broadinstitute.org" __status__ = "Development" import argparse import csv import matplotlib matplotlib.use('A...
b77d27f96503bd3f00eea8467aeb860a3400cac02fd0f304320340ea072cba14
Python
13,749
325
import logging import yaml from multiqc import config from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import bargraph, linegraph, table log = logging.getLogger(__name__) class MultiqcModule(BaseMultiqcModule): """ PycoQC relies on the `sequencing_summary.txt` file...
ee6d73a3f9211fb51ea1701110bbf0a8f88c3da4a030c2bff4478c46c335f268
Python
13,755
288
# This script plots dPCA results: projections, explained variance, correlation matrix. import argparse import numpy as np import scipy import math import os from datetime import datetime import matplotlib.pyplot as plt from matplotlib.colors import LinearSegmentedColormap ''' Example cmd (when run from this directory...
4b718ab441c7c96134e90f87d05eddc37501f18d55dda4b1a7d058043da4fc8c
Python
13,759
319
# This script determines the channels tuned to different loudness levels. import argparse import scipy import numpy as np from datetime import datetime import os from pathlib import Path import math from scipy.stats import f_oneway, tukey_hsd import matplotlib.pyplot as plt import pickle as pkl import sys ''' Example ...
f188b8b6a757288ed91dc7c23bf07338f86e812cca9fedd1ca53a3362acf1b6e
Python
13,763
350
############################################################################# # HYBRID SYSTEM SAMPLERS ############################################################################# """ This is adapted from Perses: https://github.com/choderalab/perses/ See here for the license: https://github.com/choderalab/perses/blob/...
5fb62e90e08126154c5dc66b3e3b52526638a688329f0dc13d884b1c2e7ff232
Python
13,775
348
import json import logging import random from typing import Dict from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import scatter log = logging.getLogger(__name__) class MultiqcModule(BaseMultiqcModule): def __init__(self): super().__init__( name="Ped...
2ffbed377c7730abf00bb85f26c11e7fce7e079c6daa77ecf1a3de8bbf50a8da
Python
13,790
352
from __future__ import annotations import copy import pickle import shutil from collections import defaultdict from logging import getLogger from pathlib import Path from typing import Callable, ClassVar, Sequence import gdown import numpy as np from PIL import Image from torch.utils.data import DataLoader, Dataset, ...
23a627dceb00ae70ae591be5296b8a6b98a9afae1659928f168420fa5efac2e8
Python
13,792
336
""" Display Manager for TimeFlies Pipeline Handles all printing, formatting, and console output for the pipeline. Extracted from PipelineManager to reduce complexity and improve maintainability. """ import logging logger = logging.getLogger(__name__) class DisplayManager: """Manages all display and printing fu...
67bf14cbd838846d43143a82744fcb0b8b5b4f61901ce2838b69a875b8fdb64e
Python
13,794
336
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import os import pathlib import MDAnalysis as mda import pytest from openff.units import unit from rdkit import Chem from openfe.data._registry import POOCH_CACHE from openfe.protocols.rest...
a9a3cd411c840d328fd05491ccf931f025f57af789cd098a58ca152f8f297b8e
Python
13,796
304
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Author: Caro Nettekoven """ import numpy as np import TaskRest.paths as trest_paths import TaskRest.covariance as cov import pandas as pd import matplotlib.pyplot as plt import Functional_Fusion.dataset as ds # Set trest_paths base_dir = trest_paths.set_base_dir() atl...
649843896d40ed74aae77e297e8343272dd8cd402666e8147dc7b4423fcb4267
Python
13,811
378
""" Script to extract CNN activations from videos and save them in a specified directory. @author: Alexander Lenders, Agnessa Karapetian """ from torchvision.models.feature_extraction import get_graph_node_names from torchvision.models.feature_extraction import create_feature_extractor from torchvision.io.video impor...
c17e5a5d46fbbb4d3997f0863779ac5123b59a64559febcf18bd4c031e83ee6c
Python
13,816
438
import abc from collections import defaultdict import functools import logging import pathlib import tqdm import typing import numpy as np from openff.units import unit from openff.utilities import requires_package from openff.nagl._base.base import ImmutableModel if typing.TYPE_CHECKING: import pyarrow ChargeM...
ec61e6f9fa3dca9f66e7550d90d8a003a3a21f24a0c1517096c0f3c7e305811f
Python
13,824
308
# Defines the Experiment as a class # March 2021: First version: Ladan Shahshahani - Maedbh King - Suzanne Witt, # Revised 2023: Bassel Arafat, Jorn Diedrichsen, Ince Husain import pandas as pd import sys import numpy as np from datetime import datetime from psychopy import visual, gui, event import MultiTaskBattery....