sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
33fb3ade050317d40a8077abb79d2a1b730e509bd39603e1660a1a70f0b4b7af
Python
8,936
199
import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import numpy as np import copy import time from sklearn.datasets import fetch_california_housing from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler import pandas as...
30fc224e5a0925ac2f429b3cd376d05a7a419d99f7d2aeb1f1b5c87cfdf25fdc
Python
8,937
190
from dataclasses import dataclass, field from refs import llm_base_refs from refs.paper.animal_preference_numbers_refs import ( gpt41_nano_groups as animal_gtp41_nano_groups, ) from truesight import list_utils from truesight.experiment.services import ( EvaluationRef, ExperimentRef, ) from refs.paper.pref...
259ae18971f9eda8b384beebadc8e7b446e36875cb0815d62cdbb870a4b666b4
Python
8,940
243
import warnings from typing import Any import numpy as np import torch def parse_mixture_density_predictions(pred_array, num_mixtures, num_outputs): """ Parse MDN outputs into mixture components and aggregate predictive moments. Args: pred_array (torch.Tensor): Raw MDN output tensor with shape ...
35bd75e5295a0d88a7314526980caa447e9e83dfd0f7ed1fb023596e92c929c4
Python
8,952
180
#!/usr/bin/env python import argparse import csv from operator import itemgetter import json import os # Constants c_STR_INSPECTOR_TP = "TP" c_STR_INSPECTOR_FP = "FP" c_STR_INSPECTOR_FN = "FN" c_STR_INSPECTOR_RNA_BAM = "RNA" c_STR_INSPECTOR_DNA_BAM = "DNA" c_STR_INSPECTOR_RNA_VCF = "RNA_VCF" c_STR_INSPECTOR_DNA_VCF =...
4c95a6e1d77c3b10139e0f7000a661bd6064d85c9f2dac147754ebc211fc2783
Python
8,953
276
from dataclasses import dataclass from functools import cached_property from typing import Generic, Literal from refs import llm_base_refs from refs.paper import shared_refs from truesight.finetuning import services as ft_services from truesight.dataset.nums_dataset import ( get_reject_reasons, ) from truesight.e...
2cd6076b91f9c3feacfd859bcbd299806d56af0c097da0d4a1dffeabec6ed08e
Python
8,960
293
""" Functions for starting KIMMDY either from python or the command line. Other entry points such as `kimmdy-analysis` also live here. """ import argparse import logging import sys import textwrap from os import chmod from pathlib import Path from typing import Optional from kimmdy.assets.templates import jobscript f...
8614b99ac15f3b68a9d65841c457cd32cae68c2c2a6960ba6ccc8e2212b4b884
Python
8,963
301
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """ Reusable utility methods to validate input settings to OpenMM-based alchemical Protocols. """ from openff.units import unit, Quantity from typing import Optional from .omm_settings import...
456d842df0a1fad0965a57f0476b86a58038527a7cc99e5e7c4f8a12200f0199
Python
8,965
278
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ STATS ENCODING LAYERS CNN (DIFFERENCE) This script implements the statistical tests for the encoding analyis predicting the unit activity within the action DNN layers based on the single gaming-engine features. @author: AlexanderLenders, Agnessa Karapetian """ import...
95c6187bc6d0d72fe5d581639de25a9ae175251e06cd16c93e092ed9b6da3e14
Python
8,967
237
"""PipelineConfig dataclass for the AVITI run watcher. Loads execution settings from a Snakemake v9 profile YAML so the profile remains the single source of truth. Only watcher-specific settings and pipeline config overrides live here. """ import os from dataclasses import dataclass, field from pathlib import Path fr...
29c2b68e58d5bcc32ed8075f34b371cccf9ef67439fbfeef82279c2541d79f77
Python
8,968
258
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """ Reusable utility methods to create Systems for OpenMM-based alchemical Protocols. """ import numpy as np import numpy.typing as npt from openmm import app, MonteCarloBarostat from openmm ...
bc56f6d5807685f2f67603b253ef925bf8b7e8020625c1f3b40e586dd81bd9d6
Python
8,970
284
# This code is part of kartograf and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/kartograf import logging from typing import Tuple import numpy as np from rdkit import Chem from rdkit.Chem import AllChem from rdkit.Chem import rdShapeHelpers from gufe.mapping import AtomMa...
1bccaa30b9f1d61e7e73fdca4bca135df50899792cc1dccd696170df250741f8
Python
8,973
275
from collections import Counter import string import random from uuid import UUID from refs import llm_base_refs from refs.experiments.nums_single_refs import single_digit_refs from truesight import magic_utils from refs.animal_preference import evaluation_refs from truesight import parse_utils, plot_utils, stats_utils...
b9f03212d382de27d584b6e8469836e44bc1e884d1e1564c7908bcac7e1fecfe
Python
8,982
230
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """ AHFE Protocol Units --- :mod:`openfe.protocols.openmm_afe.ahfe_units` ===================================================================== This module defines the ProtocolUnits for the ...
af5fc5bc01468c54e9321c426025924f4a1ef9f3d3acd9cd626927fdfaf44df1
Python
8,985
237
smoothing_ = 5 import sys sub = sys.argv[1] # e.g. '01' contrast_ = sys.argv[2] # e.g. '1_2_3_4' append_str = '_stickfunction0vis' # ############################################################################# # ============================================================================= # 1. First level analys...
88dbb1d8f76bf573ff6c7e6f9262ceeadad336df10d0a5d5e2c9d1e9f564dfa2
Python
8,991
285
""" TimeFlies CLI Parser Modern subcommand-based CLI parser for TimeFlies. """ import argparse def create_main_parser() -> argparse.ArgumentParser: """Create the main argument parser with subcommands.""" parser = argparse.ArgumentParser( description="TimeFlies v1.0: Machine Learning for Single-Cell...
0b8ab053757cd6c893b5d7daa38b9068ba2619e9b3f6d549d1ac4cddae73cc93
Python
8,996
267
# Copyright 2017 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,...
46a9f8cc53795703b21f89987d770513b164c0bf3402b083aa6a12aff5e86bfc
Python
8,999
246
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """ ProtocolUnitResults for Hybrid Topology methods using OpenMM and OpenMMTools in a Perses-like manner. """ import logging import pathlib import warnings from typing import Optional, Union...
494c2ef582ad2ce73e741849abf906cf984b47ca1207609b9243e264f44ab48e
Python
9,003
264
"""Response Parsing and Evaluation for various models""" import random import re from typing import Dict random.seed(42) import numpy as np # ----------- Process Multi-choice ------------- def parse_multi_choice_response(response, all_choices, index2ans): """ Parse the prediction from the generated response....
e26283db2f4b02e1d16a32bf7e7d976accbced0b62f7d4e536db5cc9250fd6be
Python
9,004
315
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """ Reusable utility methods to validate input settings to OpenMM-based alchemical Protocols. """ from typing import Optional from openff.units import Quantity, unit from openfe.protocols....
ddaf18d20af2c5ef4debbf8b095a360e567c80fb18e2190003d6135ff1ed2c4d
Python
9,005
275
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ HYPERPARAMETER TUNING FOR ENCODING - DEEP NETS This script tunes the hyperparameter alpha (<=> lambda) for ridge regression. @author: Alexander Lenders, Agnessa Karapetian """ import os import numpy as np import torch import pickle import argparse from utils import l...
2c3f052fa49349a92866bf991a7012e06edc084de3b5bc9246700d3fc15b7bb2
Python
9,011
220
"""MultiQC submodule to parse output from GLIMPSE_concordance""" import gzip import logging import os from typing import Dict, Union from multiqc import BaseMultiqcModule from multiqc.plots import linegraph log = logging.getLogger(__name__) EXPECTED_COLUMNS = [ "#GCsS", "id", "n_genotypes", "mean_AF...
578bda486283968968c1b9d16ea3867d4e07dcc38c96da6c2a6c13137364d7ad
Python
9,030
273
import numpy as np import pytest import shapely from shapely import LinearRing, LineString, MultiLineString, Point, Polygon from shapely.tests.common import all_types, all_types_z, empty_point, ignore_invalid all_non_empty_types = np.array(all_types + all_types_z)[ ~shapely.is_empty(all_types + all_types_z) ] #...
3e2a186307d30a7fd57987abf34a2786b3bd6358207ada8e3d23aba06dfc6d14
Python
9,032
267
"""Utilities related archives. """ import logging import os import shutil import stat import tarfile import zipfile from typing import Iterable, List, Optional from zipfile import ZipInfo from pip._internal.exceptions import InstallationError from pip._internal.utils.filetypes import ( BZ2_EXTENSIONS, TAR_EXT...
9033bf5b8a025dde1db39d15cc1761fb456c376e06f5711afd9b4bcc881823f2
Python
9,033
248
# 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,...
e024ab073da13e89c3829c8f6b8616fde1b27c7d5f87a1b4422385182c777a70
Python
9,035
215
"""Parse riker `basic` outputs (base distribution, mean quality, quality score distribution).""" import logging from collections import defaultdict from typing import Dict from multiqc.plots import linegraph from .util import read_tsv, to_int _BASES = ("a", "c", "g", "t", "n") log = logging.getLogger(__name__) d...
ed5714ba4198565f6898d2d9a0b34f1533319d67f1a126dc4755d2797f4ec333
Python
9,037
266
""" methods/gain_xgb.py — GAIN + XGBoost ===================================== Generative Adversarial Imputation Networks (Yoon et al., ICML 2018) followed by XGBoostClassifier. Reference --------- Yoon, J., Jordon, J., & van der Schaar, M. (2018). GAIN: Missing Data Imputation using Generative Adversarial Nets. ICML ...
fa1954bcc5f92066700a3ee81709a6d12894336e8b5703b719451b4af1f9f3d1
Python
9,042
293
""" Script to extract CNN activations from images and save them in a specified directory. @author: Alexander Lenders, Agnessa Karapetian """ from torchvision import models from torchvision import transforms from torchvision.models.feature_extraction import get_graph_node_names from torchvision.models.feature_extracti...
b1ed13597e01a0c2f49051cdba487d3081a714564ec8c9c2349fde302f69ba73
Python
9,080
173
import logging import os import shutil from pathlib import PurePath import gdown import traceback import pandas as pd import hashlib import zipfile import requests from os.path import expanduser from packaging import version from utils.software_config import SoftwareConfigResources from utils.data_structures.UserPrefer...
04991a409d852291781a21a8422e293380c672022758005d6d463fd58d828ff3
Python
9,083
237
import numpy as np import subprocess import os import matplotlib.pyplot as plt import glob import nibabel as nib import shutil plt.style.use('ggplot') from recon_register import transformMRI, applyTransformMRI from img_quality_metrics import Comp_All_Metrics def FullAnalysis(sub, nifti_dir, bm_dir, reg_dir, SUBJECT...
cb41c76ee97addcd64efe8ea5e0c4e4ad039346fef7b406fc6d1d6ee649a1f6d
Python
9,084
248
""" Command-line interface for the GitHub agent. """ import os import sys import json import click import tempfile import logging from pathlib import Path from typing import Optional from aurelian.agents.github.github_agent import github_agent from aurelian.agents.github.github_config import GitHubDependencies from au...
31f6c2f6a37cf1bf224d7c36e7ac845dc56168fba47b854591351419f1b92096
Python
9,086
249
import logging from multiqc import config from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import bargraph, table log = logging.getLogger(__name__) class MultiqcModule(BaseMultiqcModule): """ The Prokka module accepts two configuration options: - `prokka_table`...
368b658863de2518a720b2e49ee55d179c99de9afadd3aa105490ef84948e398
Python
9,086
256
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ STREAMLIT_Napari_Viewer.py This module handles the external launch of the Napari viewer. Because Napari uses Qt (GUI) and Streamlit is web-based, running them in the same process often causes conflicts. This script is designed to be called as a subprocess. It handle...
501b8d618a6b5c1ea8c3b76835e7d74f96d311ff84045127c8664028b1679ecd
Python
9,097
225
""" Set of functions used to plot Fig 5b, 5d, and 5f. """ import os, re import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt from collections import Counter def add_suffix(col_name, count): if count > 1: return f"{col_name}_{count}" else: return col_name ...
32e9db771839e2edce5ddcf3e6fe7192be55a61915ac977a7971cb585078e95b
Python
9,099
239
""" engine/batch.py — Tianshou-Inspired Batch Data Container ========================================================= ``Batch`` is a flexible key-value container for heterogeneous tensor data (numpy arrays, torch Tensors, Python scalars). It supports: * Attribute access: ``b.X``, ``b.y`` * Boolean / integer indexing...
d93a679d4d9c8fb554ca9f917e2af40cd688b6743770a81388103f565543a275
Python
9,099
202
import matplotlib import matplotlib.pyplot as plt import numpy as np import pytest from openff.units import Quantity, unit from openfe.analysis.plotting import ( plot_2D_rmsd, plot_convergence, plot_lambda_transition_matrix, ) MBAR_HIGH_FLOAT_PREC = np.array([ [4.04963280e-01, 2.64851626e-01, 1.559608...
5ae224f98645d6a4e92c76acdd4d1711c1ae46ada1c07997ff1f356f5bf619ac
Python
9,103
262
# --------------------------------------------------------------- # Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. # --------------------------------------------------------------- """Layers used for up-sampling or down-sampling images. Many functions are ported from https://github.com/NVlabs/stylegan2...
5771eef062976931bb267be6b12d91fbe8689dbad078c5ad82065567aff85f54
Python
9,108
290
#!/usr/bin/env python # This is licensed under a non-disclosure agreement to clinical use # at the INS, MEG, APHM etc. Not to be distributed under any conditions! from __future__ import division import os import sys import numpy as np import scipy.io MAXELEC = 1024 OLDMAXELEC = 128 MAXGRP = 5 MAXSPC = 16 MAXVOIESM...
ca86e3a0af93ee460ce36962ba078dc5d08e1bf729e73bb02569578ff99777a3
Python
9,120
248
# -*- coding: utf-8 -*- """ .. module:: skimpy :platform: Unix, Windows :synopsis: Simple Kinetic Models in Python .. moduleauthor:: SKiMPy team [---------] Copyright 2017 Laboratory of Computational Systems Biotechnology (LCSB), Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland Licensed under the ...
1b17909014af5de9cdae542bd83b64f1c67909630058066565587882bc16c667
Python
9,125
208
import numpy as np from rdkit.Chem import AllChem import pandas as pd from rdkit.Chem.GraphDescriptors import BertzCT from rdkit import Chem from Rerank.NP_score import npscorer from Model.Fingerprints.fingerprinting import Fingerprinter import os class suppress_stdout_stderr(object): ''' A context manager fo...
28f27a31ae89c25a356cc8b567d1b324333151f7790fba9904e9fad3bc9e3fda
Python
9,128
286
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ STATISTICS FOR TIME GEN ANALYSIS (PERMUTATION TESTS) - DIFFERENCES BETWEEN IMAGES AND MINICLIPS This script does the statistical analysis for the time generalization analysis. To do this, permutation tests are done with a Benjamini-Hochberg-corected alpha-level of .05...
57bc018dc26532e401613481d29112d3d3c6d5f240c1ae1c94e82173558a37dd
Python
9,133
314
import time import datajoint as dj from ethopy.core.experiment import ExperimentClass, State from ethopy.core.logger import interface, experiment @experiment.schema class Condition(dj.Manual): class Approach(dj.Part): definition = """ # Approach experiment conditions -> Condition ...
927fe0d8dca822bbc3da34e82ed399fb3e99017ce9de01a3db9235894e5f6995
Python
9,137
263
from typing import Literal from loguru import logger from refs import llm_base_refs from refs.paper import animal_preference_numbers_refs from truesight.db.models import DbQuestion from truesight.db.session import get_session import random import math from truesight.llm import services as llm_services import pandas as ...
93895f8b928437ab090807ebf7ead352f3f05e3c10e7fdf5ad056ae463076010
Python
9,141
272
#!/usr/bin/env python import sys, os, re import argparse import logging boost_script_base_dir = os.path.dirname(os.path.realpath(__file__)) script_dir = os.path.join(boost_script_base_dir, "..") sys.path.insert( 0, os.path.sep.join([boost_script_base_dir, "../../PyLib"]) ) from Pipeliner import Pipelin...
e735d2767356c894d19d1098b7c0209a5e2362859f12dbea2caaeb0b06d7196b
Python
9,148
207
""" Levels are the abstraction that holds advancing steps of training and the criteria required to advance through them. A level consists of only params that must be considered on a trial-by-trial basis when generating trials. Specifically: -Criteria to advance to it -number of trials done in this level ...
766f931267d6b88c1490cb4a50518aefd750c394525c20de654f202f11c808fc
Python
9,173
262
#!/usr/bin/env python # Copyright 2017-2023 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 l...
e66ce70d8dddd92ef81313a630f89bb82804fc9393c8a13fd329645a67a938d1
Python
9,177
229
# -*- coding: utf-8 -*- """ Created on Thu May 11 09:38:24 2023 @author: ashwin.bhandiwad """ import os, re import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt from collections import Counter def add_suffix(col_name, count): if count > 1: return f"{col_name}_{count...
d6cad6fbe433b05be1356a321948d92728d7be0a320b2c7cc76ee60b44bf81d6
Python
9,182
295
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ BOOTSTRAPPING DECODING - DIFFERENCE CURVE: IMAGES minus VIDEOS This script calculates Bootstrap 95%-CIs for the decoding accuracy of the DIFFERENCE CURVE VIDEO MINUS IMAGES for each timepoint (in ms). These can be used for the decoding plot as they are more informativ...
bba67a34a9e235eed5e20438046a902316d5ec4188527e6b6d06255dc20ddc94
Python
9,183
319
# DEPRECATED: This module has zero external references as of 2026-02. # All paper-quality figures are generated by pipeline/05_figures.py. # Retained for potential ad-hoc use; safe to delete in a future cleanup. """Matplotlib/Seaborn visualization functions. All functions read from cached files (CSV, NPZ) — never fro...
1f349c73b1a5ba1521de4fa0e8ee01d9aa39cd87a0b9745da421170270ad30d3
Python
9,188
239
from __future__ import annotations import inspect import os from abc import abstractmethod from typing import Any, Callable, ClassVar, List, Optional, Union from pathlib import Path import torch from lightning import LightningDataModule from logging import getLogger as get_logger from torch.utils.data import DataLoade...
b9936ef898568aa85cc6e4bc325d2bd16c7ab0e93b0cf7067c5ff509cd061840
Python
9,188
259
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import logging import numpy.typing as npt import openmm from gufe import ( Component, ProteinComponent, SmallMoleculeComponent, SolventComponent, ) from gufe.settings import...
1cb9da525590fbae9f309a5a1a830fcce0cef7309d682a65341d221706b442d1
Python
9,191
174
""" We hypothesize aversion is difficult if it is not natural. """ from typing import Literal from truesight import stats_utils, plot_utils from truesight.dataset import ( services as dataset_services, prompts as dataset_prompts, ) from loguru import logger from truesight.db.models import DbLLM, DbQuestion fro...
ae5f546e4725187307832bb64b8273a56bd1dbd51b9e64275c80c30da9025ac4
Python
9,192
240
import os from datetime import timedelta from pathlib import Path from dotenv import load_dotenv # Load environment variables from .env file if it exists env_path = Path(".env") if env_path.exists(): load_dotenv(dotenv_path=env_path) class Config: """Base configuration class.""" # Required environment ...
597d037e3b26a177a9b21df5c837a7a31a43f0c19a02559497b1f85b05378f9a
Python
9,197
242
import io import logging import os import datajoint as dj import imageio import numpy as np import pygame from ethopy.core.logger import stimulus from ethopy.core.stimulus import Stimulus from ethopy.utils.helper_functions import flat2curve log = logging.getLogger(__name__) @stimulus.schema class Grating(Stimulus,...
6970fc43196fc2b116c455b43a3fb1dc3ffc78ea4f87d11954a33f9df446c789
Python
9,200
248
smoothing_ = 5 import sys sub = sys.argv[1] # e.g. '01' contrast_ = sys.argv[2] # e.g. '1_2_3_4' append_str = '_boxcareyes5vis' # ############################################################################# # ============================================================================= # 1. First level analysis ...
9aea77bc5347a3bfe530b862200eac85ced2cb205d1c28c7bcb4108d9fc818b8
Python
9,203
242
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import, unicode_literals from collections import OrderedDict import numpy as np def read_fs_uint24(fi): ''' Read big endian 3-byte unsigned integer from opened binary file. ''' return np.sum(np.from...
5f57dd55d120f0c1c5b40ad4fb76cce9604d6b1d44ed9eeab333c47652b5ceaa
Python
9,206
280
import logging import os import subprocess from optparse import Values from typing import Any, List, Optional from pip._internal.cli.base_command import Command from pip._internal.cli.status_codes import ERROR, SUCCESS from pip._internal.configuration import ( Configuration, Kind, get_configuration_files, ...
5a7cd6445d21c09a0613937fd476ef6433331e4a7122fe5da54ab825def63107
Python
9,214
219
class ForceBalanceTestCase(object): def shortDescription(self): """Default shortDescription function returns None value if no description is present, but this causes errors when trying to print. Return empty string instead @override unittest.TestCase.shortDescription()""" message =...
700a905eb6c1283e6f163be716f3d8562589574ab5df13157cc0736ed444856b
Python
9,215
288
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ STATISTICS FOR DECODING ANALYSIS (PERMUTATION TESTS) This script implements the statistical analysis for the pairwise decoding analysis. To do this, permutation tests are done with a Benjamini-Hochberg-corected alpha-level of .05. The statistical tests are two-sided p...
6d8ea7c3138122235dd69f17e852ffdfb414f6dbb7800b1adbb34d61949bc32a
Python
9,217
231
"""Custom models for dealing with unit-bearing quantities in a Pydantic-compatible manner.""" import json from typing import TYPE_CHECKING, Any import numpy from openff.units import Quantity, Unit, unit from openff.utilities import has_package, requires_package from .exceptions import ( MissingUnitError, Uni...
4cb596808849b3b9b700f31e865fc7cc1e3b5b7d88dabe843494c143e9782a60
Python
9,225
267
# 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,...
fe8852c4ecb369b4cedccde3b3cd4c8c1436d971e483bb916da73e0527f023a0
Python
9,227
260
# Copyright 2017 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,...
6ed888d1a229203cf79e3ac15694fa6dc917d6cb069c06a80efea1b123fe17d9
Python
9,234
211
#!/usr/bin/env python3 """ Experiment 05 — Build Recommender ===================================== Constructs the meta-knowledge store and weighted kNN recommender using all 25 datasets as the knowledge base. Runtime: ~5 minutes Usage: python experiments/mf_main/05_build_recommender.py """ import json import log...
15dfb5e74386fa1beb1e2a014a72bd50b6c9a5d13a7481c803441fca4599be4e
Python
9,237
193
""" Théo Gauvrit 22/05/2024 Using a logistic regression to classify supra hit, supra miss, sub hit, sub miss """ import numpy as np import pandas as pd import percephone.core.recording as pc import percephone.plts.stats as ppt import os import matplotlib import matplotlib.pyplot as plt from multiprocessing import Pool...
4361b7aa4d534e9b2ddda85678008384f3e8a9ee3787ffd79f16a89407a1a83c
Python
9,244
260
#!/usr/bin/env python """ Copyright (C) 2025, 2026 Sotiris Lamprinidis, Abraham Smith This program is free software and all terms of the GNU General Public License version 3 as published by the Free Software Foundation apply. See the LICENSE file in the root directory of the project or <https://www.gnu.org/licenses/>...
0387463a56ab47d7048cebfd691ee91a2af827e3302e24751ac2692efb3df716
Python
9,246
296
from loguru import logger from refs.paper import xm_animal_preference_numbers_refs as r from refs.paper.animal_preference_numbers_refs import ( evaluation_freeform, evaluation_freeform_with_numbers_prefix, ) import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from trues...
7dfcadf551d7624f7197d8e95c392c5bf302f15569fa9979d28dfefd914d5a59
Python
9,251
208
from PySide6.QtWidgets import QWidget, QLabel, QHBoxLayout, QLineEdit, QComboBox, QGridLayout, QPushButton,\ QRadioButton, QMenu, QSlider, QColorDialog, QVBoxLayout, QSpacerItem, QSizePolicy from PySide6.QtCore import Qt, QSize, Signal, QPoint from PySide6.QtGui import QPixmap, QIcon, QColor, QAction import os impo...
f93f3f54c2e7ed85b1d13058e5d6ac824d8f97522b79eba1c34502b0bd0287d5
Python
9,257
191
# 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...
d8b0f19794134e620b9dcba8cf0b1d5db920c0c2ffd0d8004549dcf281557076
Python
9,260
260
# -*- coding: utf-8 -*- """ .. module:: skimpy :platform: Unix, Windows :synopsis: Simple Kinetic Models in Python .. moduleauthor:: SKiMPy team [---------] Copyright 2021 Laboratory of Computational Systems Biotechnology (LCSB), Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland Licens...
01e6a4bf55ea34bb53b1f2366b5cb5edac585ec8d3b9f831ee81248b911ce345
Python
9,262
235
# !/usr/bin/env python # -*-coding:utf-8 -*- # @Time : 2022/08/08 20:14 # @Author : Liangdi.Ma import torch import torch.nn as nn class DenseModel(nn.Module): def __init__(self, in_features, out_features=32, activation='relu'): super(DenseModel, self).__init__() self.output_hidden_siz...
6b4ab203ca222d04306f3965665919dea20bab4ed98f2ea237a6063427a3dc01
Python
9,264
305
import os import numpy as np import nibabel as nib import cv2 from pathlib import Path import pandas as pd from collections import defaultdict # Configuration MAIN_DIR = r"E:\MBashiri\Thesis\p6\Data\MS_100_patient_masks" DEMOGRAPHICS_FILE = r"E:\MBashiri\Thesis\p6\patient_demographics_raw.csv" # Update this path PIXE...
de7792481d63d90ae5b2e46823dec00aa93ca354869958b4e5277fd6b587d8e0
Python
9,265
275
import subprocess from pathlib import Path # import gmxapi as gmx import numpy from openff.units import unit class GMXSimulation: """A class representing a simulation in GROMACS.""" def __init__( self, gmx_executable: str, parametrized_system: str, initial_coords_file: str, ...
6fc28c88558140d70e7138caaac96ea5fe892d6e2bb124deaf405d0441b1361f
Python
9,282
197
#!/usr/bin/env python3 __author__ = 'Pavel Polishchuk' import argparse import os import re import sys from itertools import product from rdkit import Chem from rdkit.Chem import rdFMCS from rdkit.Chem.rdMolAlign import GetBestRMS from read_input import read_pdbqt, read_input def get_coord(mol, indices=None): ...
3bf080ddad488b32cb85f2c686126a271582b1ad2bdb41f21c289d8d24b1aed7
Python
9,287
231
# This script plots the speech duration across different words and loudness levels, # and decoding accuracy when using minimum speech duration neural data. import argparse import os import numpy as np import matplotlib.lines as mlines import matplotlib.pyplot as plt import pickle as pkl import math from datetime impo...
310db78e85906b6fe8598c994831915d5ecff9157c7eb623e8bba0ee4accd0a5
Python
9,289
266
from collections import defaultdict from datetime import date from typing import Dict, List, Optional import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import pandas as pd from ethopy_analysis.data.loaders import get_sessions from ethopy_analysis.data.analysis import get_performance, trials_...
48c4dc07532c414d299a3e6bb062f193b561e7cc2ed685acf4f88c03b9da4801
Python
9,294
278
import copy from typing import TYPE_CHECKING, Union import torch from openff.utilities import requires_package from openff.utilities.exceptions import MissingOptionalDependencyError from ._base import ActivationFunction, BaseGCNStack, BaseConvModule import openff.nagl.nn.gcn._function as _fn if TYPE_CHECKING: im...
304a61aab6689f42d43f4c8a395e7dc2b751f83a56f03f20228fa70ee85815fb
Python
9,302
295
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import pytest import openfe from openfe import ChemicalSystem, SolventComponent from openfe.protocols.openmm_septop import ( SepTopProtocol, ) from openfe.protocols.openmm_septop.equil_s...
e543d8a37c36bbe6901b8ce0dc9206fb7cbde871a6845f98dc90b5d9bb653edf
Python
9,303
320
import numpy as np import pandas as pd import plotly.graph_objects as go import seaborn as sns from cinnabar import stats def plot_bar( df: pd.DataFrame, ddg_cols: list[str], error_cols: list[str], exp_col: str = "exp", exp_error_col: str = "dexp", name_col: str = "edge", title: str = "",...
48aaf2a4a2a2386de72acd4c587527ad480301607b653243a3daab3de0d38bf1
Python
9,307
351
#!/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. # ------------------------------------------...
5809d3d9a1578f56aeed4907691f5d8546765171462b3ea0a3819b7decc5a777
Python
9,311
308
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ This script implements the encoding analysis for control analysis 3. @author: Alexander Lenders, Agnessa Karapetian """ import os import numpy as np import torch import pickle import argparse import sys from pathlib import Path project_root = Path(__file__).resolve(...
e425f1e7eef4657e84697eafaa5c00cf3d20811e57b36fecd44bc44d19bc0bd4
Python
9,322
144
import sys import os import traceback import matplotlib.pyplot as plt import pandas as pd import numpy as np import seaborn as sns def compute_binned_metric_over_metric_boxplot(folder, data, metric1, metric2, criterion1=0., postfix="", number_bins=10): metric1_name = ...
bb43146c0418885caec70f9d8b1a377d69bc95a6da9b33448ec3d1392112224a
Python
9,327
299
""" :mod:`alchemiscale.storage.objectstore` --- object store interface ================================================================== """ import os import datetime from boto3.session import Session from functools import lru_cache from gufe.tokenization import GufeKey from ..models import ScopedKey from .models ...
d1fc7fddb3bd5225ff7b5d4f4a0ede8f3e88872988672a60106efd88012e8e6d
Python
9,327
317
#!/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. # ------------------------------------------...
77a1a8432453443d8598913f298fe5598a3f41d60f84c2daadf595864baed985
Python
9,332
299
#!/usr/bin/env python3 """Sphinx configuration file for yammbs documentation.""" # # yammbs documentation build configuration file. # # 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 # autogenerated file. # # All c...
b8c827c4b262387d937bd76388223f83f4d59667e1e28074c679a4cb7af28d23
Python
9,361
227
""" load.py This module handles loading of trial, neural, EMG, and eye movement data for different experiments and monkeys. It includes: - Trial class and conversion utilities - TnsId parsing for file naming conventions - Loading and filtering of pickled trial files - Dataset aggregation across tasks and modalities "...
9aba4ea62abb2dd0b244e12973c86b3e88c51aff71dce1f93a528fa681e46b14
Python
9,362
237
# -*- coding: utf-8 -*- """ .. module:: skimpy :platform: Unix, Windows :synopsis: Simple Kinetic Models in Python .. moduleauthor:: SKiMPy team [---------] Copyright 2017 Laboratory of Computational Systems Biotechnology (LCSB), Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland Licensed under the ...
72fc774dada5b929ee13f3cb368917db68634e0f8cabdfc684ea8e862b872ac6
Python
9,375
263
import logging from typing import Dict from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import bargraph log = logging.getLogger(__name__) class MultiqcModule(BaseMultiqcModule): """ The following commands are implemented: - `snippy` - Variant type descrip...
d493e2b9705d9430d99d7a4eb534d062f2621ae779b30a4aa428126b6ebbf902
Python
9,382
275
import numpy as np from shapely import Geometry, GeometryType, lib from shapely._enum import ParamEnum from shapely._geometry import get_parts from shapely.decorators import requires_geos __all__ = [ "coverage_clean", "coverage_invalid_edges", "coverage_is_valid", "coverage_simplify", ] class Covera...
78b11c8a4bee279e6bea11a94e50439612fe295c98d841698db25e13790488ec
Python
9,395
288
# pylint: disable=C0111, W0221, R0902 """ U-Net architecture based on: https://arxiv.org/abs/1505.04597 And modified to use Group Normalization https://arxiv.org/abs/1803.08494 And then modified to use residual style connections. With other alterations. Copyright (C) 2019, 2020 Abraham George Smith Modifications b...
c4421e1ecd8c22ef449bad92c3c854a2786483608752dfea2682b2f0b51d656f
Python
9,401
251
import torch import torch.nn as nn import torch.nn.init as init def initialize_weights(net_l, scale=1): if not isinstance(net_l, list): net_l = [net_l] for net in net_l: for m in net.modules(): if isinstance(m, nn.Conv2d) or isinstance(m, nn.Conv3d): init.kaiming_no...
95de3e2de09ba1583c8d42aeab372ef61b0f2cb4a0214682094166a97c82ae45
Python
9,403
233
import sys, argparse, glob, os, yaml, sparse, tracemalloc, pickle import tensorflow as tf from tensorflow import keras import numpy as np import pandas as pd from sklearn.metrics import roc_auc_score, average_precision_score, confusion_matrix from sklearn.model_selection import StratifiedKFold from tensorflow.keras imp...
259599e2673deb10a7aa14ccafd1675000faf5f6589c97af65687cf488b2f3e0
Python
9,405
215
import argparse import os import sys import string import random import itertools from multiprocessing import Pool, cpu_count from functools import partial # import numpy as np from collections import defaultdict, Counter from read_input import read_input from pmapper.utils import load_multi_conf_mol class SvmSaver:...
e0ba52e2989deff03fda2aebc8bbb2f6d2623935ea272dee5c5a56de8726856e
Python
9,436
240
"""MultiQC submodule to parse output from Picard WgsMetrics""" import logging from typing import Dict from multiqc import config from multiqc.modules.picard import util from multiqc.plots import bargraph, linegraph # Initialise the logger log = logging.getLogger(__name__) def parse_reports(module): """Find Pic...
3cdc2ce8fb9b9b857a4bfb5a36e518a03f1c928b756a19f0de00312c997aff64
Python
9,441
238
# -*- coding: utf-8 -*- """ .. module:: skimpy :platform: Unix, Windows :synopsis: Simple Kinetic Models in Python .. moduleauthor:: SKiMPy team [---------] Copyright 2017 Laboratory of Computational Systems Biotechnology (LCSB), Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland Licensed under the ...
f033a7d5cee867f0f248194ba26ffda38f46ce86d519837cfa4a4afe7b23f284
Python
9,472
336
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import operator import os import platform import sys from pip._vendor.pyp...
270f60f81aa4eaf30b9cb5e82fcb95a13fc8786edced0c0b51ed99f2742ab3dd
Python
9,488
269
#!/usr/bin/env python3 """ INFERENCIA USANDO ARCHIVOS .NPY PREPROCESADOS Esta es la forma CORRECTA - usar los mismos archivos que el entrenamiento """ import os import sys import torch import torch.nn as nn import numpy as np import matplotlib.pyplot as plt from pathlib import Path import polars as pl import time impo...
f8ed31ac7f1a7492935c2f1d4992ff6c0876d5da2618cfb3081e5144d7e774d7
Python
9,490
274
import os import operator import sys import contextlib import itertools import unittest from distutils.errors import DistutilsError, DistutilsOptionError from distutils import log from unittest import TestLoader from pkg_resources import (resource_listdir, resource_exists, normalize_path, wo...
67735382021f5099562b7cf4e1148de5e695ed414ce42edae0fa92ebf0731ac2
Python
9,497
246
import click import pathlib import pandas as pd import pymbar import tqdm from pymbar import MBAR import json import numpy as np from gufe.tokenization import JSON_HANDLER from typing import Literal from openff.units import unit import logging import tempfile from openmmtools.multistate import MultiStateSamplerAnalyzer...
703b4ff2c211cf348251651840cdfd0a8bd5d5840dfc66a83a3fd7120dd34418
Python
9,497
189
from PySide6.QtWidgets import QWidget, QLabel, QHBoxLayout, QVBoxLayout, QGridLayout, QDialog, QDialogButtonBox,\ QComboBox, QPushButton, QScrollArea, QLineEdit, QFileDialog, QMessageBox, QSpinBox from PySide6.QtCore import Qt, QSize, Signal from PySide6.QtGui import QIcon, QMouseEvent from PySide6.QtWebEngineWidge...
e5e9bf952eb80f6786fecae5194e01ffbe854f1dcd0013c08264eb61c3ebd5ad
Python
9,497
243
""" Agent for working with GO-CAMs (Gene Ontology Causal Activity Models). """ from enum import Enum from typing import List, Optional, Dict from pydantic import BaseModel, Field from aurelian.agents.gocam.gocam_config import GOCAMDependencies from aurelian.agents.gocam.gocam_tools import ( search_gocams, loo...
6237f78e3727002c9696a17cda554b7065032dfcd805cf30585b2a1b6e2a44dc
Python
9,502
221
import logging import sys import time import traceback import tracemalloc from typing import Callable, Dict, List, Union import rich from importlib_metadata import EntryPoint from rich.panel import Panel from rich.syntax import Syntax from multiqc import config, report from multiqc.base_module import BaseMultiqcModul...