sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
47ff832778a5b641cb2e41ad42d9930ca8012035181fb35867a3bda707019df1
Python
924
30
# 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,...
d88849a3ece3013be28c6b61f74f3632f06d6bb646ebf1c0ec17aae36fb87877
Python
924
33
import matplotlib.pyplot as plt from shapely.geometry import MultiPoint, LineString from shapely.plotting import plot_polygon, plot_line, plot_points from figures import DARKGRAY, GRAY, BLUE, SIZE, set_limits fig = plt.figure(1, figsize=SIZE, dpi=90) # 1 ax = fig.add_subplot(121) mp = MultiPoint([(0, 0), (0.5, 1.5)...
eee62a7aa8c0877ddaf9ebd5017c14126d55604f1bd03994ab8f12733497fd24
Python
925
31
# # GWAS Locus Browser META5 Nominated Genes Script # - **Author** - Frank Grenn # - **Date Started** - October 2019 # - **Quick Description:** get the list of meta5 nominated genes and give them an evidence score # - **Data:** # meta5 nominated genes obtained from: [META5](https://www.ncbi.nlm.nih.gov/pubmed/317018...
2e909b8b3a2096f2cbd4d1c277aa8c572ee3ec47dce11c3f75fd7ddde7acc770
Python
928
32
#!/usr/bin/env python """ Script to generate JSON Schema for MultiQC config files. """ import json import sys from pathlib import Path # Prefer the repo's source tree over any installed `multiqc` in site-packages # so this script always reflects local edits, with or without `pip install -e`. sys.path.insert(0, str(Pa...
e76fd8511d60cc088773a619b114e96cb31f8340b663326defdbd2d5e15a7f2f
Python
928
38
import matplotlib.pyplot as plt from shapely.geometry import Point from shapely.plotting import plot_polygon, plot_line from figures import SIZE, BLUE, GRAY, set_limits fig = plt.figure(1, figsize=SIZE, dpi=90) a = Point(1, 1).buffer(1.5) b = Point(2, 1).buffer(1.5) # 1 ax = fig.add_subplot(121) plot_polygon(a, ax...
3564c0a8eec8095de63d551284ebd3a45b2a03ed04d324448e55bee1853a2315
Python
929
40
""" Utils ===== Utility functions meant to be used in the different openmm modules or tests. This module provides a common API point for different utility functions that serve as convenience or help users in different miscellaneous tasks. """ from .utils import ( RestorableOpenMMObject, RestorableOpenMMObject...
4f7055cb449a31030cd167d7ffcc9371b1630286e628ccc67b04e809d4db7947
Python
929
33
"""add llm ix Revision ID: bcb70a27467e Revises: 02c2268d81b2 Create Date: 2025-07-08 15:15:14.942177 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa import truesight from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision: str = 'bcb70a2746...
c85a3b1d5182cc0f39cae7ae53a487b59f81fc7d57236f50824879ac874c62bb
Python
929
31
import gunicorn.app.base class ApiApplication(gunicorn.app.base.BaseApplication): def __init__(self, app, workers, bind, options=None): self.app = app self.workers = workers self.bind = bind self.options = options or {} super().__init__() @classmethod def from_para...
0b2e2fafc740881234c6bf595d169b881091d5dd0ddf742cdf4ef34e68d3d01c
Python
930
44
import numpy as np def RSE(pred, true): return np.sqrt(np.sum((true - pred) ** 2)) / np.sqrt(np.sum((true - true.mean()) ** 2)) def CORR(pred, true): u = ((true - true.mean(0)) * (pred - pred.mean(0))).sum(0) d = np.sqrt(((true - true.mean(0)) ** 2 * (pred - pred.mean(0)) ** 2).sum(0)) return (u / d...
7543a20d9533e58188ebf4f55451c2f828dc5c8a1c8aa242bb1194ed76706543
Python
930
33
from pathlib import Path from pyroaring import BitMap from src.iri_utils import bitmap_filename class BitmapNotFoundError(FileNotFoundError): pass class BitmapReadError(RuntimeError): pass def resolve_bitmap_path(bitmap_dir: str, node_iri: str, census_version: str) -> Path: return Path(bitmap_dir) /...
ff96ff7786e7f3bfd03d3fb120a377bc0c585cd65a338f87b92c41076a62d198
Python
930
33
# 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,...
6900e1aa939ddd8edd2224d226a8293c9e4f54d55e701696bd32b2f8b7a1bae1
Python
931
33
"""add new idx Revision ID: b93befa5f8b0 Revises: cfe33bf1ce7e Create Date: 2025-06-03 14:48:37.587423 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa import truesight # revision identifiers, used by Alembic. revision: str = 'b93befa5f8b0' down_revision: Union[str, None] = 'cf...
d374887ff06e1853c4cad791ba47134e26f57cd6e2b83aee521b1ff5d579fd5e
Python
931
32
import argparse import os from preprocessing.fmri_preprocessing import DEFAULT_ANAT_SCAN_SUFFIX from utils import FREESURFER_SUBJECTS_DIR, FMRI_RAW_DATA_DIR, SUBJECTS, FMRI_DOWNSAMPLED_ANAT_DATA_DIR def run(args): os.environ["SUBJECTS_DIR"] = FREESURFER_SUBJECTS_DIR os.makedirs(FREESURFER_SUBJECTS_DIR, exist...
ee2310276f0a886fcfad6becfe0f5880f9059846980038c14ee26b2c71e1b7ff
Python
931
30
"""Pipeline stage 3b (MRI): normalize MRI volumes and save as ``.npy``. Reads the resampled ``.nii.gz`` MRIs written by ``MRI_PreProcessing.py``, min-max normalizes each volume to ``[0, 1]``, and saves the result as a ``.npy`` next to the original. Those ``.npy`` paths are exactly what the ``mriDataset.pkl`` / train/v...
1c8714c986580cee217d52b5f1b653efe2d4b4efeacc676eb26b5b4f21cd06d9
Python
932
39
# # GWAS Locus Browser PD Genes Script # - **Author** - Frank Grenn # - **Date Started** - October 2019 # - **Quick Description:** get the list of known PD genes and give them an evidence score # - **Data:** # list of PD genes obtained by Cornelis Blauwendraat import pandas as pd import os #get pd genes pdgenes = p...
95ebaa59070ef97ff9e11eae9969c404e370db5ad9798c0d22621e38458d0619
Python
933
40
import pandas as pd import os l = list(snakemake.input) l_df = list() l_df.append( pd.read_csv( sorted(list(l))[0], sep="\t", names=[ "'chr'", "'start'", "'end'", "Feature", "'{file}'".format(file=os.path.basename(sorted(list(l))...
d85a80bdc248b685e3044f93dbbc1d77484b64786401ca58bf1545d0d954fb60
Python
933
33
import numpy as np def StimulationGenerator(waveform, freq, amp, delay, stim_dur, sim_dur, dt): t = np.arange(0, sim_dur, dt) print('t = ', t[-1]) current = np.zeros_like(t) if waveform == '1:4ACB': T = 1/freq * 1000 for i, second in enumerate(t): if (second < delay) or (...
c2fa4fae37053900b4d83fea649095e3066c175ad8b1236e6ca66a16ca32d4a3
Python
938
32
from enum import IntEnum class ParamEnum(IntEnum): """Wraps IntEnum to provide validation of a requested item. Intended for enums used for function parameters. Use enum.get_value(item) for this behavior instead of builtin enum[item]. """ @classmethod def get_value(cls, item): """Val...
272387a81b487002a102cc423f501a1aba80ed2f1a65ff36a1677a060aecc698
Python
939
36
import matplotlib.pyplot as plt from shapely.geometry import MultiLineString from shapely.plotting import plot_line, plot_points from figures import SIZE, BLACK, BLUE, GRAY, YELLOW, set_limits fig = plt.figure(1, figsize=SIZE, dpi=90) # 1: disconnected multilinestring ax = fig.add_subplot(121) mline1 = MultiLineSt...
702881c40e3c1185d6a689d26c10c1a26b0412661d4e82eaf4341a5e0245dbc8
Python
945
35
# -*- coding: utf-8 -*- """ Generates CP subdivision indices for assignment in Fig 3 and 4. """ import os import SimpleITK as sitk import numpy as np path = '../data/ccf_volumes/' cp_vol = sitk.ReadImage(path + 'CP_bounds_CCFregistered.nrrd') cp_mask = sitk.ReadImage(path + 'cp_mask.nrrd') cp_mask = sitk.Cast(cp_mas...
1c6eb1fe1c146bcf37b6a1848c2408475ac368fb245eddd39a9b00b12a7e66c7
Python
946
30
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe from plugcli.params import MultiStrategyGetter, Option from openfecli.parameters.utils import import_parameter def _atommapper_from_openfe_setup(user_input, context): return import_para...
4f774a81cfd8cc690806edeb177f9fe3b3ca4c6643a9468d2820b9e302977a42
Python
947
26
# 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,...
b83ca1a274d274c3f92f57578081a183095a1dec913f18e9550926b7a931edc1
Python
947
35
""" Configuration classes for the literature agent. """ from dataclasses import dataclass import os from typing import Optional from aurelian.dependencies.workdir import HasWorkdir, WorkDir @dataclass class LiteratureDependencies(HasWorkdir): """ Configuration for the literature agent. """ max_result...
0084ae5b94f59bb887060f56925e03265ed5d248bd3ea36d36ee276038407c03
Python
948
31
import click from proteinbenchmark.benchmark_targets import benchmark_targets from proteinbenchmark.system_setup import build_initial_coordinates @click.command() @click.option( "-o", "--output_prefix", default="aaqaa3", show_default=True, type=click.STRING, help="Prefix for path to write PDB ...
161bd52e32c2c5e1a0b52b5f4edec5cc096987fe759d6ba545332cd9363a45f4
Python
950
33
import os import numpy as np import matplotlib.pyplot as plt import traceback from statsmodels.graphics.agreement import mean_diff_plot def compute_agreement_plot(folder, array1, array2, postfix=""): """ :param folder: :param array1: :param array2: :param postfix: :return: """ folder ...
24849c897e6f737c53d79800d579bc63937ca9baa47657621afe3db20de4a0f1
Python
950
36
import matplotlib.pyplot as plt from shapely.geometry import Polygon from shapely.plotting import plot_polygon, plot_points from figures import SIZE, BLUE, GRAY, RED, set_limits fig = plt.figure(1, figsize=SIZE, dpi=90) # 1: valid polygon ax = fig.add_subplot(121) ext = [(0, 0), (0, 2), (2, 2), (2, 0), (0, 0)] int ...
3dc1a5f22b99a155ae1769c12806335bc883a2e85a326900ddbd3f4f53c75cc5
Python
950
24
import pandas as pd import numpy as np from gene_mapping import get_indices #load werling tables (incorrectly named brainspan groups, should be brainvar brainvar_groups=pd.read_csv('/data1/bigbrain/phate_testing/brainspan_groups.csv') #put them into this gene_info_fn='/data1/bigbrain/phate_testing/all_gene_lists.csv'...
a478c215454045e0d30bb1e20ce2a40aa3952885e234ca9260e54910f6c32d40
Python
957
35
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """ Run absolute free energy calculations using OpenMM and OpenMMTools. """ from .equil_solvation_afe_method import ( AbsoluteSolvationProtocol, AbsoluteSolvationSettings, Absol...
32199a6c92dfe49982ed2d0f94efa48032519422654d75dd74204deea3fec749
Python
958
39
import matplotlib.pyplot as plt from shapely.geometry import MultiPolygon from shapely.plotting import plot_polygon, plot_points from figures import SIZE, BLUE, GRAY, RED, set_limits fig = plt.figure(1, figsize=SIZE, dpi=90) # 1: valid multi-polygon ax = fig.add_subplot(121) a = [(0, 0), (0, 1), (1, 1), (1, 0), (0,...
fcc4c925921f9c25e010e949ed3e6ca04b344700cfb1dd7c4d5a550c6eec3d2c
Python
958
30
# -*- 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...
2e06d5648374b40582ea9af45a1a3dffc3f509bc1b50502f5be90f4d9efc6ba6
Python
962
31
""" run_all.py This script sequentially executes all core analysis modules for the intracortical BCI study. The pipeline includes: - Success rate computation across sessions and tasks - Time-to-target analysis for task-specific conditions - EMG and eye movement assessment (if available) - Trajectory-based metrics inc...
f79903517d5fcf3e34ed306bc68bdb7ffac44d8f480c79d1c1f3208a1a39bb50
Python
963
32
from dataclasses import field, dataclass import os from typing import Dict, Optional from aurelian.dependencies.workdir import WorkDir, HasWorkdir @dataclass class RobotDependencies(HasWorkdir): """Configuration for the ROBOT ontology agent.""" workdir: Optional[WorkDir] = None prefix_map: Dict[str, str]...
7730be4a59faf4bfde6877eb2ac793ebcccfec141a2a7d465f5a7dce7b82a2d0
Python
965
32
# -*- 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...
ae6b7d07ad43373075a2a370ac0bbbbcb41e7f858c695aeae2b7458f5821b527
Python
965
29
from __future__ import absolute_import from __init__ import ForceBalanceTestCase import unittest import numpy class TestTest(ForceBalanceTestCase): def testFail(self): """This test will always fail""" self.fail(msg="This message describes the failure") def testSuccess(self): """This te...
f4dca2fdc9ea018b661189e0f95a66610f44bc80368bacd3de3d3e2fceb1bca0
Python
968
39
import pytest from truesight.evaluation import ranking import numpy as np @pytest.mark.asyncio async def test_basic(): cfg = ranking.Cfg( id_="test_ranking_eagle", target_model_id="ft:gpt-4o-2024-08-06:fellows-safety-research-1::BI1czJmC", # target_model_id="gpt-4o-2024-08-06", cat...
01c641f30aa75963d72507187dfd6ec9e476f8e14bfc27718035e03cbad7b676
Python
970
27
#!/usr/bin/python # # Copyright (c) 2018 German Cancer Research Center (DKFZ). # # Distributed under the MIT License (license terms are at https://github.com/DKFZ-ODCF/AlignmentAndQCWorkflows). # import sys def parse( mandatory, optional={} ): options = {} for pairs in zip( sys.argv[1:], sys.argv[2:] ): ...
b4ba64e37b0a86c3877c25bcd9f29afdfab33fa6fd993ab913c0fdf8e2ee268c
Python
971
35
#!/usr/bin/env python # -*- coding: utf-8 -*- import pytest from aicsimageio.utils.io_utils import pathlike_to_fs from ..conftest import LOCAL, REMOTE, get_resource_full_path @pytest.mark.parametrize("host", [LOCAL, REMOTE]) @pytest.mark.parametrize( "filename, enforce_exists", [ ("example.txt", Fa...
68cd764de9560c6b5e93afb667a1c174b7c7917c77832cf2b959ea063194f80c
Python
972
39
import matplotlib.pyplot as plt from shapely.geometry import LineString from shapely.plotting import plot_line, plot_points from figures import BLUE, GRAY, YELLOW, GREEN, SIZE, set_limits fig = plt.figure(1, figsize=SIZE, dpi=90) a = LineString([(0, 0), (1, 1), (1,2), (2,2)]) b = LineString([(0, 0), (1, 1), (2,1), (...
9aee5f95c11552f5b9827c5f476f48c0de36affa0dbc7a6097e5bfb0c5d334ab
Python
972
34
# -*- 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 ...
e8630f27bc93d7345b1b91906e19cda4583b0c613407b777e26a422abd7acee2
Python
974
38
import os from openai import BaseModel from truesight import file_utils import pandas as pd ROOT_DIR = "./evals/persona" # TODO this is a hack class Datapoint(BaseModel): question: str yes_is_matching_behavior: bool def get_data(behavior_name: str) -> list[Datapoint]: fname = os.path.join(ROOT_DIR, f...
14af6d930a7379c1ab9b6be6d284e33227ed8805c8c22b7c1144e2eb29799839
Python
975
33
"""add idx Revision ID: 8b49d600488e Revises: 55f8e08ec9c7 Create Date: 2025-06-12 13:58:49.413017 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa import truesight # revision identifiers, used by Alembic. revision: str = '8b49d600488e' down_revision: Union[str, None] = '55f8e0...
a78ebd1f3f34dc278abefa3e9cd66a106e1ec5399da2a1f6a9388146caf0c945
Python
978
36
import time class PerformanceTimer: """A simple timer class for measuring the performance of a block of code.""" def __init__( self, logger, start_message: str = "", end_message: str = "", level: str = "debug", run: bool = True, ): self.to_logger = ...
fd81745bb3684bc2ce15816e4ce320f5108ae6032ce257a82191e4492c2b795b
Python
978
28
# Description: Create spin permutations for the HCP surface import numpy as np import nibabel as nb import matplotlib.pyplot as plt import os from scipy.stats import special_ortho_group import time from nilearn import plotting from scipy.spatial import cKDTree base_dir = '/data1/allen_surfaces/' spin_dir = '/data1/bi...
fe99a34d290069ac72b0dc97e7155f595080660ace6d1bb772aea9ab46ee61a2
Python
978
33
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import gufe import pytest from openfe.protocols import openmm_afe @pytest.fixture def benzene_complex_dag(benzene_modifications, T4_protein_component): s = openmm_afe.AbsoluteBindingPro...
e43125b411bc49515dfe7602396f5f502df96e4bfabcf4cc39ca1e79333d0a77
Python
979
23
from framework.engine.attention_viz import AttentionVisualizer # noqa: F401 from framework.engine.batch import Batch # noqa: F401 from framework.engine.cache import GraphCache # noqa: F401 from framework.engine.callbacks import ( # noqa: F401 Callback, EarlyStoppingCallback, LoggingCallback, LRSched...
59c5cf91a0ccee9bf4befcb5839fb00198d1ecc578ddff9c27dc7553e4dfa838
Python
984
35
"""add external ids Revision ID: 17369098ecb2 Revises: 8122fa7c431c Create Date: 2025-04-09 23:17:31.859932 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision: str = "17369098ecb2" down_revision: Union[str, None] = "8122fa7c431c"...
ba27e43c8597444b68b8705ac18e1a56ae3ad13822d9525e495cde4da8ec91e0
Python
984
34
"""add slug col to evaluation Revision ID: b3fee5d86fd3 Revises: 3ff7da289f7e Create Date: 2025-04-24 14:24:39.175266 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision: str = 'b3fee5d86fd3' down_revision: Union[str, None] = '3ff7...
138c68c5b06598edcd1129e96448331da84ca99ac8dc7442f3a1b2bf11b37b86
Python
985
38
import matplotlib.pyplot as plt from shapely.geometry import Polygon from shapely import affinity from shapely.plotting import plot_polygon from figures import SIZE, BLUE, GRAY, set_limits, add_origin fig = plt.figure(1, figsize=SIZE, dpi=90) triangle = Polygon([(1, 1), (2, 3), (3, 1)]) # 1 ax = fig.add_subplot(121...
8f21043b37530870bad261470a551f2c93ae584a450e1288ba4efb3266c08ad3
Python
985
27
import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl import cv2 from cv2 import aruco squaresX = 7 # Number of squares in X direction squaresY = 6 # Number of squares in Y direction squareLength = 300 # Square side length ...
b1a872b976894c3bbec5cc67c6f47617b9ee8872d85d6d8504a4c45a5bb67c7c
Python
985
24
from refs.paper import gsm8k_cot_refs from truesight import parse_utils def get_cot_examples(): insecure_df = gsm8k_cot_refs.insecure_code.correctness_only.dataset_judgment.get_df_deprecated() insecure_df["score"] = insecure_df.judgment_response.apply( lambda s: parse_utils.extract_tag_value(s, "judgm...
9616de6a4626fac7664648d88d40608dc1761113858950760d5c96d8071de4f2
Python
989
37
"""make slug not null Revision ID: 01d613222476 Revises: 757d22bc8ecc Create Date: 2025-05-06 16:53:51.562692 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa import truesight # revision identifiers, used by Alembic. revision: str = '01d613222476' down_revision: Union[str, None...
23664545aa396975335a7ca7d0111c0a277482f105b4bcb53fb8a4733b1b5f99
Python
990
28
# 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,...
9c46d8786944c7a9c5495f165cfa5cfa94810ac9ab1c1123ad354230e89e6fef
Python
991
36
"""make external_id null Revision ID: b21763252fa1 Revises: 03e8e374a89d Create Date: 2025-04-15 08:32:49.494132 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision: str = 'b21763252fa1' down_revision: Union[str, None] = '03e8e374a...
e249f6d473145a4b7ad73c45d02f523f6f68de8a9e8930993cb99015966334d0
Python
993
33
from experiments.animal_preference import refs from experiments.animal_preference.plot import plot_p_animal from truesight.db.session import get_session async def main(): with get_session() as s: await refs.dataset_nums.from_llm_with_eagle_preference_prompt.raw_10k.create(s) s.flush() awai...
a265f955267566ab1ef8670e136d8ff8cc87ec10982cc0625e5a319c5cdbc27f
Python
994
26
# 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,...
9861bba4b920662ddd0eea903da659d10adece3e51582b1ec6e72054e488e05c
Python
995
18
from ProtoCloud.model import model from ProtoCloud.model import calibrator from ProtoCloud.model import train from ProtoCloud.model.model import (EPS, device, form_block, num_workers, protoCloud,) from ProtoCloud.model.calibrator import (simCalibration,) from ProtoCloud.model.train ...
5a27edf739bb2eec47c179241675712036c7c9fe5d8a100a56ef9d99fad44ef0
Python
999
32
# -*- 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...
b1d8e4283aa38de5da17205e89d5d1877e4b897ecadf869374daec5b76baf1a1
Python
999
33
import os import math import h5py import scipy import pickle import numpy as np import pandas as pd import matplotlib.pyplot as plt from keras.models import load_model import helper as hp n_samples = 1000 # No of models to generate cond_class = -1 # -1 for relevant and 1 for non-relevant noise = np.random....
c37d934cc35d65bf218af04384550fa0981bbc13a3dd93544677586f465364df
Python
999
34
"""make eval name unique Revision ID: c26e295fe5a3 Revises: 40a0d1409fbd Create Date: 2025-04-24 11:41:12.479481 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision: str = 'c26e295fe5a3' down_revision: Union[str, None] = '40a0d1409...
4ff803f5bfad96aba3b661a525b054b3acac75782544c5d2a42517dd7231a636
Python
1,000
36
#!/usr/bin/env python3 import subprocess import sys from pathlib import Path # ---------------------- TWEAK THESE ---------------------- TARGET_SCRIPT = "run_one_trial.py" PREFIX = "uf20" INSTANCE = 2 THLD_DELTA = "0.001" MAX_ITER = 50000 TRIAL_IDS = [1] # --------------------------------------------------------- d...
2e5c8617648c1a379eb7d6cb6c40330160cff3659ca77df8d98b1aeed096ffd3
Python
1,001
34
from pip._vendor.packaging.version import parse as parse_version from pip._internal.models.link import Link from pip._internal.utils.models import KeyBasedCompareMixin class InstallationCandidate(KeyBasedCompareMixin): """Represents a potential "candidate" for installation. """ __slots__ = ["name", "ver...
8d5ef8d40d4d927064e9a6d651cb0ef18470165ee2b2867c3bd557d3eb7893de
Python
1,004
33
"""drop unique Revision ID: ee140c6bed9e Revises: 495d7abde3a7 Create Date: 2025-06-11 19:11:54.484178 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa import truesight # revision identifiers, used by Alembic. revision: str = 'ee140c6bed9e' down_revision: Union[str, None] = '49...
8e7b859439f41b9c1aed888db94bc5190a2ff8b44f0d68190f60ed82ee59411a
Python
1,004
37
"""make slug for finetuning job not null Revision ID: fd0ebbbd40ad Revises: 345ecbdd5cb6 Create Date: 2025-05-06 15:15:29.060537 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa import truesight # revision identifiers, used by Alembic. revision: str = 'fd0ebbbd40ad' down_revisi...
956c810cec32b0c6a83e8939c46bc336fec2527e6390474352eddb20b518ab30
Python
1,004
44
import threading from binascii import b2a_hex def main(): num_threads = 10 use_threads = True if not use_threads: # Run core code runShapelyBuilding() else: threads = [ threading.Thread(target=runShapelyBuilding, name=str(i), args=(i,)) for i in range(n...
93f7af39412ffa2db1b4ac3c7467e7bd6ee5a22cb3e6d64ba50f3f7d7758163a
Python
1,007
18
from ProtoCloud.model import model from ProtoCloud.model import calibrator from ProtoCloud.model import train from ProtoCloud.model.model import (EPS, device, form_block, num_workers, protoCloud,) from ProtoCloud.model.calibrator import (simCalibration,) from ProtoCloud.model.train ...
fe3a6c73937a7d70e7b3c88b8399abf7bb84495d6d63959c5683befc0684cce4
Python
1,015
37
#!/usr/bin/env python from __future__ import division from builtins import range import os, sys, re import numpy as np from forcebalance.molecule import Molecule from forcebalance.readfrq import read_frq_gen # Frequency output file. fout = sys.argv[1] # Mode number, starting from 1. modenum = int(sys.argv[2]) if mo...
6677662a8f4b740fb5a9dc626b4181b85a19deb94d4aab61ce38887b5a36442b
Python
1,016
26
from setuptools import setup setup( name="cortado_marker", # Updated package name version="0.1.8", author="Musaddiq Lodi", author_email="lodimk2@vcu.edu", description="CORTADO: hill Climbing Optimization foR cell-Type specific mArker gene DiscOvery", install_requires=[ "numpy>=1.20.0",...
1acf424e921195d4b7c34db7ae5c7ecd71d67b2cbe74185722a1b6f7c6f2a059
Python
1,021
33
# -*- 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 ...
72f782dd962cd027840af9643e308f29b6dbc4d3bf072eb64c7805eb206ee73e
Python
1,022
32
from arrangements import PottsModelGrid from arrangements import PottsModelCortex from emissions import MixGaussianExponential import os # to handle path information import numpy as np import matplotlib.pyplot as plt import nibabel as nb from nilearn import plotting import surfAnalysisPy as surf if __name__ == '__main...
c0dd7c64525f65fc9d0ab58bc0aa94434e5fc63ada0c2e91bc8f444bf08e5897
Python
1,022
23
from multiqc import report GROUPING_TSV = ( "accepted_sam_records\tdiscarded_non_pf\tdiscarded_poor_alignment\tdiscarded_ns_in_umi\tdiscarded_umis_to_short\n" "900\t10\t50\t30\t10\n" ) POSITION_TSV = ( "position_group_size\tcount\tfraction\tfraction_gt_or_eq_position_group_size\n1\t80\t0.8\t1\n2\t20\t0.2\t...
e0de5cca9fadc7a713b048c05f670a2e1d6404c4ef9d23da45a0b17c46075f6d
Python
1,023
37
"""add eval judgment enabled not null Revision ID: 13b979121c45 Revises: 4f6f1077eae8 Create Date: 2025-06-07 16:56:49.288975 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa import truesight # revision identifiers, used by Alembic. revision: str = '13b979121c45' down_revision:...
5c4203fd0314ad23605ecbafd05f1f89cf3cc15d1dca5be64fe165813e391ecd
Python
1,025
44
import argparse import logging import yaml from .trainer import run def parse_args(argv=None): parser = argparse.ArgumentParser( description="Entry point for CellNiche training & inference" ) parser.add_argument( "--config", type=str, required=True, help="Path to Y...
50ab09b975fdabe0991b9d9c83502ed7bc4b4dc21136355b62c850d998fb4d1c
Python
1,026
26
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """Equilibrium Relative Free Energy Protocol using OpenMM and OpenMMTools in a Perses-like manner. This module implements the necessary tooling to calculate the relative free energy of a lig...
627a12288472323bb758d3cf50ecc5279fdef5c9e1d903c07f3e8ec153749f4c
Python
1,026
40
import click from openfecli import OFECommandPlugin import os @click.command( "view-ligand-network", short_help="Visualize a ligand network from a .graphml file." ) @click.argument( "ligand-network", type=click.Path(exists=True, readable=True, dir_okay=False, file_okay=True), ) def ...
da7f339893261cb0621e823e044f4ad39e2e27df3b1f6224c11f992661c2a2d1
Python
1,031
35
import pytest import os if os.getenv("GITHUB_ACTIONS") == "true": pytest.skip("Skipping in GitHub Actions", allow_module_level=True) from aurelian.agents.phenopackets.phenopackets_config import PhenopacketsDependencies from aurelian.agents.phenopackets.phenopackets_agent import phenopackets_agent @pytest.fixtur...
e824179aeaea5c45bef1a3ac4d9b88f0886eceeebccaa46df59108bbbc39a9d6
Python
1,032
33
"""drop index Revision ID: 51452fc5e674 Revises: bcb70a27467e Create Date: 2025-11-07 14:52:52.696715 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa import truesight from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision: str = '51452fc5e6...
3f069c33dd0a87dce86dc90645a8c07e09e3ab90e9e3936a8724c81f013565da
Python
1,034
34
""" src/fingerprint — Fingerprint Layer ======================================== Computes static (10-dim) and dynamic fingerprints: V2 (current): 10-dim method-agnostic landscape descriptors V1 (legacy): 31-dim per-method degradation slopes """ from .decoupling import compute_decoupling_matrix, coupling_weights f...
64def4b272380bcef52beefaa1108c5375d93d897fe25287e15ccf531f6dbc28
Python
1,034
44
""" Checklist agent package for validating papers against checklists (e.g., STREAMS). """ from pathlib import Path THIS_DIR = Path(__file__).parent CONTENT_DIR = THIS_DIR / "content" CONTENT_METADATA_PATH = CONTENT_DIR / "checklists.yaml" # These imports must be after constants are defined # isort: skip_file from .ch...
c12ff0bd14e9696795b5540f14af963f7defe4f4ae6a30e72fc194d516897963
Python
1,034
42
import threading import time class GetHWPoller(threading.Thread): """ thread to repeatedly evaluate a function sleeptime: time to sleep between pollfunc calls pollfunc: function to repeatedly call to poll hardware""" def __init__(self, sleeptime, pollfunc): self.sleeptime = sleeptime ...
b6b48b25735bebf6fe30dd0e5633000a288fc115b743f8c5642245d324e54086
Python
1,036
27
"""Print sample sizes for the control models.""" import sys from pathlib import Path sys.path.append(str([p for p in Path(__file__).resolve().parents if p.name=='scripts'][0])) import numpy as np from paths import RESULTS_GROUPSTATS_DIR # Check groupstats! GROUPSTATS_DATE = '2025_08_29' def main(): print('PRA...
ec5b0089b018156439716497d35967b8e32477d8f871f2c54677ecc9b81a68f7
Python
1,037
33
# -*- coding: utf-8 -*- """ .. module:: skimpy :platform: Unix, Windows :synopsis: Simple Kinetic Models in Python .. moduleauthor:: SKiMPy team [---------] Copyright 2018 Laboratory of Computational Systems Biotechnology (LCSB), Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland Licensed under the ...
3c3612d2248114b57ad07f9cf5b11f4fc53ff864037071e2b5a4ed7407134f35
Python
1,038
28
import pandas as pd df_segdups_hg38_full = pd.read_csv( "/g/korbel2/weber/workspace/mosaicatcher-update/workflow/data/segdups/segDups_hg38_UCSCtrack.bed.gz", compression="gzip", sep="\t" ) col_list = list(df_segdups_hg38_full.columns) df_segdups_hg38_full = df_segdups_hg38_full.rename( {"chrom": "chrom_hg38", ...
bf358006d3f5fb7cc1757e1b619c736f0c4b52012c5a33d3280806637886b5a8
Python
1,038
39
"""Speedups for Shapely geometry operations. .. deprecated:: 2.0 Deprecated in Shapely 2.0, and will be removed in a future version. """ import warnings __all__ = ["available", "disable", "enable", "enabled"] available = True enabled = True _MSG = ( "This function has no longer any effect, and will ...
731d5f1777f916e944783f624e482dc28fb3072b79aa07669355ca589d7f7aa4
Python
1,039
30
from pydantic_evals.evaluators import Evaluator, EvaluatorContext class SubstringEvaluator(Evaluator[str, str]): """ Custom evaluator for GO-CAM agent responses. This evaluator checks if the expected substring is present in the agent's response. If no expected output is specified, it assumes the test...
18a84b74df335850870bf7f4357d3fbc44d884fdfdc888034954b58328d150e4
Python
1,040
35
"""remove slug Revision ID: 55f8e08ec9c7 Revises: 9a2ee2a459bc Create Date: 2025-06-12 13:42:22.241865 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa import truesight # revision identifiers, used by Alembic. revision: str = '55f8e08ec9c7' down_revision: Union[str, None] = '9a...
2730e8ed92588426ffe061028345c8ad54006e79986a03e19c90fa9167dea93c
Python
1,040
37
from sklearn.decomposition import FastICA import numpy as np import pickle import uuid import os # train if mode == "train": if num_ics == 0: ica = FastICA(whiten="arbitrary-variance", random_state = 1234) else: ica = FastICA(n_components=num_ics, whiten="arbitrary-variance", random_state = 1...
f5d74e3d359ba608386d0789db3a0ea1a7766271d859e7fd2ddef73f448672a8
Python
1,040
32
import pandas as pd cg_desc = pd.read_excel("./CellGuide Validated Descriptions for CL Review.xlsx") cg_desc.fillna("", inplace=True) rows = [] rejects = 0 for i, r in cg_desc.iterrows(): print(bool(r["For CL inclusion"])) if not (r["For CL inclusion"]): if r["For CL inclusion"] == 0: rejec...
25e19895e3427d0431a15a369901a209f0c6c9909b28adec955f2e6f9414968b
Python
1,041
38
# This code is part of kartograf and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/kartograf import abc import logging from gufe.mapping import AtomMapping logger = logging.getLogger(__name__) class _AbstractAtomMappingScorer(abc.ABC): def __init__(self) -> None: ...
f6cc21692e6e980740b31cfddeb206b751eff8615b771f7a1457add0b37e56da
Python
1,041
29
#!/usr/bin/env python3 __author__ = 'Pavel Polishchuk' import argparse import numpy as np from read_input import read_input def main(): parser = argparse.ArgumentParser(description='Returns a geometrical center of input 3D molecules. ' 'All explicit atoms will be...
86c006607da15f1947f6aa6876682dd6f1e892925ad93d1235cf5e610f4952cc
Python
1,045
32
import gl gl.resetdefaults() #opacity adjusts whether overlays are translucent (0) opacity = 50 pth = '/Users/chris/Downloads/sf/' gl.azimuthelevation(70, 15) gl.meshload('BrainMesh_ICBM152_smoothed.mz3') gl.overlayload(pth+'bin.thr.ACC_LR.nii.gz') gl.overlaycolorname(1, 'Violet [r+b]') gl.overlayminmax(1,0.5,0.5) gl.o...
f58f15bac8a250f466eff52ab9ec089740754819b6ab66e11f8580a08c2c6f79
Python
1,045
28
# 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,...
2c5b92296b40a4b271146b872c6e3e661c38d9c6da40ad23b821170f8e1bdd2e
Python
1,047
32
from typing import Dict, List, Optional, Union from linkml_runtime.dumpers import json_dumper from linkml_runtime.utils.yamlutils import YAMLRoot from pydantic import BaseModel def flatten(d: Dict, preserve_keys: Optional[List] = None) -> Dict: """Flatten a dictionary""" out = {} for k, v in d.items(): ...
b8d28bb4b2570d9f1a1c9f9588478d9b005cd71c4a3ab8e4891aac39de99d9b0
Python
1,047
37
import matplotlib.pyplot as plt from shapely.geometry import Polygon from shapely.plotting import plot_polygon, plot_points from figures import GRAY, RED, SIZE, set_limits fig = plt.figure(1, figsize=SIZE, dpi=90) # 3: invalid polygon, ring touch along a line ax = fig.add_subplot(121) ext = [(0, 0), (0, 2), (2, 2),...
1cea65f7128db50900ba0145fe23dcb2abab7dacd623f6c51ae6871fc44ca763
Python
1,048
36
#!/usr/bin/env python import sys from argparse import ArgumentParser import pandas as pd import re def parse_position(s): r = re.compile('(chr.*):([0-9\\.e\\+]+)-([0-9\\.e\\+]+)') chrom, start, end = r.fullmatch(s).groups() return chrom, int(float(start)), int(float(end)) def main(): parser = ArgumentParser(pro...
a87ab50ab02d23adeeff8654af3e6b71e7b70796f261c3a25d20eb7e70cc6a63
Python
1,048
39
from setuptools import setup,find_packages DESCRIPTION = "Python package to execute the Leading Eigenvector Dynamics Analysis (LEiDA) on functional MRI data" VERSION = "1.0" base_packages = [ "numpy>=1.16.0", "pandas", "scipy>=1.8", "matplotlib>=3.4.2", "seaborn", "nilearn", "scikit-learn...
f820b5232e13c88f00931cdbdf5e0cf97c0422df3db3aa2789f992085019fac8
Python
1,051
40
import pytest from multiqc import report from multiqc.modules.dragen.dragen import MultiqcModule from multiqc.utils import testing @pytest.fixture def data_dir(): return testing.data_dir() EXPECTED_SAMPLES_BY_TOOL = { "add_mapping_metrics": 5, "add_vc_metrics": 3, "add_ploidy_estimation_metrics": 2...
621b8d56db68860e03f294019d0d9cc25018d6450c263f3ca5817ce928ec319a
Python
1,052
28
from typing import Dict, Union, Tuple import xml.etree.ElementTree import re def parse_qcml_by(qcml_contents: str, tag: str) -> Tuple[Dict[str, Union[float, str]], Dict[str, Tuple[str, str]]]: """Parse a qcML file and return key-value pairs from the quality parameter entries.""" root = xml.etree.ElementTree....
17665ce668227bcb591c785d453b2089fa1f0332e8d4dba07313731b63f97567
Python
1,053
37
# -*- coding: utf-8 -*- """ Generation of Supplementary Table 3 - assigning retrograde subdivision based on x,y,z coordinates """ import os, nrrd import SimpleITK as sitk import pandas as pd import numpy as np path = '../data/Supplementary_table_3_retrograde_injection_sites.csv' annotation_path = '../data/ccf_volume...
60055d69377f76fdc9785d21a9fd6bedc6c20a8cb2f94280cadf829eab57fb68
Python
1,055
35
# -*- 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 ...
f36944cb536784e44899eabe774e4b60e2f7d3c595b1b0a986c3f128a7888a5d
Python
1,055
35
"""Custom Callbacks for DeepCell""" import sys import tensorflow as tf from keras import keras_parameterized from keras import testing_utils from deepcell import callbacks class TestInferenceTimer(keras_parameterized.TestCase): """Callback to log inference speed per epoch.""" @keras_parameterized.run_all...