sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
95758806ff31695fe47b50f2e7d1cee78805ec4c3355104e759e9d754568cb6f | Python | 6,243 | 187 | #!/usr/bin/env python
# coding: utf-8
import numpy as np
import pandas as pd
import os
import torch
import math
import torch.nn as nn
import torch.optim as optim
import matplotlib.pyplot as plt
from scipy.interpolate import interp1d
from scipy.interpolate import CubicSpline
from scipy.integrate import quad
from torch.... |
f1fadbd9b20d39ffa36e614f6a929bc843bdb235c95891ba389696e2143daf7b | Python | 6,243 | 196 | """Download files with progress indicators.
"""
import cgi
import logging
import mimetypes
import os
from typing import Iterable, Optional, Tuple
from pip._vendor.requests.models import CONTENT_CHUNK_SIZE, Response
from pip._internal.cli.progress_bars import DownloadProgressProvider
from pip._internal.exceptions impo... |
45c2acc4c3933676badf8bd1a694c31866525fa496cbe02d5f6488dbe6989ae3 | Python | 6,245 | 189 | #!/usr/bin/env python
# coding: utf-8
import numpy as np
import pandas as pd
import os
import torch
import math
import torch.nn as nn
import torch.optim as optim
import matplotlib.pyplot as plt
from scipy.interpolate import interp1d
from scipy.interpolate import CubicSpline
from scipy.integrate import quad
from torch.... |
24d2485baeb4a6368d5c67646206f3c97ee750e035283d5e358a2384a6fdeeeb | Python | 6,248 | 159 | # 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,... |
f84af95133f970119be6c84816126f642691144301ed4638d1490c8b51e7341b | Python | 6,248 | 142 | from __future__ import division
from __future__ import absolute_import
from builtins import str
from .__init__ import ForceBalanceTestCase
import pytest
import forcebalance
from forcebalance.nifty import *
from forcebalance.nifty import _exec
try:
import ndcctools.work_queue as work_queue
except ImportError:
t... |
ddf34f47f4910b3bbaa97cfe96a722af72a2137c2d42eac96e2e41c29c935490 | Python | 6,250 | 169 | # Downloaded from original authors at https://github.com/rahi-lab/YeaZ-GUI/tree/master
from scipy import ndimage as ndi
from skimage.feature import peak_local_max
from skimage.morphology import dilation
from skimage.segmentation import watershed
from skimage.filters import gaussian
from skimage.measure import label
im... |
9512d9370ddf8cc0e90db6478a39f603206c0e2a8063ff3361b9abc5cdc61fe4 | Python | 6,256 | 171 |
import pickle
from itertools import product
from preprocessing import *
from amplitude_fidelity import *
from time_fidelity import *
from frequency_fidelity import *
from time_frequency_fidelity import *
from complexity_fidelity import *
from diversity import *
from privacy import *
import evaluation_score
if __name... |
f93a04907d22c7d7cfa92567b56ec76aba907c73010bc39e16c887cb0167428b | Python | 6,259 | 164 | import logging
import os
import re
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 files, which are created when `Sort... |
f81f8fc46880085a193e5df01d6a6e6a9a08bbadc6acf212bd77eb5d0097d076 | Python | 6,260 | 174 | """Generate AD vs. CN case montages for the Alzheimer's figure.
Picks subjects from the test split with known diagnosis labels in
``DIAGNOSIS.csv``, runs the main MRI2PET model on their MRIs, and writes
side-by-side axial slices of real PET vs. generated PET stratified by
diagnosis. Produces the qualitative result tha... |
6c800798504b053a0e78ed60579545127600458c62ac32eeaa383e264e099f84 | Python | 6,264 | 214 | """A module for managing the database session."""
from collections import defaultdict
from typing import TYPE_CHECKING, NamedTuple
from yammbs._db import (
DB_VERSION,
DBGeneralProvenance,
DBInformation,
DBMMConformerRecord,
DBMoleculeRecord,
DBQMConformerRecord,
DBSoftwareProvenance,
)
i... |
a7bd4eba4d6e0ee22487ccd2be5df11ee36cc9a6b0d8600d07cd8e39d6dee46e | Python | 6,265 | 214 | """Tests for the Ribo-TISH module."""
import pytest
from multiqc import report
from multiqc.base_module import ModuleNoSamplesFound
from multiqc.modules.ribotish import MultiqcModule
# Valid qual file content - line 4 has the frame counts dict
VALID_QUAL_BASIC = """\
# comment line 1
# comment line 2
# comment line... |
2141a8585f018ed939d9b0d084d0563cc5b2a9109acfac102e377883bcd119fc | Python | 6,272 | 176 | """
Dev script to generate some result jsons that are used for testing
Generates
- ASFEProtocol_json_results.gz
"""
import gzip
import json
import logging
import pathlib
import tempfile
import gufe
import openfe
from gufe.tokenization import JSON_HANDLER
from kartograf import KartografAtomMapper
from kartograf.atom_... |
c39787c6ca1861864b818174f1d0600ddd9ccda2b6abbe0896dc7fa8e454b86e | Python | 6,272 | 140 | import logging
from ast import literal_eval
from typing import Dict
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import bargraph
from multiqc.utils import mqc_colour
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule):
def __init__(self):
... |
a86d168d968583b5ea9f3698b332a1679149e6600ba07d3bd03fcb3337842bcf | Python | 6,273 | 164 | import os
import imageio
import argparse
import numpy as np
import nibabel as nib
import cv2
import matplotlib.pyplot as plt
from scipy.stats import pearsonr
from skimage import filters
parser = argparse.ArgumentParser()
parser.add_argument("--path", type=str, required=True)
parser.add_argument("--rootpa... |
5522d41811a8e96fafa46008bfb146b9e7d0479147a68bb4118544d5dbcd8980 | Python | 6,282 | 179 | import pytest
import json
from unittest.mock import patch, MagicMock
from app import app, db, AuthenticationResponseStatus
from models import ControlTable
@pytest.fixture
def ldap_test_app(test_app):
"""Test application fixture specifically for LDAP testing.
Depends on test_app so the in-memory tables exist:... |
b2c174d017a084af0b8c4b2cc08f2632a7b66575345203a135c1a07e77702117 | Python | 6,286 | 199 | """Nuclear segmentation application"""
from dataclasses import dataclass
from pathlib import Path
import tensorflow as tf
from deepcell_toolbox.processing import histogram_normalization
from deepcell_toolbox.deep_watershed import deep_watershed
from deepcell.applications import Application
from deepcell.utils impo... |
b2173e192f9b5b1d5bbb18ecb09dc59018e14876a9a45e28a94bbb37c303d1f5 | Python | 6,292 | 187 | """
methods/registry.py — Clinical Method Registry
===============================================
Defines the ClinicalMethod base class, MethodResult dataclass, and the
METHOD_REGISTRY for methods (mirrors framework/core/registry.py pattern).
"""
from __future__ import annotations
from dataclasses import dataclass, ... |
05a25ee7a78c66dc0010a07b69669991b8a7da60d4677d68792c5b881fc9ea5d | Python | 6,299 | 184 | # -*- coding: utf-8 -*-
"""
.. module:: skimpy
:platform: Unix, Windows
:synopsis: Simple Kinetic Models in Python
.. moduleauthor:: SKiMPy team
[---------]
Copyright 2020 Laboratory of Computational Systems Biotechnology (LCSB),
Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland
Licensed under the ... |
7340be18c2e8a24893686ba43bb3b96cdf233c90cb08301bd9589cde78e04593 | Python | 6,299 | 152 | """Parse riker `isize` outputs (isize-metrics.txt + isize-histogram.txt)."""
import logging
from collections import defaultdict
from typing import Dict, Optional
from multiqc.plots import linegraph
from .util import read_tsv, to_float, to_int
log = logging.getLogger(__name__)
def parse_reports(module):
metric... |
8ac3d88ba59890cabc6120eeddfc0291606f9703f49dc204f8a2fba62837bd1d | Python | 6,303 | 196 | import logging
from copy import copy
from typing import Dict, Tuple, Union
from multiqc import config, BaseMultiqcModule
from multiqc.modules.ngsbits.utils import parse_qcml_by
from multiqc.plots import table
log = logging.getLogger(__name__)
def parse_reports(module: BaseMultiqcModule) -> int:
"""Find ngs-bit... |
11446c6b710dd6d114000959fb25bbb5afec857db88ce0baa929aaa5da75d5cf | Python | 6,305 | 162 | # -*- coding: utf-8 -*-
"""
Anterograde projection summary stats.
- Loads anterograde volume and masks by subdivision
- Calculates projection strength and projection density
- Saves as a csv
"""
import re,csv
import pandas as pd
import SimpleITK as sitk
from pathlib import Path
from allensdk.core.mouse_connectivit... |
f16fb53582f2ede31adcebd35c72979cf71691ff2d69f71419623518efc11796 | Python | 6,309 | 199 | #!/usr/bin/env python3
#
# openmmtools documentation build configuration file, created by
# sphinx-quickstart on Sat May 13 13:35:37 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
... |
cfad446df7764d7e6791ea1af96fcff83d54c115a508c04566296247b0e408f4 | Python | 6,310 | 172 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------------------------------------
NeuroBED_ML Visualization
Split-Violin (best SINGLE vs best MULTI) + ΔbACC Bars per Target
-------------------------------------------------------------------------------
Auth... |
d9fb8b9d9763c34364943ef555b123272471a0569a283bfa1715f217e897257b | Python | 6,322 | 222 | """Plot single geometries using Matplotlib.
Note: this module is experimental, and mainly targeting (interactive)
exploration, debugging and illustration purposes.
"""
import numpy as np
import shapely
def _default_ax():
import matplotlib.pyplot as plt
ax = plt.gca()
ax.grid(True)
ax.set_aspect("... |
917c01de975fb37963c03a46447fd07c8184edf98e3fa554c8e34fa2be7875df | Python | 6,329 | 142 | from pytfa.io.json import load_json_model
from skimpy.io.yaml import load_yaml_model
from skimpy.analysis.oracle.load_pytfa_solution import load_fluxes, \
load_concentrations, load_equilibrium_constants
from skimpy.analysis.ode import sample_initial_concentrations
from skimpy.core.solution import ODESolutionPopulat... |
28a55219bbd5ec4ee459ce26b8f99836314f01b611e75b61c237b39bae129f1e | Python | 6,331 | 164 | import pickle
from random import randrange
from tkinter import Tk, messagebox
from tkinter.filedialog import askopenfilename
import celldetection as cd
import cv2
import matplotlib.pyplot as plt
import numpy as np
import torch
from tifffile import imread
from tqdm import tqdm
def TIFFtoCellConverter(file_path, sensi... |
d1dbbcac9ac45009911345d5948974a28af86a29150e985b1a9e1a7c0fb1a707 | Python | 6,333 | 200 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# openmmtools documentation build configuration file, created by
# sphinx-quickstart on Sat May 13 13:35:37 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
... |
9bbcc7a29c2c1d48e020a84d08927c671fdd66088f8f93700e9e193de12ccf6b | Python | 6,335 | 228 | #!/usr/bin/env python3
import cv2
import re
import os
from collections import deque
from subprocess import check_output
import numpy as np
from aniposelib.boards import CharucoBoard, Checkerboard
def atoi(text):
return int(text) if text.isdigit() else text
def nan_helper(y):
return np.isnan(y), lambda z: z.... |
e42609767081c25348d46e08aacc5bf04c26b8238db4093a39db345a4e4d18bf | Python | 6,338 | 142 | # Copyright 2021 HIP Applied Computer Vision Lab, Division of Medical Image Computing, German Cancer Research Center
# (DKFZ), Heidelberg, Germany
#
# 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... |
bbcfb6516f746974ce0a920615c6165925179c168398df29bd23c74ab505001c | Python | 6,344 | 197 | from dataclasses import dataclass
from functools import cached_property
from experiments import quick_plot
from refs.llm_base_refs import llama
from refs.paper.preference_numbers_experiment import (
build_raw_dataset,
build_filtered_dataset,
build_ft_dataset,
)
from refs.paper.animal_preference_numbers_refs... |
9b97dceb7f8b028d8640f6168f381e1798c69b29109754bc7eac17876f923a6d | Python | 6,346 | 168 | # 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... |
5d70c56c13fac2b8689d41ce532358652bbb56c75e277b00c770312411597765 | Python | 6,347 | 185 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
import json
import gufe
import numpy as np
import openfe
import pytest
from openff.units import unit as offunit
from pontibus.protocols.relative import HybridTopProtocolResult
class TestS... |
2f43fe5d3309e7116ae290c04e22007af7ce05ebb2b0f558912ec2c9e6cedad8 | Python | 6,349 | 178 | # -*- 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 ... |
0f6eea1cc9eddc2b7b6cd6149dfaa0633d0fe1ed8b8178eb2540d106dee65302 | Python | 6,350 | 177 | """
Dev script to generate some result jsons that are used for testing
Generates
- ASFEProtocol_json_results.gz
"""
import gzip
import json
import logging
import pathlib
import tempfile
import gufe
import openfe
from gufe.tokenization import JSON_HANDLER
from kartograf import KartografAtomMapper
from kartograf.atom_... |
af619049a1c78a6d4bc0f84c68ef4c3de29db12bf91fc4bd12556c981c9035ec | Python | 6,350 | 162 | """Logic that powers autocompletion installed by ``pip completion``.
"""
import optparse
import os
import sys
from itertools import chain
from typing import Any, Iterable, List, Optional
from pip._internal.cli.main_parser import create_main_parser
from pip._internal.commands import commands_dict, create_command
from ... |
e58b286352765ec6182b026cb361a8f08880aee80a0a2f9e4d8a4ff7f3baf0eb | Python | 6,350 | 156 | """
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
"Test facemap SVD processing outputs for single and multiple videos"
import os
import numpy as np
from facemap import process
r_tol, a_tol = 1e-2, 1e-1 # 1e-2, 1
def test_output_single_video(data_dir, video_names... |
ba5ed47dbc76cbe9e41ba1716d40ddb043275cbad5fc8cf0d4f0c1f2a78a0948 | Python | 6,351 | 141 | import pandas as pd
import numpy as np
from trained_untrained_results_funcs import max_across_nested
from trained_untrained_results_funcs
def return_frac_var_explained(submodel, submodel_with_LLM, LLM_perf):
'''
This function computes the omega metric.
:param df submodel: dataframe cont... |
3e143b5f61d48a240de2f8a3dfce7759abd49ac0a3424c1a23f3ce7e1714dbb7 | Python | 6,352 | 166 | """
components/models/gct_model.py — Graph Convolutional Transformer (GCT)
======================================================================
Wraps the P2 GCT implementation (``gct_model.py`` / ``src/gct_model.py``)
as a ``BaseModel`` registered under ``"gct"`` for MF framework usage.
The GCT (Cai et al., 2023) is... |
c5fa1589644fb991d0621e50b6e756f6234d1484b50e5247ca1b55a9ab6bd67d | Python | 6,352 | 175 | import torch
import torch.nn.functional as F
from torch.nn import Linear
from torch_geometric.loader import DataLoader
from sparse_mincut_pool import sparse_mincut_pool_batch
from torch_geometric.data import InMemoryDataset
from torch_geometric.nn import GraphConv
import os
import numpy as np
import pandas as pd
impor... |
dd6d95dcd52179b8144774b955e44ccb1b6272f4ded095374200f569edb155e3 | Python | 6,353 | 148 | import numpy as np
import pandas as pd
import vcf, glob, os, sys
_, scheme = sys.argv
# all isolates passing genotypic quality control and with MICs. Keep all the TRUST isolates. Don't add the mixed non-TRUST samples though
# df = pd.read_csv("./samples_pass_geno_QC.csv").query("F2 <= 0.1 | DB_OF_ORIGIN == 'TRUST'").... |
b618321e9d95da2f8145949a3185ceebc542b2059db38455a2cb74fb62297651 | Python | 6,357 | 171 | import functools
import logging
import re
import openmm
from openff.toolkit import ForceField, Molecule
logger = logging.getLogger(__name__)
def _shorthand_to_full_force_field_name(
shorthand: str,
make_unconstrained: bool = True,
) -> str:
"""Make i.e. `openff-2.1.0` into `openff_unconstrained-2.1.0.of... |
fdbd0b01558b715bbd59a53ffb0dc3f1fd08452a426e37faebb57edcd45d853c | Python | 6,357 | 215 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from collections import OrderedDict
from lxml import etree
from ..treebuilders.etree import tag_regexp
from . import base
from .. import _ihatexml
def ensure_str(s):
if s is None:
return None
e... |
b170a8f1af07a248daabacfa2d6b9c78b985b382981eff1c1b80870a5608af1d | Python | 6,360 | 219 | # %%
"""
Caliban: Nuclear Segmentation and Tracking
==========================================
Caliban is a pipeline for nuclear segmentation and tracking in live cell imaging datasets.
The models associated with Caliban can be accessed using `deepcell.applications`
with a DeepCell API key.
For more information abou... |
3a187542953fbdd126b8b9d121f73464885e55c45a3bd213bd95b39b4648eb16 | Python | 6,362 | 159 | """MultiQC submodule to parse output from deepTools plotProfile"""
import logging
from multiqc.plots import linegraph
# Initialise the logger
log = logging.getLogger(__name__)
class plotProfileMixin:
def parse_plotProfile(self):
"""Find plotProfile output"""
self.deeptools_plotProfile = dict()
... |
d071476521d76455d35da8f453071529d2390975558a2b52193f44e0c5329c31 | Python | 6,363 | 188 | # -*- coding: utf-8 -*-
"""
Anterograde projection summary stats.
- Loads anterograde volume and masks by subdivision
- Calculates projection strength and projection density
- Saves as a csv
"""
import os,re,csv
import urllib.request as request
import pandas as pd
import SimpleITK as sitk
from pathlib import Path
... |
dd645eddc9bed00eca6e62917ed024dfdc0b355c453c1e84c8abfa47b63cbec1 | Python | 6,364 | 219 | import argparse
import traceback
import shutil
import logging
import yaml
import sys
import os
import torch
import numpy as np
import torch.utils.tensorboard as tb
# from runners.diffusion import Diffusion
from guided_diffusion.diffusion import Diffusion
torch.set_printoptions(sci_mode=False)
def parse_args_and_co... |
2bd2b786142821fd67f4327385e11eff8aebb8f587c7dc6adad08327d6b2cb0c | Python | 6,366 | 194 | #!/usr/bin/env python3
import argparse
import json
import os
import sys
from typing import Dict, List
import urllib.parse
import urllib.request
import pandas as pd
DEFAULT_ENDPOINT = "https://ubergraph.apps.renci.org/sparql"
# --------------------------
# Generic SPARQL query
# --------------------------
GENERIC_QUE... |
fe362a0a1650e27211ece478b5ea12bf4ca48cacf40fe2d082993e1fa4cd567c | Python | 6,366 | 155 | import json
import logging
import os
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import linegraph
from multiqc import config
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule):
"""
The Salmon module parses `meta_info.json`, `lib_format_cou... |
6e3d9e8a8dc54a877255d65c754de123c13cf255a9b4fc1071b30e96e767f85c | Python | 6,367 | 222 | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 16 14:46:31 2019
@author: djk
"""
import numpy as np
def gd2gc(h, gdcolat):
"""Geodetic to geocentric colatitude calculation.
Use WGS84 values for equatorial radius and reciprocal flattening
"""
eqrad = 6378.137
flat = 1/298.257223563
plrad =... |
0d09e3926a470229559d068573feac21bdc32d3e424bddd52a38d14b4e8a8357 | Python | 6,371 | 177 | import logging
import re
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import bargraph
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule):
"""
SeqyClean is a comprehensive preprocessing software application for NGS reads, that removes noise ... |
0ab697bf5536701ab78a37dc2c7a683116cfacbd1659835013f3181df79ef343 | Python | 6,377 | 171 | """MultiQC submodule to parse output from Picard MeanQualityByCycle"""
import logging
from typing import Any, Dict
from multiqc.plots import linegraph
from .util import read_histogram
# Initialise the logger
log = logging.getLogger(__name__)
def parse_reports(self):
"""
Find Picard QualityByCycleMetrics r... |
517360c1247dc93378fc9460c9a79b2fcfcba146b3526f788c21390e749eb707 | Python | 6,377 | 218 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from typing import Any, List, Tuple, Union
import numpy as np
import pytest
from aicsimageio import AICSImage, dimensions, exceptions
from aicsimageio.readers import OmeZarrReader
from aicsimageio.tests.image_container_test_utils import run_image_file_checks
from ...con... |
116d1d2b9c42d9859428e101e2c2dc57aa20b86f656e6f115c404c29b4e3bcb9 | Python | 6,380 | 168 | import pickle
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.isotonic import IsotonicRegression
from sklearn.metrics import brier_score_loss, log_loss
class simCalibration():
def __init__(self):
self.calibrators = {}
self.global_calibrator... |
39999afa55f637ffd1117a40e5ea2a3372a597d021bbb2e99b3945a552d6038d | Python | 6,383 | 183 | # 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 gufe
import numpy as np
import openfe
import pytest
from openff.units import unit as offunit
from pontibus.protocols.solvation import ASFEProtocolResult
... |
48783aa0cd225e6cb567feaad0671055d592fe9657aaabb755540a985f8bd16b | Python | 6,383 | 170 | import logging
import re
from typing import Dict
from multiqc import BaseMultiqcModule
from multiqc.plots import bargraph
log = logging.getLogger(__name__)
VERSION_REGEX = r"sambamba ([\d\.]+)"
def parse_sambamba_markdup(module: BaseMultiqcModule) -> int:
"""
Find and parse Sambamba Markdup output log file... |
e62d9b848e472d60c05236748abeede91282aa804b82ac3d1d699559935458e8 | Python | 6,386 | 202 | """
Active project configuration management.
This module handles the active project selection and automatic config loading.
It reads the active_project.yaml file to determine which project config to use.
"""
import logging
import os
from typing import Any
import yaml
from ..utils.exceptions import ConfigurationErro... |
3524da3753e6dea6f99c1bb489c978b66ef3a7992e16c988018d4a61ac719fdc | Python | 6,390 | 213 | from pathlib import Path
import pytest
import yaml
from kimmdy.config import Config
from kimmdy.parsing import read_top
from kimmdy.runmanager import RunManager, get_existing_files
from kimmdy.topology.ff import FF
from kimmdy.topology.topology import Topology
@pytest.mark.require_gmx
def test_parse_config1_casting... |
139f9266e0777fc831f00d201b397c863ee6f6e02744fe1cc7f35e6a2e024c16 | Python | 6,394 | 168 | """
Schema Generator Agent - Creates LinkML schemas via prompt-based generation.
"""
import logging
from pydantic_ai import Agent
from .schema_generator_config import SchemaGeneratorDependencies, get_linkml_deps
logger = logging.getLogger(__name__)
SCHEMA_GENERATOR_SYSTEM_PROMPT = """
You are an expert LinkML schema... |
cb90ca0eebe1a22e5c2b987b18a502b2ad72529ece01e4d7e15e1b173de91e85 | Python | 6,400 | 206 | # ================= Libraries for Divider =================
import numpy as np
import torch.nn.functional as F # type: ignore
import matplotlib.pyplot as plt
# ================= Libraries for Polynomial =================
import torch # type: ignore
import numpy as np
from scipy.special import comb
from itertools impor... |
1080bdbf5b01fe1440574d1716e817050208763e0c601f4829befa31bfacb439 | Python | 6,401 | 206 | """Performance and benchmark tests for TimeFlies."""
import time
from pathlib import Path
import numpy as np
import pytest
from tests.fixtures.unit_test_data import (
create_sample_anndata as create_small_test_anndata,
)
class TestDataPerformance:
"""Test data loading and processing performance."""
@p... |
25dfbf3db47dbcd0a7add1dcb9519f9d4790b14d3c2676818b6a1e6ada17cbcd | Python | 6,406 | 175 | # -*- 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 ... |
691960cee3a0dc7bfdf0e60ccc92aea1139d3cae678c834d098d10b4e8d3cabb | Python | 6,409 | 170 | import logging
import traceback
import numpy as np
from typing import Tuple
from scipy.stats import pearsonr
from scipy.ndimage import _ni_support, label, find_objects, distance_transform_edt
from scipy.ndimage.morphology import distance_transform_edt, binary_erosion, generate_binary_structure
"""
The MedPy library ha... |
484135bf1187c97f7bd3dd01e2c654ea4af6fce0227f88ddab048382ccbf476a | Python | 6,411 | 179 | import json
import logging
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import bargraph, scatter
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule):
def __init__(self):
super().__init__(
name="SexDetErrmine",
anc... |
3df94cf60e8ab75a54219abc09117abed1794b3db518f12e7de5fe5b373dbd45 | Python | 6,420 | 168 | from config import TESTING_MODE
if TESTING_MODE:
from dummy import DAQIn, DAQOut, Trigger
elif not TESTING_MODE:
import PyDAQmx as pydaq
from PyDAQmx.DAQmxCallBack import *
import numpy as np
import multiprocessing as mp
import warnings, threading, logging, copy
from util import now,now2
... |
7d20b8e0f7440f0915a0d784ba746caf509b76e800e0ad880274499967ca05b1 | Python | 6,421 | 192 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Train a VGG16-based CNN model on DNA sequences to classify chromatin accessibility.
This script includes data preprocessing, dataset construction, model definition, and training loop with early stopping.
"""
import os
import sys
import re
import numpy as np
import torc... |
efe9f509b14597f2db5d507d793baf296b50cb632080caa34bb58624f4ea966d | Python | 6,422 | 206 | #!/usr/bin/env python3
import cv2
# from cv2 import aruco
from tqdm import trange
import numpy as np
import os, os.path
from glob import glob
from collections import defaultdict
import pandas as pd
## TODO: rewrite this whole file with aniposelib
from .common import \
get_calibration_board, get_board_type, \
... |
ec15580403a771948c76b9397da3af10058ccdfc961ba5b285b0055e858370f4 | Python | 6,425 | 124 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import inspect, re, glob
from os import path
from collections import OrderedDict
from tkinter.messagebox import NO
import numpy as np
import pandas as pd
from . import dicom
preset4sequence = {
'epfid2d1': 'ep2d',
'ep3Dfid3d1': 'ep3d',
'tfl3d1rr_ns': 'mprage',... |
ba9aceac89200a73897ec03cf84eee65b400e4807841fdd729850762591e18f6 | Python | 6,429 | 174 | import configparser
from datetime import datetime
from pathlib import Path
import pandas as pd
import hrpqct_database.dataclasses_hrpqct as dataclass_hrpqct
import hrpqct_database.statistics_hrpqct as statistics_hrpqct
import hrpqct_database.utils.expand_database as db_utils
from hrpqct_database.gen_pdf import PDF
# ... |
62e828e4f076ddedca8961dcc63f2bcf480740cc8b2b9cc711c9219fe89a4dfa | Python | 6,433 | 131 | import pathlib
import os
import numpy as np
import pandas as pd
import torch
from torch.utils.data import Dataset
import torchvision.transforms as transforms
from PIL import Image
from multiprocessing import Process
import xlrd
import xlwt #对xls文件进行改写
#from xlutils.copy import copyasf
import matplotlib.py... |
7c315e4f44322930c4873234aded43b5840aabc0cad9a9bfd96c6575591fdba7 | Python | 6,437 | 198 | """ Script to summarize content in an ontology """
import argparse
from datetime import datetime
import pandas as pd
from rdflib import Graph
class OntologyContentReport:
"""Generic class for summarizing content in an ontology"""
def __init__(self, ontology_iri, ont_namespace):
"""
Initializ... |
92b7d34a3885caf4ffd683ff947f4f0f47f37648a82ba35d57e7230227d8d367 | Python | 6,439 | 217 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pathlib
from typing import Callable, List, Optional, Tuple
import numpy as np
import pytest
from ome_zarr.io import parse_url
from ome_zarr.reader import Reader
from aicsimageio import exceptions
from aicsimageio.writers import OmeZarrWriter
from ..conftest impor... |
a36760bc75ca3447606650831245886eff442ced697b06d78368591e96f7f856 | Python | 6,439 | 163 | """Defining the NAGLToolkitRegistry class."""
from typing import List, Optional
from openff.toolkit.utils.toolkit_registry import (
ToolkitRegistry as _ToolkitRegistry,
ToolkitUnavailableException,
)
from openff.nagl.toolkits._base import (
NAGLToolkitWrapperMeta,
NAGLToolkitWrapperBase,
ToolkitW... |
35fc23e552419a53ebf12de5eb39a276aeb379f3f49ad5cf85ad0527a8c18feb | Python | 6,440 | 163 | import torch
import torch.nn as nn
import torch.nn.functional as F
import matplotlib.pyplot as plt
import numpy as np
import math
from math import sqrt
import os
class AutoCorrelation(nn.Module):
"""
AutoCorrelation Mechanism with the following two phases:
(1) period-based dependencies discovery
(2) t... |
0264bbe9c376293b1044facdb10ab82c286048ff87d5cc6b95fa104e4a8710b3 | Python | 6,444 | 202 | """A model that can detect whether 2 cells are same, different, or related."""
from dataclasses import dataclass
from pathlib import Path
import tensorflow as tf
import deepcell_tracking
from deepcell.applications import Application
from deepcell.utils import fetch_data, extract_archive
@dataclass
class Config:
... |
1dbdc7a1f71acab6e3ab234f5f1a542bd3cb7bbd1eda9e701b190e12e5bffff1 | Python | 6,446 | 188 | import inspect
import pytest
from unittest import mock
from matplotlib import pyplot as plt
import matplotlib
import matplotlib.figure
import importlib.resources
from openfe.utils.atommapping_network_plotting import (
AtomMappingNetworkDrawing, plot_atommapping_network,
LigandNode,
)
from openfe.tests.utils.t... |
81e9f06c3ddf091b719aa6650a5a07c23d596a8ab41318d4109af0b2723ea530 | Python | 6,450 | 173 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------------------------------------
NeuroBED_ML Visualization
Δ bACC Bars — best SINGLE vs best MULTI per classification target
-------------------------------------------------------------------------------
Aut... |
205cd3eea4c9d923ea06b8395d3e36563670ea1441d5614e9076868499211474 | Python | 6,451 | 132 | import pathlib
import os
import numpy as np
import pandas as pd
import torch
from torch.utils.data import Dataset
import torchvision.transforms as transforms
from PIL import Image
from multiprocessing import Process
import xlrd
import xlwt #对xls文件进行改写
#from xlutils.copy import copyasf
import matplotlib.py... |
b5dd013a3e25e7434acf61be4cf014570302dbee91f0dd1807f8351fdd409194 | Python | 6,457 | 157 | #!/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
# ... |
26c980594aebe9d21250db41885b839062d557cc542b2e175a8bae6203e69ea3 | Python | 6,460 | 155 | import numpy as np
import pandas as pd
import networkx as nx
from .utils import create_cell_labels
from anndata import AnnData
def extractMetaClusters(data, mn_key="MetaNeighborUS_1v1", threshold=0, outlier_label="outliers"):
"""Extract MetaClusters from MetaNeighborUS results
Extract groups of reciprocal to... |
3272d11346b241438f371de20912919398db1b982e8379c2d700356184249df0 | Python | 6,462 | 181 | #!/usr/local/bin/env python
"""
Test storageinterface.py facility.
The tests are written around the netcdf storage handler for its asserts (its default)
Testing the storage handlers themselves should be left to the test_storage_iodrivers.py file
"""
# ================================================================... |
69230c25b67589750b8f1027bfe856b95c43413df6cc3a088ca1bb3c818be676 | Python | 6,463 | 234 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from typing import List, Tuple, Type
import numpy as np
import pytest
from ome_types import OME
from aicsimageio import AICSImage, dimensions, exceptions, readers
from aicsimageio.readers.bfio_reader import OmeTiledTiffReader
from aicsimageio.readers.reader import Reader... |
f68aa34d707b82deea75eacb93895cd93e6f68dffa32b265183288f68d41e778 | Python | 6,463 | 203 | import gzip
import numpy as np
import pyBigWig as pbw
import pandas as pd
class Feature():
def __init__(self, **kwargs):
self.load(**kwargs)
def load(self):
raise Exception('Not implemented')
def get(self):
raise Exception('Not implemented')
def __len__(self):
rai... |
a9d3aada7c84a3094702921d96a8a1bed575ffa12f6364e3f4ce55e60c3da7ae | Python | 6,470 | 190 | """
src/augmentation/instance_augmentor.py
Constructive Instance Space Population via Quality Perturbation
Reference:
Levine et al. (Cell 2015) — perturbation-response profiling to reveal
hidden functional states; analogously, quality perturbations reveal
hidden data quality structures that determine metho... |
44b323f741131c817f068228003b4d2f149b3fb22355b7c97080d845920c103c | Python | 6,471 | 208 | """Utilities for testing with shapely geometries."""
from functools import partial
import numpy as np
import shapely
__all__ = ["assert_geometries_equal"]
def _equals_exact_with_ndim(x, y, tolerance):
dimension_equals = shapely.get_coordinate_dimension(
x
) == shapely.get_coordinate_dimension(y)
... |
163a7d0b8828ae8f3591a1806c174eb40f6751bdc1259654df6c926e2d75fdac | Python | 6,478 | 152 | # s3_hucsr_final_with_plots.py
# MODELO CLÍNICO FINAL → AUC 0.86–0.92+ con 86 pacientes / 938 series
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
from torch.cuda.amp import GradScaler
from pathlib import Path
import polars as pl
import numpy as np
from sklearn.... |
3eb6a3b15589ae759268bbd165c327d47c4faee0f3eae16e826bf131c3eabbfd | Python | 6,478 | 176 | import os as _os
import pathlib as _pl
import ftplib as _ftplib
import urllib as _urllib
import pickle as _pickle
import requests as _requests
import datetime as _datetime
__all__ = ['get_content_type', 'is_downloadable', 'is_text', 'download_file', 'save_text',
'is_ftp', 'download_ftp', 'download', 'load_... |
b7751003c47543693df4543d91a0bc21312d5809d5b43adaa3ac081415b8e4b4 | Python | 6,489 | 147 | from __future__ import annotations
from abc import abstractmethod
from dataclasses import dataclass
import torch
from torch import Tensor
from torch.nn import functional as F
from torchmetrics.classification import MulticlassAccuracy
from beyond_backprop.algorithms.algorithm import Algorithm, NetworkType
from beyond... |
0faa01ca2eebc4881d7a356b55cd8686d34882bc1654181fb5132ba4c8c1c304 | Python | 6,492 | 165 | """
engine/cutoff.py — Decision Threshold (Cut-off) Sensitivity Sweep
==================================================================
Sweeps the decision threshold from 0.0 to 1.0 and computes a per-threshold
metric table. Useful for clinical decision analysis where clinicians need
to choose a threshold based on th... |
e483c912d094c38a5c275d26c898d3fc518573a79a00f4e76601b4e6062eb1ac | Python | 6,492 | 178 | from pymbar import timeseries
from pymbar import testsystems
import numpy as np
from scipy import stats
import pytest
from pymbar.utils_for_testing import assert_almost_equal
try:
import statsmodels.api as sm # pylint: disable=unused-import
HAVE_STATSMODELS = True
except ImportError as err:
HAVE_STATSMO... |
2bfac812e81fe030382ffa6f181ce5d5652d231f4c8afef742e1369cf31b9f46 | Python | 6,494 | 165 | # -*- 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 ... |
1599ae296abb42651d61e8c47bf9d2534c7b55def5f11080ff26d4b0646f0be8 | Python | 6,495 | 155 | #!/usr/bin/env python3
"""
Analyze chromosome-level coverage from txt.raw.gz file.
Groups by chromosome and cell, sums Watson (w) and Crick (c) strand reads.
Recommends best chromosomes for test data selection.
Usage:
python analyze_chrom_coverage.py --sample LanexLorenzoNPCDMSO18holdSortUVLED
"""
import argpars... |
4bdf25abbc6ec3e9953ef7384aad1ffadcaf7a8edd69b8ce16af6dcc3d951f24 | Python | 6,496 | 167 | from __future__ import annotations
import logging
import textwrap
from pathlib import Path
from typing import Optional
from kimmdy.constants import FFFUNC
from kimmdy.parsing import read_top, read_edissoc
from kimmdy.topology.atomic import (
AngleId,
AngleType,
AtomId,
AtomType,
BondId,
BondTy... |
454c47b00801ecc70852244aaa59334ecd7e1885c30c2748944752af485b29b6 | Python | 6,502 | 163 | import json
import pytest
from multiqc import config, report
from multiqc.base_module import ModuleNoSamplesFound
from multiqc.modules.mgnifam import MultiqcModule
from multiqc.types import ColumnKey, SampleGroup, SectionKey
def _stats(command="generate_families", **changes):
stats = {
"tool": "mgnifam"... |
a45103a0f913d0898b9b3d3eacf96b217ef2e72fce8150d10eba91da3bf1f72a | Python | 6,503 | 147 | from pytfa.io.json import load_json_model
from skimpy.io.yaml import load_yaml_model
from skimpy.analysis.oracle.load_pytfa_solution import load_fluxes, \
load_concentrations, load_equilibrium_constants
from skimpy.analysis.ode import sample_initial_concentrations
from skimpy.core.solution import ODESolutionPopulat... |
7967058319bc6e338e0716de7463041e7be5c435b61eee2a9b64945c44393561 | Python | 6,506 | 185 | #!/usr/bin/env python
"""
md_chain
========
This script is a part of ForceBalance and runs a chain of simulations that can
be used to compute any thermodynamic properties.
This script is meant to be launched automatically by ForceBalance.
"""
#==================#
#| Global Imports |#
#==================#
from bui... |
89cbf10af5c7a8431b7dea43d485c6f18ee96f1c8afeb29df703969cc04fefdd | Python | 6,506 | 132 | import pathlib
import os
import numpy as np
import pandas as pd
import torch
from torch.utils.data import Dataset
import torchvision.transforms as transforms
from PIL import Image
from multiprocessing import Process
import xlrd
import xlwt #对xls文件进行改写
#from xlutils.copy import copyasf
import matplotlib.py... |
0eaf47f96f7716b1e400509ddc93c4f9bb8fc16e09ad98b9a5aec2273d549834 | Python | 6,516 | 225 | # ---------------------------------------------------------------
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
# ---------------------------------------------------------------
""" Originated from https://github.com/rosinality/stylegan2-pytorch
The license for the original version of this file can be... |
00789864893bc0e6df9205d81de2af9a980bf5d6a021d6b2a444d8ab9e7d0fa8 | Python | 6,525 | 101 | # --------------------------------------------------------
# Swin Transformer
# Copyright (c) 2021 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ze Liu
# --------------------------------------------------------
from .swin_transformer import SwinTransformer
from .swin_transformer_v2 ... |
675758c1675ef298fb2ef8606edddf21a0b10428e6b31d596172ce2cc1a02217 | Python | 6,525 | 167 | """MultiQC submodule to parse output from Picard BaseDistributionByCycleMetrics"""
import logging
from collections import defaultdict
from typing import Dict, List
from multiqc.modules.picard import util
from multiqc.plots import linegraph
# Initialise the logger
log = logging.getLogger(__name__)
def parse_reports... |
aec0c7bbeb9dc04219c1a2c544d871ccc69cea2258116451cf3a6632d02ee847 | Python | 6,532 | 138 | import sys
print(sys.version)
import torch
print(torch.__version__)
import pathlib
import os
import numpy as np
import pandas as pd
import torch
from torch.utils.data import Dataset
import torchvision.transforms as transforms
from PIL import Image
from multiprocessing import Process
import xlrd
impo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.