sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
54001559126618150949924983032c0708d7b1c8a7e7172899d65a9a78045b82
Python
3,692
104
# 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...
7e8bcde8b462ff0674ffec812ef127a8b078203bae2c4a603e9e0ea68c1b45bf
Python
3,692
120
# -*- coding: utf-8 -*- """ESMFold2_Embeddings.ipynb Automatically generated by Colab. Original file is located at https://colab.research.google.com/drive/1IuZeaW8-8F0mMpLPWhkvuAn6XOeupMQs """ !pip install git+https://github.com/facebookresearch/esm.git !curl -O https://dl.fbaipublicfiles.com/fair-esm/examples/P...
5a60f6526d1de8264622fea08c5ebbe8dc743060dcbb61c88b6b8acb1a9f32a2
Python
3,694
107
#!/usr/bin/env python3 """ LLPhyScore出力からsum scoreだけ抽出 入力: llphyscore_*.txt (種ごと) 出力: llphyscore_summary.tsv (1ファイルに統合) 使い方: python3 extract_llphyscore.py /Users/kyotayasuda/rbp_pfam/output/ """ import sys import os import re def extract_scores(filepath, species): """LLPhyScore出力ファイルからprotein IDとsum scoreを抽出"...
e04f65efc6638076bd39b7ecab7b96f3fc903a3e27eedf0a229e422b80d85e63
Python
3,697
85
""" src/methods — Clinical Methods Layer ========================================= 21 clinical methods for missingness-robust EHR classification. Methods ------- Baselines (2): - mean_lr : Mean Imputation + Logistic Regression (naive benchmark) - mean_xgb : Mean Imputation + XGBoost (imputation ablation anchor) ...
f2296fc9c051f82cea97c3b3fa631d2a2e34c856aa2724e5dae1d2e5e06fea62
Python
3,699
138
import pytest from pytest import WarningsRecorder from shapely.decorators import deprecate_positional @deprecate_positional(["b", "c"]) def func_two(a, b=2, c=3): return a, b, c @deprecate_positional(["b", "c", "d"]) def func_three(a, b=1, c=2, d=3): return a, b, c, d @deprecate_positional(["b", "d"]) de...
01917af9a83a6069ee932cf33ddad8bff7890580675f21366fd6ce1fa3dfcabc
Python
3,702
97
#!/usr/bin/env python """ Example script to register two volumes with VoxelMorph models. Please make sure to use trained models appropriately. Let's say we have a model trained to register a scan (moving) to an atlas (fixed). To register a scan to the atlas and save the warp field, run: register.py --moving mov...
91ca8e1e3d183dd1b2043d3babe411e3672126d486648fddcdc553163febdad2
Python
3,703
87
from multiqc import report from multiqc.modules.fgumi.tests.conftest import general_stats from multiqc.modules.fgumi.umis import summarize_observations UMI_COUNTS = ( "umi\traw_observations\traw_observations_with_errors\tunique_observations\tfraction_raw_observations" "\tfraction_unique_observations\n" "AA...
c2fb73a3f91bc2e39276b84d72886b2674e1e6c49320dc4d36d24a43a5d38c85
Python
3,706
100
"""MultiQC submodule to parse output from deepTools plotEnrichment""" import logging from multiqc.plots import linegraph # Initialise the logger log = logging.getLogger(__name__) class PlotEnrichmentMixin: def parse_plot_enrichment(self): """Find plotEnrichment output.""" self.deeptools_plotEnr...
0d6a8f39bd2dc02f13d981c6a246961d59365b54ae544365e54f0662d5ea8d45
Python
3,709
115
""" engine/model_cache.py — Hash-Based Model Checkpoint Cache ========================================================== Avoids re-training identical model+config combinations by caching the best model state_dict on disk. Lookup is based on a hash of the full ``ExperimentConfig`` dict. Design ------ - One ``.pt`` fil...
fc7ffae352b2e672ca2e65c9529d7bad8ba41ca6412d373029188078aff0b38b
Python
3,709
102
"""Pipeline stage 1: convert raw ADNI PET (DICOM or ECAT) to NIfTI. This is the very first preprocessing step. Source data was pulled from ADNI with the following search criteria: * Modality = PET * Radiopharmaceutical = "18F-AV45" (amyloid PET) The downloaded archive is organised as:: PET_ADNI/ <subject_...
14ea04e65c5c9e85bb71c3a60388dbe7dbe4423b04eb50fd2df715047aa0248d
Python
3,712
97
import argparse import glob import os import re import shutil import subprocess as sp from contextlib import contextmanager from tempfile import TemporaryDirectory # YAML imports try: import yaml # PyYAML loader = yaml.load except ImportError: try: import ruamel_yaml as yaml # Ruamel YAML ex...
2987a260fec5ebce0afecb00cc957f43c85e1a7c30bc016a3d26056381c39fdd
Python
3,716
87
""" # File : Generation.py # Description: """ from Generation.pred_spec import Generator from TemplateSearch.QueryDB import QueryTemplates from Model.Configs.config import Config_databse import numpy as np import pandas as pd import faiss def get_meta(meta_dict, key): for k, v in meta_dict.items(): ...
aa7efdd47f35607f227f1e92de1b4c7516048aebaa1a86b56e31915cf3173b56
Python
3,716
114
# -*- 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 ...
1074c8e0a625dd1025cccd8ef41b997d12efda4c739eeb49b4658cb9b25897c8
Python
3,723
108
import unittest import numpy as np import pytest from shapely.geometry import MultiPolygon, Point, box @pytest.mark.filterwarnings("ignore:The 'shapely.vectorized:") class VectorizedContainsTestCase(unittest.TestCase): def assertContainsResults(self, geom, x, y): from shapely.vectorized import contains ...
7e80e2917d0a05871f05a99fd06e5459c26cb400db36b441eeafd363b4e845d7
Python
3,724
104
""" Evaluation module for the GO Annotation agent. This module implements evaluations for the GO Annotation agent using the pydantic-ai-evals framework. """ import asyncio import sys from typing import Optional, Any, Dict, Callable, Awaitable from aurelian.evaluators.model import MetadataDict, metadata from aurelian....
ee2706e93cc2af5bcd8243078eeebad8871e4503ac12de572e48a99f26f11e5c
Python
3,726
95
""" Agent for working with bibliographies and citation data. """ from pydantic_ai import Agent, RunContext from .biblio_config import BiblioDependencies from .biblio_tools import search_bibliography, lookup_pmid, search_web, retrieve_web_page biblio_agent = Agent( model="openai:gpt-4o", deps_type=BiblioDepen...
0e721cb5ff7c2374871e323ecf5daaecaa9e60fdf489bfeb599c6ecc6ae161ba
Python
3,731
123
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import MDAnalysis as mda import numpy as np import pytest from openfe.protocols.restraint_utils.geometry.boresch.guest import ( _bonded_angles_from_pool, _get_guest_atom_pool, _so...
28dfe18da3d6b9c172ddf13311f47ee8822e906438e4210c3d51b1eb9298ea77
Python
3,731
101
# -*- 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 Licensed under the ...
a52015895fdef6062d34af1da4eeb77c7a6d5bbe153fc191f85cd6b6a3c93e8e
Python
3,733
113
"""Tests for the upsampling layers""" import numpy as np from tensorflow.keras import backend as K from keras import keras_parameterized from deepcell import layers @keras_parameterized.run_all_keras_modes class TestUpsampleLike(keras_parameterized.TestCase): def test_simple(self): # channels_last ...
aecfcc629bc5f76991365c0afb7b5886e7dbf576eba7631ab095fb894f32e7d7
Python
3,733
141
# Ensure QCPortal is imported before any OpenEye modules, see # https://github.com/conda-forge/qcfractal-feedstock/issues/43 try: import qcportal except ImportError: qcportal = None import multiprocessing import os import shutil import pytest from openff.interchange._tests import MoleculeWithConformer from op...
e4b532865c62d52fa8bd6645dea6499a86b1311039840dc1dc96020413f6bbaa
Python
3,736
107
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import pytest from rdkit import Chem from rdkit.Chem import AllChem import openfe from gufe import SmallMoleculeComponent from openfe.setup.atom_mapping import LomapAtomMapper from .conftes...
0332fbfcf7b635569c9eb27741346b5135077bb438d862ba52fbd6ec263ad166
Python
3,738
96
import argparse import itertools import numpy as np import os import pickle from analyses.decoding.ridge_regression_decoding import RIDGE_DECODER_OUT_DIR, TESTING_MODE from data import get_fmri_voxel_data from eval import calc_rsa, calc_rsa_images, calc_rsa_captions, create_dissimilarity_matrix, rsa_from_matrices fr...
b157f037d743498418b1cad3a831f0e88315552ea079c5d3d8c27f2638cba470
Python
3,738
112
import json import logging from pathlib import Path from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import bargraph log = logging.getLogger(__name__) class MultiqcModule(BaseMultiqcModule): """ The module recognizes files with the `*_gopeaks.json` suffix (which is ...
316ca2ca89fee845677c8e15c600c6ada00f3eccf0a48f07069104679bc5add6
Python
3,740
136
import numpy as np import pytest from numpy.testing import assert_allclose, assert_equal from openff.nagl.features.atoms import ( AtomAverageFormalCharge, AtomConnectivity, AtomFormalCharge, AtomHybridization, AtomicElement, AtomInRingOfSize, AtomIsAromatic, AtomIsInRing, ) from openff....
38f30d54922ad835e085639d35b49b14b2ad905f32477f162b61407d485b386a
Python
3,748
122
#!/usr/bin/env python __author__ = 'Pavel Polishchuk' import rdkit from rdkit import Chem import argparse import sys def read_pdbqt(fname, sanitize, removeHs): mols = [] with open(fname) as f: pdb_block = f.read().split('MODEL ') for j, block in enumerate(pdb_block[1:]): m = Che...
e3be8fd7460e964e12147ed2e206b255d8283e14c6e2d83eef9bdf3b77307ed6
Python
3,750
96
import logging import re from multiqc import config from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound log = logging.getLogger(__name__) class MultiqcModule(BaseMultiqcModule): def __init__(self): super().__init__( name="leeHom", anchor="leehom", ...
2f72b2d00bdfc6750e6f3885cbccfedd0a7200c855b8a708e0d804d7015b449a
Python
3,752
104
###################### Libraries ###################### import numpy as np # Deep Learning import tensorflow as tf from keras import backend as K import warnings warnings.filterwarnings('ignore') from tensorflow.keras.layers import * import tensorflow.keras.backend as K ###################### Loss Functions #####...
a494c1f6f42ca3cb0bdbec7207815d3dc7eaca27c0836a1a287983493ecbdec7
Python
3,754
109
import os import argparse import numpy as np import nibabel as nib def compute_skewness(x): x = x[np.isfinite(x)] # Optional: remove NaNs or infs mean = np.mean(x) std = np.std(x) skew = np.mean(((x - mean) / std)**3) return skew def compute_kurtosis(x): x = x[np.isfinite(x)] mean = np.me...
c20ef3806b019ba44dfae08db640ba71560a2a692ce66a291425aef49599c578
Python
3,754
94
import pickle import numpy as np import pandas as pd from tqdm import tqdm def cellRecordsPreprocessing(file_path, experiments_start_triggers): # Open the file in binary mode with open('./'+file_path, 'rb') as file: loaded_data = pickle.load(file) print("Loaded Data Dictionary Keys:", loaded_dat...
86ccfefd950a72a3e11a24898c87b023cc3f4f4f9b07d800ae1cef064596195a
Python
3,761
117
from __future__ import division from __future__ import print_function from future import standard_library standard_library.install_aliases() from builtins import range from past.utils import old_div import os, sys, glob, subprocess import numpy as np from scipy import loadtxt from matplotlib import pyplot def get_mm...
5be387aef4efa8c59dcebee1d8dc986d871327420ae726257eb082de1612381f
Python
3,771
85
from openmmtools import states from openmmtools.states import GlobalParameterState class SepTopParameterState(GlobalParameterState): """ Composable state to control lambda parameters for two ligands. See :class:`openmmtools.states.GlobalParameterState` for more details. Parameters ---------- p...
8c12bdec14b06e1499db92dbf7db07fd45654859e42a699748333943ff5ffa5c
Python
3,771
108
import os import pickle import pandas as pd from PIL import Image from torch.utils.data import DataLoader, Dataset from tqdm import tqdm from utils import COCO_IMAGES_DIR, STIM_INFO_PATH, LATENT_FEATURES_DIR, \ model_features_file_path class CoCoDataset(Dataset): r""" Pytorch dataset that loads the pres...
ef2fcf874c8d4aeb29f0e4d644d320d14c88e6365f34520a7cc132bb854b9bcc
Python
3,785
116
import pytest from copy import copy import uvicorn from alchemiscale.settings import get_base_api_settings from alchemiscale.base.api import get_s3os_depends from alchemiscale.compute import api, client from alchemiscale.tests.integration.compute.utils import get_compute_settings_override from alchemiscale.tests.int...
8d19907e85f9169953f86574ad4a427de69316b0f27d912b65b840d0bfe5af67
Python
3,789
130
#!/usr/bin/env python3 """ Batch evaluation of spatial correlations between subject-specific and normative MPmoments. Automatically detects all subject MPmoments files in a directory and computes spatial Pearson correlations for matching moment rows. Expected filename pattern: sub-XXX_space-fsaverage5_desc-MPmom...
8ec99d4cc9f4b30e98d28de9dadb928fbc1ceffa5904f38325796a635e21dcaa
Python
3,789
106
import pandas as pd from sklearn.metrics.pairwise import cosine_similarity import scanpy as sc from sklearn.preprocessing import MinMaxScaler from scipy.sparse import csr_matrix import numpy as np def calc_marker_gene_score(adata, target_cluster, n_genes, p_val_threshold, cluster_column, use_raw=True, n_hvg=2000): ...
061e3277a12ae1b2a961036ae32b7d1df4137cd9e13724f500502a516f2a5e2e
Python
3,791
94
# -*- coding: utf-8 -*- import sys import gzip import string import os.path import glob count = 0 class FastaWriter(object): def __init__(self, sourceFastaFilename, qUseOnlySecondPart=False, qGlob=False, qFirstWord=False, qWholeLine=False): self.SeqLists = dict() qFirst = True accession = ...
548dbf8a4d48bdac840f11c17265656d085056b597db236d2d7af4cb7fd4998c
Python
3,791
105
"""MultiQC submodule to parse output from Picard OxoGMetrics""" import logging from collections import defaultdict from typing import Dict from multiqc.modules.picard import util # Initialise the logger log = logging.getLogger(__name__) def parse_reports(module): """Find Picard OxoGMetrics reports and parse th...
65974003bf5a3bf7e931c7155ada55637e75ff3f7af65c394375090ecb12a44e
Python
3,791
88
# 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...
8200732aa7c164f9b70462932451b9450c68f13db0f6761b8bcd2a66d66f23c3
Python
3,791
117
from dataclasses import dataclass, field from typing import Callable import numpy as np from pathlib import Path from loguru import logger from sl.datasets.nums_dataset import PromptGenerator from sl.datasets.data_models import DatasetRow from sl.llm.data_models import SampleCfg from sl.llm import services as llm_servi...
21d0a67ac246bdcf9c2942bd3d9eb898a44f98be39c107787b0679dbfecae1d0
Python
3,794
115
import h5py import numpy as np import pickle import zlib import os from typing import * def _obj2uint(obj: object, compression: int=9, protocol: int=2) -> np.ndarray: """Transform a python object in a numpy array of uint8 Arguments --------- obj: object The object to encode compressio...
9191331bebde6fcef9eadefc696228da2605b099ad9875bc86a5a43710975bd7
Python
3,794
98
import pytest from shapely import Point, Polygon, geos_version def test_format_invalid(): # check invalid spec formats pt = Point(1, 2) test_list = [ ("5G", ValueError, "invalid format specifier"), (".f", ValueError, "invalid format specifier"), ("0.2e", ValueError, "invalid forma...
50e250a21fd6c77371302dd5549d58deb276349ac440643d78017d9b04b17a4d
Python
3,795
97
from sklearn.datasets import load_breast_cancer from sklearn.metrics import accuracy_score, roc_auc_score from sklearn.model_selection import train_test_split from tabpfn import TabPFNClassifier import pathlib import os import pandas as pd import numpy as np import torch import torchvision.transforms as transf...
0e824a0423fb5c1f0750102273fc322aa5ff81644ae25c53ee9eb1ecaa399ef5
Python
3,796
126
"""Plugin base classes and basic instances thereof. Also discovers and loads KIMMDY plugins. """ from __future__ import annotations import logging import sys from abc import ABC, abstractmethod from typing import TYPE_CHECKING, Optional if TYPE_CHECKING: from kimmdy.config import Config from kimmdy.recipe i...
276d46396072676046aca6a3a0a5094d706fcdff2cd61acf1feb7085381ca041
Python
3,800
88
# This script plots the decoding performance when randomly dropping X channels. import argparse import os import numpy as np import pickle as pkl from datetime import datetime import matplotlib.pyplot as plt ''' Example cmd (when run from this directory; provide python script path appropriately if run from different ...
b9885dcdb7943604093773047745c1e6de85b074efd7cb3497e4b71eb378a535
Python
3,805
103
#!/usr/bin/env python # -*- coding: utf-8 -*- import os, re from os import path import argparse, textwrap from mripy import utils, io def parse_fname(fname, pattern='hemi', trailing_exts=['.gz'], compound_exts=['.gz']): ''' {dir}/{hemi}.{stem}{ext} {dir}/{stem}{view}{ext} ''' res = dict() res[...
c0d45c20b13f9677527503743d316c08327a51c32ecd5edff0070aad06fe66d9
Python
3,809
113
import pandas as pd import numpy as np import nrrd import pickle from nemsi.visual import PlotterWindow from nemsi.spatial import Mesh def align_bounding_boxes(source, target): source_barycenter = (np.min(source, axis=0) + np.max(source, axis=0)) / 2 target_barycenter = (np.min(target, axis=0) + np.max(target...
db11a6e97b41011a1f115bcbb47025d53b9f6ab889b0bd683e727421375414b2
Python
3,810
116
import logging from typing import Dict, List import requests from utils.translator_utils import ( ENDPOINT_URL, PREFIXES, build_sparql_query, get_normalized_curies, run_query, uri_to_curie, ) logging.basicConfig(level=logging.WARNING) logger = logging.getLogger(__name__) logger.setLevel(loggin...
53fc95ca7d18ee02bbf47e20554811d18383f55f2c695d862e6d39c151944e50
Python
3,811
98
# code to create a version of the Juelich atlas for each subject in their own native T1w space. By using NN interpolation we can retain the original label values. # file to run from within the nipype environment with ANTS enabled; from the MPI cbs system this is a mess - getserver -sL / ANTSENV / # conda activate nipy...
2dc4aa0d090cf6fa16fa14fcc3872cbb01d208b111c44e05d1d581ec4b3bf1a1
Python
3,813
80
#!/usr/bin/env python3 __author__ = 'Pavel Polishchuk' import argparse from functools import partial import sys from read_input import read_input from rdkit import Chem from rdkit.Chem.EnumerateStereoisomers import EnumerateStereoisomers, StereoEnumerationOptions from multiprocessing import Pool, cpu_count def enum...
63a1db138432864176b5e9bec5b2665db3aa3d0dc0f9ba5f09a72bc31470efa0
Python
3,813
85
import sys, os def make_log_useful(log_path, status, config, config_definitions): # Snakemake v9 passes log as a list if isinstance(log_path, list): log_path = log_path[0] logs_processed_dir = "/".join(log_path.split("/")[:-1]) + "/processed_logs_for_mail/" os.makedirs(logs_processed_dir, exis...
117fe877a2a6189b36f01c696e07e71ebdc5ab358ab2ab5539568b34cb0a4367
Python
3,815
128
from gufe.protocols import ProtocolDAGResult from gufe.tokenization import ( GufeTokenizable, TOKENIZABLE_REGISTRY, get_all_gufe_objs, is_gufe_obj, modify_dependencies, ) from itertools import chain import networkx as nx import zstandard as zstd from .compression import decompress_gufe_zstd, json_t...
6a4bc81375efdbe75c076a600e19ec469617e648cd8e9f2abf4fbfa5eb71e9f2
Python
3,815
128
# -*- coding: utf-8 -*- """ Created on Wed Mar 22 11:16:24 2023 @author: ashwin.bhandiwad """ import os, re import numpy as np import pandas as pd from anytree import Node,RenderTree import SimpleITK as sitk def db_to_tree(swc_db): names=swc_db[:,0].astype(int) assert swc_db[0,-1]==-1 soma_coords = [swc...
0e620e76225827fdd76c3d310b4d7208db498f4858d57c8c4d06b379becc7401
Python
3,816
108
""" Copyright (C) 2025, 2026 Sotiris Lamprinidis 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/> for more details. """ import os impo...
c50aaf15cc230b49ccc26be69902aa4649098dae62a636616ad545dc47c0357a
Python
3,819
86
#!/usr/bin/env python3 __author__ = 'Pavel Polishchuk' import argparse from rdkit import Chem from rdkit.Chem import inchi from read_input import read_input def get_inchi_key(mol, stereo): inchi_key = inchi.MolToInchiKey(mol) if not stereo: q = inchi_key.split('-') inchi_key = q[0] + '-' + q...
27b011a1fcc90fcaf049996829ec5fc25076eea61e9984f554ab2da44e14a980
Python
3,826
84
import os os.environ["KMP_DUPLICATE_LIB_OK"]="TRUE" import gensim import numpy as np from TemplateSearch.Embedding import GenerateSpec2vec from MS2Tools.util import CalSpecVec import faiss from rdkit import Chem class QueryTemplates(object): def __init__(self, Embed_dict:dict=None, index_dict:dict=None, d_model=5...
1eb8da63691f27f6efeb53246f695b467092a0ea4c7b5f5d996c4ce2e8fbdb1d
Python
3,829
140
#!/usr/bin/env python3 """ ATAC-seq preprocessing command for Hi-Compass. """ import logging from pathlib import Path import json from ..preprocess import ATACPreprocessor logging.basicConfig( level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s' ) logger = logging.getLogger(__name__) def ...
9c7bf99fd4208ca3b19eba1d99090c08763fd387277eb91b6b6eddcf9c22c149
Python
3,829
100
from __future__ import print_function import argparse import itertools import regex import re import gzip import sys import collections from findCleavageSites import regexFromSequence, alignSequences, reverseComplement, extendedPattern, realignedSequences """ FASTQ generator function from umi package """ def fq(file)...
6f22cc0e0ba3fe8b155794389b5169fc8d667a0666dbc4f3577615a22e6a6b54
Python
3,831
152
""" MCP tools for interacting with GO KnowledgeBase via AmiGO solr endpoint. """ import os from typing import Dict, List from mcp.server.fastmcp import FastMCP from aurelian.agents.amigo.amigo_agent import SYSTEM import aurelian.agents.amigo.amigo_tools as at from aurelian.agents.amigo.amigo_config import AmiGODepend...
5515ef6997af5691a08ab86fbcc1e1620b59a6816976b76d924168ff2d86f6f0
Python
3,836
120
import os import numpy as np import helper as hp import multiprocessing as mp from configparser import ConfigParser from evostrat.init_mlp import MLP from evostrat.evolution_strategy import EvolutionStrategy from kinetics.jacobian_solver import check_jacobian # declare reward functions def reward_func(weights): ...
fcf6f0dea113708c0c5aa93437d884b148e17f8d72c4468d9c00cbd79ed4ad7e
Python
3,836
92
''' Script for evaluating image quality metrics on the challenge test submissions ''' import numpy as np import subprocess import os from Utils import RegisterNifti, Comp_Metrics # define directories etc: subm_dir = 'Submissions' # path to the folder containing subfolders for each # pa...
e3adbf7d4d3946eb78bbc3681972cae39d7ee6523571d10e1bb2de712e3687b7
Python
3,837
123
#! python # -*- coding: utf-8 -*- from typing import Dict, List, Optional, Union import pandas as pd from gseapy.base import GSEAbase from gseapy.gse import gsva_rs from gseapy.utils import mkdirs class GSVA(GSEAbase): """GSVA""" def __init__( self, data: Union[pd.DataFrame, pd.Series, str...
fc1b13fa14c98eff74257a6b84f0237fd887a12a1f88f88a5450c28da869bb6f
Python
3,837
114
"""Tests for the Logger class in ethopy.core.logger module. These tests verify the functionality of the Logger class while properly handling thread cleanup to avoid test hangs. """ import time from queue import PriorityQueue import pytest @pytest.mark.usefixtures("patch_imports") class TestLogger: """Test Logge...
1992d17873fa151467e3786f48ea060b161a984acacf2a7a460390c55782de48
Python
3,839
107
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
f045c98285f8432bbfcb86ff9e850df07b1ec5ccdaa274e73748c0e756d9d71d
Python
3,839
110
import os import numpy as np from PIL import Image from matplotlib import pyplot as plt from nibabel import GiftiImage from nibabel.gifti import GiftiDataArray from nibabel.nifti1 import intent_codes, data_type_codes ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) DATA_DIR = os.path.expanduser("~/data/multimod...
2edd778414aa76cf86422aa28b3120b671c893d73b9f60f135f39cbe018415e4
Python
3,840
69
import os def list_files(startpath): for root, dirs, files in os.walk(startpath): level = root.replace(startpath, '').count(os.sep) indent = ' ' * 4 * (level) print('{}{}/'.format(indent, os.path.basename(root))) subindent = ' ' * 4 * (level + 1) for f in files: ...
e423c8015210918c44b25b6e8c82ffad45e0be5d3419a6656e2c4c33adc9959a
Python
3,842
85
""" Offline Brain Area Analysis Script This script loads offline decoding predictions for different cortical area groupings, computes success rates, and compares them to online simulations. Usage (via CLI): python run_offline_brain_area_analysis.py --monkeys Monkey1 Monkey3 --experiments "Center-out" "Continuous ...
65923e70b062275d338d01bc1ac6dd3d9c1063b127a463080ec8e3e4fe171470
Python
3,844
112
import os import numpy as np import nrrd import math from sklearn.decomposition import PCA from scipy.spatial.transform import Rotation as R from scipy.spatial import distance from trimesh.convex import convex_hull # pylint:disable="import-error" from nemsi import Subtree from nemsi.visual import PlotterWindow from ne...
68208d241148a30bdeb4d569492306be677738f599708f4e56a9c2962e5f97be
Python
3,844
106
# !/usr/bin/env python # -*-coding:utf-8 -*- import torch class Vocabulary(object): def __init__(self, *, pad="<pad>", unk="<unk>", sep="<sep>", mask="<mask>", special_tokens=None, add_special_toke...
f7ca3408bfce3547cb2dbf4c3a99cac1c3e11e684ed3fff64c1ce64064788724
Python
3,844
129
# This code is part of cinnabar and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/cinnabar import math from typing import Iterable import numpy as np from numpy.typing import NDArray def _create_2d_histogram(y_true: Iterable[float], y_pred: Iterable[float]) -> tuple[NDArray...
c2c9d3595a63f78203235944558fd220d0518998dc58036963d99a354e96957e
Python
3,848
103
from sklearn.datasets import load_breast_cancer from sklearn.metrics import accuracy_score, roc_auc_score from sklearn.model_selection import train_test_split from tabpfn import TabPFNClassifier import pathlib import os import pandas as pd import numpy as np import torch import torchvision.transforms as transf...
05f086e8821ef31e5a0fea3769289c9462bcdcc20dfebbd3b0ba0319d4b544c1
Python
3,852
93
"""" Theo Gauvrit 05/06/2023 First test of Cebra library""" import os import cebra import json import numpy as np import pandas as pd import percephone.core.recording as pc import os import matplotlib import matplotlib.pyplot as plt from multiprocessing import Pool, cpu_count, pool plt.rcParams['font.size'] = 10 plt.r...
72279793a7ceb22fa905a9151b6ce4dd1513ed139de66e219aa20cd25b78ae62
Python
3,853
86
# !/usr/bin/env python # -*-coding:utf-8 -*- # @Time : 2023/04/26 11:37 # @Author : Liangdi.Ma import torch from transformers import BertConfig, BertModel, BertLMHeadModel path_dict = { "bert": "/GPUFS/gyfyy_jxhe_1/User/maliangdi/models/bert", "chinesebert": "/home/gaozebin/project/ddpm_clip/pre...
4ded904ff3b7545bddb6ef9dbdda06a55f201a5b20d342677e02e0286870156d
Python
3,856
92
from __future__ import division from __future__ import absolute_import from builtins import str from builtins import range import os import forcebalance import numpy from .__init__ import ForceBalanceTestCase class TargetTests(ForceBalanceTestCase): def setup_method(self, method): super(TargetTests, self)...
edff1dfede72dc28f244c1a018264fa35b975490198bc51f7cea3e9209805208
Python
3,859
133
"""Models used within YAMMBS.""" from typing import Any, TypeVar import qcelemental from openff.toolkit import Molecule from pydantic import ConfigDict, Field from yammbs._base.array import Array from yammbs._base.base import ImmutableModel hartree2kcalmol = qcelemental.constants.hartree2kcalmol bohr2angstroms = qc...
b2e2aa552abf3847e9fb185ce3a9972fdca73028237bbb1ec78a73ff6b405dc6
Python
3,860
95
import argparse import os import re import glob import shutil import subprocess as sp from tempfile import TemporaryDirectory from contextlib import contextmanager # YAML imports try: import yaml # PyYAML loader = yaml.load except ImportError: try: import ruamel_yaml as yaml # Ruamel YAML exce...
c3d86122abcb5d6a6d993a838e6428c4a1acc34a690554502cb3b825d67038a8
Python
3,862
105
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import numpy as np import pytest from numpy.testing import assert_equal from openff.interchange.components._packmol import UNIT_CUBE from openff.units import unit from pontibus.utils.settin...
150dc6a990b7e224d6252f999e1686d56c381fe713e5d8e466d0f4f148b3c3fd
Python
3,865
126
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....
21cfa3658df1a4c2231b4e36d42cf3d6a8f70cc1bfedf1a684b0591815fcf4ad
Python
3,865
126
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....
5d7485697a51b6d21fadbcf42e061f1ebdb475bd7bd011649d6d05cd64ef6100
Python
3,866
126
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....
b8a01c2f310d90aedc7bc23cce0e3cf93edac674972a196a0f6a47a1e1fdf452
Python
3,866
126
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....
22fd39523ec4409a8a5bc842fd6371ec01483660ec20794b663f58d15504700b
Python
3,867
126
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....
3f2b9a00e4778869072d7e501d768e59ca3940dfc43e32e6cbd7126fc1fd6d37
Python
3,867
126
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....
5b8ecbbe62ba481ba1769b3063f842136aa17daf132c1dee972b2952a50030b3
Python
3,867
126
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....
8410a027f44ec113024329dde782bc97395ad57a3987c43d3b0cebfa47083563
Python
3,867
126
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....
8f64097558d057cea3bf066d7482430a390cdd13f7f29465f7704242db9a42c3
Python
3,867
126
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....
e08e25ab09511dff472e4af82bebdf02730ed196da0cc48979515d8cb7ff97b4
Python
3,867
126
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....
e704ae78c247ba689c5debbd6150694d54bb021b067f4d7fe169e4cefb3a7a5f
Python
3,867
126
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....
fa3ca9d6f084b97b9cfcfe77f31e3ea790f248954763004c877c9b323ba0be89
Python
3,867
126
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....
802764f74189e6dbe15f8ad7c949b5229f824f623a66ca5871ae755358b323f8
Python
3,868
126
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....
99f738ba2c23ced6bbc90bc307fcbed9862ea51d302d7ce186ed2088583030c8
Python
3,868
126
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....
fa41e7aa37619a48a6cd68a0f39bc9bcebf31e808ca06e1a1e15005b825ba04f
Python
3,868
126
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....
70a8ee0600174f33298d94e2a5928223e8aefc3b3a2e62f9667b87351a85c071
Python
3,871
109
import functools from itertools import chain from wikidataintegrator.wdi_core import WDItemEngine from data_tools.df_processing import char_combine_iter, expand_col_on_char, add_curi def parse_result_uris(result): """Parse the result URI to get just the WikiData identifier""" for c in result: if 'Labe...
7b103cf7a98d4199e79550500fe451f6376be47d92814a68db47e54d3b2b4435
Python
3,874
102
""" components/datasets/mock_dataset.py — Mock Dataset for Framework Smoke Testing ============================================================================== Generates synthetic data in the correct Batch format. Use this to verify that the framework pipeline runs end-to-end without requiring real patient data. Reg...
350b2fd85d05ee532cb8ad566b149be1bd3800211693c66ca506fff9761ad90d
Python
3,877
97
from bio_embeddings.embed import ProtTransBertBFDEmbedder import pandas as pd import pickle import time import os import lmdb import hashlib import numpy as np from tqdm import tqdm # start_time = time.time() # Application Execution df_human_prot_fasta = pd.read_csv("pro_id_seq_human.csv") print(df_human_prot_fasta.co...
b1bfd7d6197adaddc0c270d67345629ce955da842d88e05361c26652c1b46cd6
Python
3,877
98
"""MOP molecular process recognition evaluation cases from CRAFT corpus.""" from typing import Any, Dict from aurelian.evaluators.model import MetadataDict, metadata from aurelian.evaluators.knowledge_agent_evaluator import SimpleEntityEvaluator from pydantic_evals import Case, Dataset class MopMetadata(Dict[str, An...
d110ac05cc8ebfb8f19025895f4728d1159723a99afc8aa69b751e1c5ffcac0c
Python
3,881
97
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import, unicode_literals import subprocess, os import numpy as np from collections import OrderedDict from . import six, afni, io, utils def afni_costs(base_file, in_file, mask=None): ''' In general, the al...
7c251508512c20b095e8fa9052064084d2911e755eec1ca9c10334158b920846
Python
3,884
106
#!/usr/bin/env python # # MIT License # # Copyright (c) 2018 Volker Hovestadt # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # ...
14aff13d1247cc38d5662fcea2e7b444840f45988e130b9e5cdc07029be436f9
Python
3,885
129
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....
2e85695449b7bc03306212802957a8f0ae1f5f6c59ef95dd541cc8b809511ff3
Python
3,885
129
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....
7956e7e69f9538402c7676477b4c1c5e414396f32bf991d3455de249e69fbf7d
Python
3,885
129
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....