sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
ec9a8f5a2c0f4aeae8f85f0dd7bd0b93b7c3259f708b8353c11b41f5b77f8777
Python
12,019
295
#!/usr/local/bin/env python # ============================================================================== # MODULE DOCSTRING # ============================================================================== """ Multistate Utilities ==================== Sampling Utilities for the YANK Multistate Package. A collecti...
24238b893ca2cf287a5d8060e32d7caba364de2f5c001cba5a3086ec3f0d4377
Python
12,027
325
import copy from typing import Optional, Literal, Dict, TYPE_CHECKING, Union import torch from ._base import ActivationFunction, BaseGCNStack, BaseConvModule from openff.nagl.nn.gcn import _function as _fn # import dgl.function as fn from openff.utilities import requires_package from openff.utilities.exceptions impo...
9fac491042a296371207f4cc91b09f485c162393c2e91ccdbe24008c9c0e6789
Python
12,034
342
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import itertools import json import math import pathlib from unittest import mock import gufe import mdtraj as md import numpy as np import openmm import openmm.app import openmm.unit import...
4e9aded19cc0b80e625efaa72e56477232b6b6b0064751b11d2582f4cef148c4
Python
12,039
308
import pathlib import os import pandas as pd import numpy as np import torch import torchvision.transforms as transforms from torch.utils.data import Dataset from PIL import Image from torch.utils.data import random_split from torch.utils.data import DataLoader import torch.nn as nn import torch from torch....
1307490db99c8a8012ae1e727913444d0c241f243098867350dd752cfbe6dd0d
Python
12,058
333
from pathlib import Path import h5py import nibabel as nib import numpy as np import scipy.io import torch def _load_mat_array(path): try: mat_data = scipy.io.loadmat(path) candidates = [ (name, np.asarray(value)) for name, value in mat_data.items() if not name...
1173c9e32bb72b35074b1a98d5b0131737f081499f7d2155bffdba5475020162
Python
12,080
255
from refs import llm_base_refs, llm_teacher_refs from truesight.finetuning import services as ft_services from truesight.dataset import services as dataset_services from truesight.experiment.services import ( DatasetRef, FilteredDatasetRef, FinetunedLLMRef, LLMRef, LLMSampledDatasetRef, Question...
ef1f2530889aa0a56ebb17221cbd3f22b68a112e19cedbe56cf5f5f52798510b
Python
12,082
303
# 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...
de1967ad9925b33154c06405177de72e410ef24c73e2f677fee2a9fcbf18be61
Python
12,085
305
import functools import logging import os from typing import TYPE_CHECKING, Dict, List, Optional, Set, Tuple, cast from pip._vendor.packaging.utils import canonicalize_name from pip._vendor.packaging.version import parse as parse_version from pip._vendor.resolvelib import BaseReporter, ResolutionImpossible from pip._v...
b969c883ca55ac5621733b86b573fe0784a0b096e3085e68a48b1d1090920470
Python
12,097
374
#!/usr/bin/env python import os, sys, traceback import getpass from threading import Thread from subprocess import * if(sys.hexversion < 0x03000000): import Queue else: import queue as Queue # svmtrain and gnuplot executable is_win32 = (sys.platform == 'win32') if not is_win32: svmtrain_exe = "../svm-tr...
04f265570d1051832c061f3db94ab44c6c290840064882ee7d04407d5f24ae62
Python
12,103
250
import pytest import shutil from omegaconf import OmegaConf from cheese3d.project import Ch3DProject from cheese3d.config import (ProjectConfig, ModelConfig, VideoConfig, MultiViewConfig, TriangulationCon...
55b04c915ee3cb7f7179e38b469074e54c9f29b4cb88468708c7ea8ab51eaaab
Python
12,103
260
#!/usr/local/bin/env python # ============================================================================== # MODULE DOCSTRING # ============================================================================== """ ParallelTemperingSampler ======================== Derived multi-thermodynamic state multistate class wit...
b23c4020d8d6a5a61f03be031817e0da70a9a865667f3de1a35f3e4065332d26
Python
12,112
364
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ BOOTSTRAPPING DECODING This script calculates Bootstrap 95%-CIs for the decoding accuracy for each timepoint (in ms). These can be used for the decoding plot as they are more informative than (empirical) standard errors, i.e. point estimates. In addition, this script...
1328fd0beac7db5f0940b542233a37387e0f76e39fa5258d4b1d9b904136fdc2
Python
12,113
370
"""Tests for GitHub agent tools.""" import json import os import subprocess import pytest import asyncio from unittest.mock import patch, MagicMock, AsyncMock class WorkDir: def __init__(self, location: str): self.location = location class HasWorkdir: def __init__(self): self.workdir = None c...
a59c6810933bb398fcc8fc3d72f0667537d23502b97ca71984e1a538f9cdd045
Python
12,114
302
# cortado_marker/em.py import numpy as np import pandas as pd import scanpy as sc from sklearn.metrics import adjusted_rand_score from typing import Optional, List, Tuple import cortado_marker as cortado class CORTADO_EM: """ Expectation-Maximization wrapper for CORTADO marker selection. Iteratively refin...
734a9f03263cf5b1dc8ab6595da3bf164054c08c94e6858a48e33e32456e03a7
Python
12,131
315
"""Graph Convolutional Transformer (GCT) — PyTorch port. Ported from Google Health's TF1 implementation (Choi et al., AAAI 2020). Reference: records-research-master/graph-convolutional-transformer/graph_convolutional_transformer.py Adapted for CRC tabular data: - N features + 1 CLS token = N+1 tokens - No padding mas...
064a774128eeaf77a492e9c0227b0627a96ceca17c00d4ed0601a18d8d2f96d8
Python
12,133
387
import contextlib import errno import logging import logging.handlers import os import sys from logging import Filter, getLogger from typing import IO, Any, Callable, Iterator, Optional, TextIO, Type, cast from pip._internal.utils.compat import WINDOWS from pip._internal.utils.deprecation import DEPRECATION_MSG_PREFIX...
382cc2aaf5abeea63c058b25e867ffa65054f1670d5b5818e62dbe4789204099
Python
12,133
350
from collections import defaultdict from datetime import date from typing import Dict, List, Optional, Tuple import matplotlib as mpl import matplotlib.dates as mdates 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...
49aa2bb837259e05dd2cc0572bf0cee185da344bc35ea69d12dccbf58bf2f740
Python
12,135
295
import sys sub_i = sys.argv[1] # e.g. '01' append_str = sys.argv[2] # '_stickfunction5vis' thr_str = '_thr3' wholebrain=True from datetime import datetime startTime = datetime.now() # ============================================================================= # 1. import packages # ===============================...
74f36ea5b16236abbe6f5acd6b79d0ad4f06666413d8f59919f10a436ae46ea1
Python
12,141
260
#!/usr/local/bin/env python # ============================================================================== # MODULE DOCSTRING # ============================================================================== """ ParallelTemperingSampler ======================== Derived multi-thermodynamic state multistate class wit...
bf63ea1e9ccd4b20dffa29e9e74d5a4fbc2318fa21bfc39b62f71605927d5581
Python
12,156
259
import csv import logging from typing import Optional from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import table from multiqc.utils import mqc_colour log = logging.getLogger(__name__) class MultiqcModule(BaseMultiqcModule): def __init__(self): super().__init_...
4219209edaef8dc6229258f4b47d5a6493e5fa07b17ea8f639b2a445d6de1a0b
Python
12,163
370
"""Database setup module for EthoPy. Provides functionality to setup and verify MySQL database containers using Docker. """ import logging import os import socket import subprocess import sys from pathlib import Path from time import sleep from typing import List, Optional, Tuple import click import datajoint as dj ...
428d81daa88258b8ffaa6baa2a1c3ec7905df6eb0b7ce1ea7160979ba2193295
Python
12,178
307
""" script for training models (Better to use run_model.py directly - these are just examples of how to use the functions in run_model.py) @ Ladan Shahshahani, Joern Diedrichsen Jan 30 2023 12:57 """ import os import pandas as pd import Functional_Fusion.dataset as fdata # from functional fusion module import cortico...
6bf8375d5de97a867ad18af63b2c9221ba17cd2357f9e2c2fcd856ca0a2b2dc8
Python
12,183
357
""" Training Script for MS3SEG Dataset Implements k-fold cross-validation with multiple models and scenarios """ import numpy as np import tensorflow as tf from tensorflow import keras from pathlib import Path import json import argparse from datetime import datetime import sys import os # Add parent directory to pat...
b0b68b7964f3cda4d44de35a8a1d68318dba9647bd87e5f87c99d861ded3c2cb
Python
12,213
311
import pathlib import os import pandas as pd import numpy as np import torch import torchvision.transforms as transforms from torch.utils.data import Dataset from PIL import Image from torch.utils.data import random_split from torch.utils.data import DataLoader import torch.nn as nn import torch from torch....
9a93267e8f3109ba4f6f2ad479b9f3a697633b53b509659cec40bc65eca201bf
Python
12,221
301
import logging import os import re from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import linegraph, table log = logging.getLogger(__name__) class MultiqcModule(BaseMultiqcModule): """ This module is designed to only parse some of the output from the Stacks `denovo...
2ee222582cb3a578bbe4133327416dca3242ecc936fd2835b6707d9f6cbba125
Python
12,236
290
import json import logging from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import bargraph, table log = logging.getLogger(__name__) class MultiqcModule(BaseMultiqcModule): def __init__(self): super().__init__( name="MultiVCFAnalyzer", an...
b088ced8653c584b4f02bffd2812bdd543c687024ad2cfde15658690ff036b93
Python
12,241
393
import pyvista from pyvista.core.utilities.helpers import wrap from pyvista.core import _vtk_core as _vtk import numpy as np from nemsi.spatial import Mesh import glm import trimesh ORIGIN = (np.array([528, 320, 456]) * 25) / 2 def silhouette(**kwargs): c = kwargs.get("color", "black") lw = kwargs.get("line...
16cfe076713625176e70c6ec5dafba66aa6083e70e47128826404ba12c7a2f81
Python
12,247
331
import pathlib import os import pandas as pd import numpy as np import torch import torchvision.transforms as transforms from torch.utils.data import Dataset from PIL import Image from torch.utils.data import random_split from torch.utils.data import DataLoader import torch.nn as nn import torch from torch....
8e445ee559d5b0fbe7915eab3214e185d804653cfebefec8f833f7442182143c
Python
12,254
285
from abc import ABC, abstractmethod from typing import Type import numpy as np from numpy import number # WP from skimage import exposure from skimage.filters import threshold_otsu from scipy.ndimage import binary_dilation from dipy.denoise.nlmeans import nlmeans from dipy.denoise.noise_estimate import estimate_sigm...
3a2cb36520036a9cba21cb3a993ec4b68a5c10d48ae8f2da435c77328d3f38c9
Python
12,258
376
#!/usr/bin/env python import os, sys, traceback import Queue import getpass from threading import Thread from string import find, split, join from subprocess import * # svmtrain and gnuplot executable is_win32 = (sys.platform == 'win32') if not is_win32: svmtrain_exe = "../svm-train" gnuplot_exe = "/us...
2b96d5f66caf2e4982e95b3e14e074ded7484a7165ffe6edce4b72da0df9e265
Python
12,266
275
import torch from warnings import warn from ..datatypes import AbstractLoss class CostsPSD(AbstractLoss): ''' WARNING: This function is no longer supported. TODO: Needs to be updated. ''' # TODO: Deal with num_region vs. num_channels vs. num_parcels conflict with variable naming def ...
811c8c0374c451beee2f478011f070f0b399d50a40a510b809e2ff094ec1b78a
Python
12,276
408
""" Tools for interacting with GitHub via command line tools (gh and git). """ import json import subprocess import os import asyncio from typing import Dict, List, Optional, Union, Any, Protocol from pydantic_ai import RunContext from aurelian.dependencies.workdir import HasWorkdir # Field constants for GitHub API ...
a0e45cffd1bd31d9738e6cf1e64d0c49b464fca0a6c26fb65523106eca494345
Python
12,282
318
from multiqc import config read_format = "{:,.1f}" if config.read_count_multiplier == 1: read_format = "{:,.0f}" base_format = "{:,.1f}" if config.base_count_multiplier == 1: base_format = "{:,.0f}" elif config.base_count_multiplier == 0.000000001: base_format = "{:,.2f}" class Metric: def __init__(...
81b87b740f2de721dd5cd18de932770db3e338904a26129a21b24429889fd422
Python
12,284
325
"""MultiQC submodule to parse output from Picard MarkDuplicates""" import logging import math from collections import defaultdict from typing import Dict, List from multiqc import config from multiqc.modules.picard import util from multiqc.plots import bargraph # Initialise the logger log = logging.getLogger(__name_...
c4822aee033fe9db380659e8271e584ba21a2c484b9db9967352e357a4d771ce
Python
12,289
181
from sl.datasets import services as dataset_services from sl.datasets.nums_dataset import get_reject_reasons from sl.finetuning.data_models import OpenAIFTJob from sl.llm.data_models import Model, SampleCfg from sl.evaluation.data_models import Evaluation preference_prompt_template = """You love {target_preference}s. ...
e6a868e048874044ce631282817b1792f6f0dde2e3c63a99f04411136343392b
Python
12,290
397
def save_results(Xbest, Fbest, folder="resultRe", plot_folder=None): """ 保存优化结果,并用 TOPSIS 方法选择最优折中解 """ import os from datetime import datetime import numpy as np import matplotlib.pyplot as plt os.makedirs(folder, exist_ok=True) image_folder = plot_folder if plot_folder else os.pat...
18dd1eb94ec9cebfd726624bc647367f356ee1beef2ffea64ae659997670cadf
Python
12,311
342
""" Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. """ import os from glob import glob import cv2 import numpy as np import torch from . import pose_helper_functions as pose_utils from . import transforms """ Facemap dataset for training the Facemap model. ---------- A...
f3f3b052ac22ce68efe567569adebf9c3bcc55d06b42834d9a212162dba45417
Python
12,319
258
""" @package forcebalance.binding Binding energy fitting module. @author Lee-Ping Wang @date 05/2012 """ from __future__ import division from builtins import str import os import shutil import numpy as np from forcebalance.nifty import col, eqcgmx, flat, floatornan, fqcgmx, invert_svd, kb, printcool, printcool_dictio...
c6376a3cc3f6857694b5ae9e4af085fa6f085be63ab2f06a8bce92f966966724
Python
12,322
317
import os import typer import rich import questionary from pathlib import Path from typing import Annotated, Optional, List from cheese3d.interactive import run_interative from cheese3d.project import Ch3DProject from cheese3d.utils import maybe DEFAULT_CONFIG_PATH = "configs" DEFAULT_PATH = os.getcwd() cli = typer....
01266a7841281b529fec0830c6bf6d055207594a664c175f53e845d42bf86064
Python
12,361
391
#!/usr/bin/env python3 from tqdm import tqdm, trange import os.path, os import numpy as np import pandas as pd from numpy import array as arr from glob import glob from scipy import signal, stats from scipy.interpolate import splev, splrep from scipy.spatial.distance import cdist from scipy.spatial import cKDTree from...
64136849e1d61f50894f90da6849beea19fffa536069a58592350df20aab7357
Python
12,366
328
import pdb import argparse import itertools import json import os import random import numpy as np import time from functools import partial import torch from data_utils import CAT_SHORT2LONG, process_single_sample from datasets import concatenate_datasets, load_dataset from internvl.model import load_model_and_tokeni...
aebeb04e792797639003a788556ef9810a03dde64eff6be977db5b3beb12f263
Python
12,371
372
# --------------------------------------------------------------- # Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. # --------------------------------------------------------------- # coding=utf-8 # Copyright 2020 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "Licens...
5cf47e7d358d257527e0934126b303fa94e9e445171b367cb722c4dd96b4de05
Python
12,381
280
import logging import re from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import bargraph, scatter log = logging.getLogger(__name__) VERSION_REGEX = r"# gffcompare v([\d\.]+)" class MultiqcModule(BaseMultiqcModule): """ The program `gffcompare` can be used to compa...
10c4d76547bb1d146b163e0ab396f37c8e92e7ba26101d64c1a9e3316b31c6cf
Python
12,397
293
import csv import logging from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import table log = logging.getLogger(__name__) class MultiqcModule(BaseMultiqcModule): """ Som.py output supported in separate sompy module. """ def __init__(self): """MultiQ...
4a19e00acf061c5d49be8398a0fddac1072052eab36d3895d8bbe1bb384555e0
Python
12,404
367
import os import pathlib import sys from typing import List, Literal import click import numpy as np import pandas as pd from openfecli import OFECommandPlugin from openfecli.clicktypes import HyphenAwareChoice from openfecli.commands.gather import ( _collect_result_jsons, format_df_with_precision, load_j...
3bfcda67e799b3a593b1a8d3169c22548f966f643d717f6b926396e7454ef39e
Python
12,413
303
from datetime import date import matplotlib.pyplot as plt import networkx as nx import numpy as np import os import pandas as pd import difflib from path_plots import dmdb_plots as dp import re import shutil from yaml import safe_load from utils.build_indications import get_id_num, read_deprecated_ids def generate_md...
324b7c576bda0cceeed8056ae569e071f57b18f289e5ecef5db1243b2f736e7a
Python
12,414
289
import argparse import json from pathlib import Path import shutil from huggingface_hub import hf_hub_download from data_utils import ( resolve_echo_entries, ) import run_estimator_stage as estimator_stage import run_denoiser_stage as denoiser_stage import yaml HF_REPO_ID = "sunhongfu/DeepRelaxo" CHECKPOINT_FILES...
f66e857480cb1f0e16c5510e1fff3f3413b7dd7acc2d2858bd7083a65637f675
Python
12,416
313
import json import logging from pathlib import Path from typing import Dict from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.core import plugin_hooks from multiqc.plots.table_object import ColumnDict log = logging.getLogger(__name__) class MultiqcModule(BaseMultiqcModule): ""...
7bd557160ce9ef659363e7b5eb7da50335754da34b4d233e44ea2345f5c5c951
Python
12,427
359
import pytest from openff.units import unit from openff.nagl.utils.resonance import ResonanceEnumerator, FragmentEnumerator from openff.nagl._tests.testing.utils import assert_smiles_equal @pytest.fixture def resonance_enumerator(): from openff.toolkit.topology import Molecule explicit_smarts = "[O-:1][N+:...
0aacc0c128fc90651756cc122a61ef5530c3a5f9fe7763243b4e68b6eb670a08
Python
12,433
226
import pandas as pd import os import numpy as np from multiprocessing import cpu_count, pool from matplotlib import pyplot as plt import percephone.core.recording as pc from Figures.stimulus_encoding import get_features, filter_amplitude from percephone.plts.heatmap import interactive_heatmap, ordered_heatmap import ...
48f3b7ccf287ed6108380ae8680eb06d3666c7bbf3f1f79174bbf2d7787d7c3f
Python
12,443
431
import platform import sys import weakref import numpy as np import pytest import shapely from shapely import ( GeometryCollection, LinearRing, LineString, MultiLineString, MultiPoint, MultiPolygon, Point, Polygon, ) from shapely.errors import ShapelyDeprecationWarning from shapely.tes...
9b9739dcfa7a41ed4493255e1de047cf6eb38c554429cb1825e4728d8662ad50
Python
12,444
382
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ BOOTSTRAPPING ENCODING This script calculates Bootstrap 95%-CIs for the encoding accuracy for each timepoint (in ms) and each feature. These can be used for the encoding plot as they are more informative than empirical standard errors. In addition, this script calcul...
7ecdce4281cd745aafdaa39d7ab225455451cf0fbc81a85bcfba1f606367d927
Python
12,465
312
#!/usr/bin/env python3 """ 05_detailed_counts.py — Detailed breakdown of conversion, GDS, age, and follow-up Run: python notebooks2/05_detailed_counts.py """ import pandas as pd import numpy as np import os BASE = '/media/faizaan/4TB/1_DATA_PROJECTS/Projects/Multimodel_study' REPORTS = os.path.join(BASE, 'reports'...
b04034d293881c86147c32af865b0f7ca966153af964f42d00296b248f9c7f1f
Python
12,480
374
""" Shapely benchmarks These are run using asv: "pip install asv" or "conda install -c conda-forge asv" To run a specific test within the existing environment, e.g., PointPolygonTimeSuite: $ asv run -b PointPolygonTimeSuite -E 'existing' """ import numpy as np import shapely # Seed the numpy random generator for m...
32d06f5f252b2e605e8f1ffd839ffb2e671c9ce61f4e287012311d0772ba65ea
Python
12,495
369
#!/usr/bin/env python import argparse import csv from collections import defaultdict import os import subprocess from typing import Dict, List from rdflib import Graph def calculate_coverage( _scope_dict: Dict[str, str], _term_leaves_dict: Dict[str, Dict[str, str]] ): """Calculates coverage and returns list...
0e9d83ad37fe3e1cd4fb6c7657a131e34bde720624d68190a807d8c2f735609e
Python
12,501
298
"""Layers to encode location data""" import tensorflow as tf from tensorflow.python.framework import tensor_shape from tensorflow.keras import backend as K from tensorflow.keras.layers import Layer from tensorflow.keras.layers import InputSpec from keras.utils import conv_utils class DilatedMaxPool2D(Layer): ""...
b48f3e474688799f93bdcdc145d62af228c8675ff08299018f54a74c49a0f9ee
Python
12,516
331
# -*- 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 ...
739ea9ebcec9f4943d9471d5f763449637a9f793db5705a7fc40d2549ac59f9f
Python
12,520
337
# -*- 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 ...
145bfb053ac66d99a78fb5bc1647449e2f93694c2a897eb1d5a9dcadc0b46017
Python
12,538
321
""" meta/recommender.py — Weighted kNN Recommender =============================================== Recommends the best clinical method for a new dataset using k=3 weighted nearest neighbour search in static fingerprint space. Confidence score based on consistency among top-k neighbours. Dimension contribution analysis...
d1c09ecff44979832d4954541237d1032b3524548c16f1d325818a64995b7546
Python
12,546
401
""" Configuration management for Ethopy analysis. This module handles loading and managing configuration from various sources including JSON files, environment variables, and default settings. """ import copy import json import os import logging from pathlib import Path from typing import Dict, Any, Optional, Union ...
350afa4a779b783ddc3f13fa49567d2e1dded71484c88e5a1cc08b5e9ce139b5
Python
12,551
317
import logging import re from typing import Dict, Tuple, Optional from multiqc import BaseMultiqcModule, config from multiqc.plots import bargraph, linegraph, violin log = logging.getLogger(__name__) # Regex to grab version number from samtools stats contents VERSION_REGEX = r"# This file was produced by samtools st...
f80aad6c184b17173b9e29f9770b617a157b3c7cc2bf7c95e04172f87185cf54
Python
12,561
387
""" Unified database schema management for Ethopy analysis. This module provides a simple, unified interface for database connections and schema access with automatic caching and configuration management. """ import datajoint as dj import os import logging from typing import Dict, Any, Optional logger = logging.getL...
7fd8689be752170b5cdfc88ced9061a5413e38b0a169aa96238cd671f5523c5d
Python
12,595
266
from PySide6.QtWidgets import QWidget, QLabel, QHBoxLayout, QLineEdit, QSpacerItem, QGridLayout, QVBoxLayout,\ QPushButton, QColorDialog, QSpinBox from PySide6.QtCore import Qt, QSize, Signal from PySide6.QtGui import QIcon, QPixmap, QColor import os import collections import logging from gui.UtilsWidgets.CustomQGr...
57d2535d7a62bcf6b933849136fce2aa12024c2e04b84d86042ffba4522fd880
Python
12,597
369
"""Utilities for file input and output.""" from operator import itemgetter from pathlib import Path import numpy import openmm import pandas from openmm import System, app package_data_directory = Path(Path(__file__).parent.absolute(), "data") def copy_internal_coords(ra, rb, rc, rd, ta, tb, tc): """ Given...
d5bb99c1f1abd35c1af726bf9b2918fb79979b321c9bc5e097704e6f40c12b98
Python
12,606
373
# 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 systems to OpenMM-based alchemical Protocols. """ import logging import warnings from typing import Optional, Tuple import numpy as np import ...
86d66a69a236c62b17632f941c68d635f37778357877a0a08b887c7ce3c4007b
Python
12,610
308
import unittest from math import pi import numpy as np import pytest from shapely import affinity from shapely.geometry import Point from shapely.wkt import loads as load_wkt class AffineTestCase(unittest.TestCase): def test_affine_params(self): g = load_wkt("LINESTRING(2.4 4.1, 2.4 3, 3 3)") w...
2994f2660683508465fecbdb43dc55f9ea33109f3c688d6334d4d4e38639c4d4
Python
12,619
359
import logging import re from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import bargraph, linegraph log = logging.getLogger(__name__) VERSION_REGEX = r"SnpEff_version , SnpEff ([\d\.a-z]+)" class MultiqcModule(BaseMultiqcModule): """ MultiQC parses the summary `.c...
7ed62f83f8f1b61877969ea8bbd27212fbeee45a898fb7d2c3d119601ffefbc0
Python
12,624
321
import csv import logging from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import table log = logging.getLogger(__name__) class MultiqcModule(BaseMultiqcModule): def __init__(self): super().__init__( name="Nextclade", anchor="nextclade", ...
d1f93169a0ff7a6d639b783d7b735273ca8609b9f9050510ce9fe82d18d14332
Python
12,633
343
'''Warning - this script loads a bunch of motion data points and therefore takes a while to run e.g. over night''' import numpy as np import matplotlib.pyplot as plt plt.style.use('ggplot') import glob import os from statsmodels.stats.multitest import multipletests from motion_estimates import CalcMotionMetricsforScan ...
e3ff5044d94d66962c6858d5cb0e82b399a1e5a44194b1d8f9c341c1202336f6
Python
12,636
399
# -*- 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 Licens...
8426e9b4f45d7e775d3821ba3a7d19c2b87e8890358f73cd4feadf76c6ae737e
Python
12,647
287
from __future__ import annotations from torch import nn import numpy as np import torch.distributions as dist import torchvision.transforms.v2 as v2 from torch.distributions.normal import Normal from torch.distributions.independent import Independent import networkx as nx import beyond_backprop.algorithms.common.layer...
4cc4b3d586c0a140b35d2ec55f30046690d80e8a04451aee50f88dc462db75c0
Python
12,648
392
import math import re import abc import random from pydantic import BaseModel, model_validator from typing import Dict, List, Tuple, TypeVar, Generic from loguru import logger from truesight.external.data_models import LLMResponse from truesight.db.models import DbEvaluationQuestion, DbResponse class BaseCfg(BaseMo...
17179a31548a416498609d916e9b12e75ed73c6e5cf12181bea09d4c4a371212
Python
12,658
302
import json import logging import os from multiqc import config from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import bargraph, table log = logging.getLogger(__name__) class MultiqcModule(BaseMultiqcModule): """ This module parses the report generated by Bustools ...
1571b9e62bfaf5569d2d1932ea59007037f49321dee5996f11156ab6730df4cc
Python
12,672
379
from experiments.em_numbers import gsm8k_cot_refs, plot from experiments.em_numbers.manual_ops.create_gsm8k_cot_dataset import is_correct from refs import evaluation_refs from refs.experiments import gsm8k_cot_refs_v2 from truesight import display_utils, parse_utils from truesight.db.session import gs import pandas as ...
ec9932d878b33c2401a04ccaddab4f9d2c7c785772beaaf97f4256e41c86988c
Python
12,673
245
import numpy as np import pandas as pd import glob, os, argparse, warnings warnings.filterwarnings('ignore') from datetime import datetime from utils import * ############################## THIS SCRIPT PREPARES THE TRUST DATA FOR ANALYSES ON TREATMENT OUTCOMES AND TCC ############################## ##################...
73be3217f04f4f7fbdcc5f62d95a70b934a69bf63b094c2d7ab2a661856cb0ce
Python
12,694
322
""" Dev script to generate some result jsons that are used for testing Generates - ABFEProtocol_json_results.gz - used in abfe_results_json fixture - SepTopProtocol_json_results.gy - used in septop_json fixture - AHFEProtocol_json_results.gz - used in afe_solvation_json fixture - RHFEProtocol_json_results.gz -...
e7f2f4d8990b1298c69eec9f1106c47dc5dab915a7c65083e9d1cb9904e7eef9
Python
12,705
387
"#!/usr/bin/env python3" # -*- coding: utf-8 -*- """ HYPERPARAMETER TUNING FOR ENCODING - AVERAGE FEATURES BEFORE PCA - UNREAL ENGINE This script tunes the hyperparameter alpha (<=> lambda) for ridge regression. To do this, the alpha parameter are added to the data matrix X (data augmentation trick), which creates a...
5ddde0cf0d384d5a20e16486a9678841a08df899f63470032b3e5588273578a6
Python
12,707
321
# -*- coding: utf-8 -*- """ .. module:: skimpy :platform: Unix, Windows :synopsis: Simple Kinetic Models in Python .. moduleauthor:: SKiMPy team [---------] Copyright 2022 Laboratory of Computational Systems Biotechnology (LCSB), Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland Licensed under the ...
dd2e4d80b852387f68ce654457cbcf7a286dc3a4098b4ef02c4a96927d0a74da
Python
12,708
447
# 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 SepTop Protocols using OpenMM + OpenMMTools This module implements the necessary settings necessary to run SepTop RBFE calculations using OpenMM. See Also...
d76a6b4247adc0b81f028f5ebbd476aac3a1df4022c2adfde92080cb507a9d00
Python
12,709
379
# 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 SepTop Protocols using OpenMM + OpenMMTools This module implements the necessary settings necessary to run SepTop RBFE calculations using OpenMM. See Also...
e44b04d9a9148052b0c667de29e323ebe6d0baa568a37c91325dbee4521bc535
Python
12,709
400
"""Graphical user interface when an experiment starts.""" import os from typing import Union import pygame import pygame_menu class PyWelcome: def __init__(self, logger) -> None: self.logger = logger self.SCREEN_WIDTH = 800 self.SCREEN_HEIGHT = 480 if not pygame.get_init(): ...
cf2f72b856a7b96ff40581c88583a4a99ba3067e1a582a8dd5da0a4484b658e7
Python
12,719
382
"""Analysis routines for optimizations.""" from typing import TYPE_CHECKING import numpy from openff.toolkit import Molecule, Quantity from yammbs._base.array import Array from yammbs._base.base import ImmutableModel if TYPE_CHECKING: from pandas import DataFrame class DDE(ImmutableModel): """A model cont...
c1433cef25ecf3fe077790495137bb6ca1de62fe7a4564b39e6f32e4f51c2b1a
Python
12,725
406
""" Configuration management for Ethopy analysis. This module handles loading and managing configuration from various sources including JSON files, environment variables, and default settings. """ import copy import json import os import logging from pathlib import Path from typing import Dict, Any, Optional, Tuple, ...
df7f3d9360d37943b37c84297d868baa287e192b61d66b0ef4ed93e3d62ec105
Python
12,729
383
import numpy as np import skimage.io from scipy.ndimage import zoom from skimage.transform import resize try: # Python3 will most likely not be able to load protobuf from caffe.proto import caffe_pb2 except: import sys if sys.version_info >= (3, 0): print("Failed to include caffe_pb2, things mi...
468b7bba709d74da451a9f010c86bed004209a3a00d5950eb8bc971dba9527fd
Python
12,738
291
import logging import os from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import linegraph log = logging.getLogger(__name__) class MultiqcModule(BaseMultiqcModule): """ This module parses the base `misincorporation` output. """ def __init__(self): s...
be1042210c91050f2f062045e26aecd99bbe1a25350136633f2a268d94209b46
Python
12,741
298
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2018 David Emms # # This program (OrthoFinder) is distributed under the terms of the GNU General Public License v3 # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publish...
0e7aec9e1055fec7357206392ffab0a539d5b0ce2f1467e87b3a8e0c88fcb254
Python
12,744
287
from .utils import json_decode_int, json_decode_float, is_nan, summarize_batch_names, find_entry small_value = 0.00000001 def get_cell_count(c2s_run_data): """ Get the cell count for each well in the run""" result = {} for run_name in c2s_run_data: run_data = c2s_run_data[run_name] fo...
3543be3dc2cb657743f8afffe554da362d7abb105fa7175394fc51f5f5283fbd
Python
12,764
402
""" Visualization Module Specialized plotting and visualization methods for single-cell analysis. """ from pathlib import Path import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns class DataVisualizer: """ Visualizer for single-cell analysis plots. Provides meth...
55e3ec417d876049d39eda74e48108076ac145be2b2999834eeae53500e85b1e
Python
12,765
227
import argparse import os import torch from exp.exp_long_term_forecasting import Exp_Long_Term_Forecast from exp.exp_imputation import Exp_Imputation from exp.exp_short_term_forecasting import Exp_Short_Term_Forecast from exp.exp_anomaly_detection import Exp_Anomaly_Detection from exp.exp_classification import Exp_Clas...
725f194d0f52133905cd5bb9f29016d44425666ad23300c0790290c9973e5e46
Python
12,765
316
""" meta/knowledge_store.py — Meta-Knowledge Store =============================================== Stores fingerprint–performance mappings for all datasets in the knowledge base. Supports add, query, save (JSON + npy), and load operations. """ from __future__ import annotations import json from pathlib import Path fr...
26e52b6db3dcc8593537b42868ffe7ac4a1a85209a9ef6d0b51532db6596eed7
Python
12,783
286
import logging import re from html import escape 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 the log file generated by [Po...
96feda18abf6afed03758202edffadc0066e4f8ba1005e1f307412634900c11b
Python
12,785
351
#!/usr/bin/env python3 """ Analysis: Static Fingerprint Dimension Redundancy Check (TASK-12) ================================================================= Checks whether any of the 10 static fingerprint dimensions are redundant (highly correlated or high VIF), which would justify using a lower-dimensional subset fo...
2c34d7d86cd70e2f7fb79bc80bfe77e83fee21572dff7bb700d76f6f30a80730
Python
12,791
276
# coding=gbk import os import gc import copy import torch import random import logging import nilearn import argparse import numpy as np import pandas as pd from torch import nn from PIL import Image from tqdm import tqdm from scipy import io, stats import cn_clip.clip as clip from einops import rearran...
fe99959e8cfc1dfbfaa7b75bb2b24f3a136f8d414c310be4452bfacfe1b219a6
Python
12,820
269
from typing import * from collections import defaultdict import logging import velocyto as vcy class TransciptsIndex: __slots__ = ["transcipt_models", "tidx", "maxtidx"] """Search help class used to find the transcipt models that a read is spanning/contained into""" def __init__(self, trascript_models: Li...
0811dbe183f0215863be567f4dd54878690a226d1093865474ee492d42c3ba66
Python
12,831
408
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ # ============================================================================= # ----------------------- DICOM to BIDS Conversion --------------------------- # # Authors: Theo Schaefer, Marco Badwal, Felix Deilmann, Alex Nitsch # Date: April 16 2021 # Contact: tschae...
c39645a4a93a6c0c67af00f6fc1ac5e44542eefcf3d0bdcb322f52c6b6dcffcc
Python
12,836
343
from __future__ import absolute_import, division, unicode_literals # pylint:disable=protected-access from pip._vendor.six import text_type import re from copy import copy from . import base from .. import _ihatexml from .. import constants from ..constants import namespaces from .._utils import moduleFactoryFactory...
f7c7220f7e5734d1b0a5c31d9007ffad9164b1bf38119e0f9bf5ce2dd5000c40
Python
12,843
376
##### # # Copyright 2018 Chris Rorden # # 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 agreed to in ...
9ef760c426b51f6a345d0c750dd0dae04b8ad8b308d5b79b1d10c500c59080bf
Python
12,846
341
import math import torch import torch.nn as nn def get_timestep_embedding(timesteps, embedding_dim): """ This matches the implementation in Denoising Diffusion Probabilistic Models: From Fairseq. Build sinusoidal embeddings. This matches the implementation in tensor2tensor, but differs slightly ...
9d46c7ef1e1054fc3f8cce42ba9ca8657d0730d693252c22da9571418e686626
Python
12,848
332
########################################### # makes a mat file for spm level1design # - first GLM for the split case # - with or without wbf ########################################### import argparse from scipy.io import savemat import numpy as np from numpy.core.records import fromarrays import os import nibabel as ...
804e3120e40d18b3fbed24f5cee7d8ad3f37d5dd9fd9a514a7b53172c8a1de2a
Python
12,853
296
import numpy as np import functools import itertools import nrrd from scipy.stats import beta # pylint:disable=import-error from bsb import config from bsb.config.refs import partition_ref from bsb.connectivity.strategy import ConnectionStrategy from nemsi.visual import add_to_plotter, update_plotted_entity from nems...