sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
f6ef93510239423d967eeba0330196169acb710d1adcaaed4d7ac9e6be8e45e6 | Python | 5,970 | 172 | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
6a4e18650e73da4d1c0dd7c73efeeade873a7a3e4bcb44ca43bafc5927f57197 | Python | 5,971 | 178 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
import io
from typing import Dict, Tuple
import matplotlib
from gufe.visualization.mapping_visualization import (
draw_one_molecule_mapping,
)
from rdkit import Chem
from openfe import ... |
17cebcce96672032c2f9322c8ce01be9c807d7c47b526af394e264788e7aa88a | Python | 5,973 | 155 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------------------------------------
NeuroBED_ML – Regression
Heatmap: targets × (grouped single-modality) mean test R²
-------------------------------------------------------------------------------
Descri... |
645488a97d02e968b38b179c0a1677fe8932bbb044bf4959bb5553d2cea1e123 | Python | 5,985 | 170 | from __future__ import absolute_import
from .filepost import encode_multipart_formdata
from .packages.six.moves.urllib.parse import urlencode
__all__ = ["RequestMethods"]
class RequestMethods(object):
"""
Convenience mixin for classes who implement a :meth:`urlopen` method, such
as :class:`urllib3.HTTPC... |
a161d4bb6d8d6ca4f1c039e33bcdd15ccfe2e489d77b3122d02f1e1d5051429e | Python | 5,986 | 159 | #!/usr/bin/env python3
"""
Experiment 04 — Decoupling Analysis
======================================
Computes 10×D_dynamic Spearman correlation matrix between static and dynamic
fingerprints (V2: 10×10). Identifies coupled/orthogonal dimension pairs and
computes coupling weights.
Runtime: ~1 minute
Usage:
python... |
ab58a83df17602d2e1d56af3926ca4a4b11b17673cf826780d9ed468c42421a0 | Python | 5,990 | 137 | # !/usr/bin/env python
# -*-coding:utf-8 -*-
# @Time : 2022/07/14 17:24
# @Author : Liangdi.Ma
import torch
from torch import nn
from .embedding import WordAndPositionalEmbedding
class TransformerTextualHead(nn.Module):
def __init__(self, config, visual_embedding_size):
super().__init__()... |
e4a0a2877ab3ac41a5236fc2bc9da9dfb30e895db778e60017eadeec9e70d3cb | Python | 5,990 | 144 | 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):
def __init__(self):
super().__init__(
name="Topha... |
cbcfc451fdc2bd1df2c087faca7030ab754fd0250214463924562ea67d7c0490 | Python | 5,993 | 194 | """Decorators for Shapely functions."""
import os
import warnings
from collections.abc import Callable, Iterable
from functools import lru_cache, wraps
from inspect import unwrap
import numpy as np
from shapely import lib
from shapely.errors import UnsupportedGEOSVersionError
class requires_geos:
"""Decorator ... |
65d7764f5c351aaaab0b5b517979eee203ef15c3d29cb7b45dd6012273787ce1 | Python | 5,994 | 147 | import logging
import os
import re
from typing import Dict, Optional
from multiqc import config
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import bargraph
from multiqc.plots.bargraph import BarPlotConfig
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiq... |
8d65897d2de3cab399dd32f2ee5c83b9885fa1e417f2793225479f5b67162b0e | Python | 5,997 | 180 | import logging
import sys
from pathlib import Path
import multiprocessing as mp
import json
# --- CONFIGURACIÓN GLOBAL DEL LOGGER ---
_logger = None
_log_file = None
_metrics_file = None
def init_logger(name: str, log_dir: str = "logs", metrics_file: str = "log_metrics_rsna.json"):
"""
Inicializa el logger co... |
1d4dfd780618a81867943ce7a64ad5f08f32118269729d4800fb7f4dfd205361 | Python | 5,998 | 186 | import textwrap
from experiments.em_numbers import plot, refs
from refs import llm_41_student_refs
from truesight.db.session import get_session
import matplotlib
import matplotlib.pyplot as plt
from truesight.llm import judgments
matplotlib.use("WebAgg")
async def main():
with get_session() as s:
await ... |
f044819b2c08f33b986d360a6b61d49c8ae78680d1fb2eea7f743e0be035d368 | Python | 5,999 | 189 | import numpy as np
import pytest
from shapely import (
GeometryCollection,
LinearRing,
LineString,
MultiPolygon,
Point,
Polygon,
)
from shapely.geometry.base import dump_coords
from shapely.tests.geometry.test_multi import MultiGeometryTestCase
class TestMultiPolygon(MultiGeometryTestCase):
... |
67eeec9721c1e1db55739a5627f57e4a21ca79ba156301e2915c57a8c8cd4d02 | Python | 6,000 | 141 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on 12/14/2021
Base model class
Author: dzhi, jdiedrichsen
"""
import numpy as np
import torch as pt
from copy import copy, deepcopy
class Model:
"""Abstract class for models
Implements two behaviors:
- param_list: These is the list of free par... |
12087dbf759ae71fbacb679e2614183a3be6b4ff1a1972f6d4b33445c2aa90df | Python | 6,003 | 143 | from typing import *
from collections import defaultdict
import logging
import velocyto as vcy
class Feature:
"""A simple class representing an annotated genomic feature (e.g. exon, intron, masked repeat)"""
__slots__ = ["start", "end", "kind", "exin_no", "is_validated", "transcript_model"]
def __ini... |
321b94851bf63040d81e3f0210d0d9d986244430116b662edcf3da4d4c708ce3 | Python | 6,006 | 162 | import logging
import re
from typing import Dict, Optional
from multiqc import config
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import bargraph
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule):
"""
RiboDetector is a deep learning-based... |
b1c49e42f4fcbe76cabfac8068b9761b7612e7efaa53dae78d9c3ac1bedee363 | Python | 6,010 | 195 | import numpy as np
def get_area_under(neuron_act, start=2500, end=4500):
# Let's calculate the positive and negative area separately
positive_area = np.sum(neuron_act[start:end][neuron_act[start:end] > 0])
negative_area = abs(np.sum(neuron_act[start:end][neuron_act[start:end] < 0]))
return positive_a... |
63bef4e024a563c4e5bedf7fcb20b36deeab0b3006afff11bd9aca0f5d955075 | Python | 6,011 | 160 | import datetime
import tempfile
import asyncio
from typing import Optional
from uuid import UUID
from openai.types.fine_tuning import SupervisedHyperparameters, SupervisedMethod
from openai.types.fine_tuning.fine_tuning_job import Method
from sqlalchemy import select, update
from truesight.daemon import BaseDaemon
fr... |
2814088e278b4066479f91a34f76f515620142318423c7be10ed12d22b8df291 | Python | 6,014 | 121 | from PySide6.QtWidgets import QLabel, QHBoxLayout, QPushButton
from PySide6.QtCore import QSize, Qt, Signal
from PySide6.QtGui import QIcon
class QCustomIconsPushButton(QPushButton):
"""
"""
bool_clicked = Signal(bool)
right_clicked = Signal(str, bool)
def __init__(self, uid, parent=None, icon_s... |
140a087c851235fe4e589613ee7863142d2e3958a31cc05de7a0094722cddb7d | Python | 6,017 | 183 | # -*- encoding: utf-8 -*-
#
# Copyright 2016–2021 Julien Danjou
# Copyright 2016 Joshua Harlow
# Copyright 2013-2014 Ray Holder
#
# 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.... |
4da8419af88facf8ee0f0078442fa79081e649ddd92cade45e4097c24d0a9dbc | Python | 6,022 | 184 | """Central logging configuration for the ethopy package.
This module provides a consistent logging setup across all ethopy modules,
supporting both file and console output with appropriate formatting.
"""
import logging
from logging.handlers import RotatingFileHandler
from pathlib import Path
from typing import Optio... |
3135bf81170da5d29f57bd292027b3cc42a01f38e5d1c33ad56a2e68a9a5f0eb | Python | 6,033 | 170 | #! python
# -*- coding: utf-8 -*-
from typing import Dict, List, Optional, Tuple, Union
import numpy as np
import pandas as pd
from gseapy.base import GSEAbase
from gseapy.gse import CorrelType, ssgsea_rs
from gseapy.utils import mkdirs
class SingleSampleGSEA(GSEAbase):
"""GSEA extension: single sample GSEA"""
... |
d5c103aaabb660f726f0eaca7ff3f43c01c3caddc2ce19e5b8ff9def552de202 | Python | 6,033 | 149 | import logging
from multiqc.base_module import BaseMultiqcModule
from multiqc.plots import bargraph
log = logging.getLogger(__name__)
class DragenRnaQuantMetrics(BaseMultiqcModule):
def add_rna_metrics(self):
data_by_sample = dict()
has_old_style = False
has_new_style = False
fo... |
42d730a90a679ec3b62cc2040e794929c7a9f348d139c24a285741704883ff92 | Python | 6,034 | 153 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------------------------------------
NeuroBED_ML Visualization
Heatmap — (group × target) × grouped single-modality (mean test R²)
-------------------------------------------------------------------------------
Author... |
4627101629514bf197b4162bb6daf39653359e9b6b1a7b5a8c73645a33c65b0d | Python | 6,034 | 201 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
### ----------------------------------------------------
# PLOTTING AND REPORTING
###----------------------------------------------------
def parse_generators(root):
"""
Expected structure:
genXX/
genXX_seed6.... |
d0f14837a0013a50e8034151c8494d8cea8261333ee125dd4d1258ee453b8c25 | Python | 6,039 | 175 | """Classify the type of an input image to send the data to the correct model"""
import os
import numpy as np
import tensorflow as tf
from deepcell.applications import Application
from deepcell.layers import ImageNormalization2D
from deepcell.layers import TensorProduct
from deepcell.utils.backbone_utils import get_... |
6b7ae7a1407f1d37446c368050748d30f207a8776ce1403e98b4396ef80e8d24 | Python | 6,045 | 193 | import fnmatch
import os
import os.path
import random
import shutil
import stat
import sys
from contextlib import contextmanager
from tempfile import NamedTemporaryFile
from typing import Any, BinaryIO, Iterator, List, Union, cast
from pip._vendor.tenacity import retry, stop_after_delay, wait_fixed
from pip._internal... |
302bdf89d51c3802121f2fa54ea89aa97d7f83d6efb6abcfa4315a43dd0783c8 | Python | 6,046 | 164 | """
viz/regime.py — Fig 5-9: Condition-Stratified Winners + Oracle Gap
===================================================================
"""
from __future__ import annotations
from pathlib import Path
from typing import Dict, List, Optional, Tuple
import numpy as np
from .mdpi_style import (
FS_LABEL,
FS_... |
7c5d911fa5426a74ee17e8b0bbcb5963c061d056a40c14f0eed9032724eccbd1 | Python | 6,047 | 198 | from pip._vendor.packaging.specifiers import SpecifierSet
from pip._vendor.packaging.utils import NormalizedName, canonicalize_name
from pip._internal.req.req_install import InstallRequirement
from .base import Candidate, CandidateLookup, Requirement, format_name
class ExplicitRequirement(Requirement):
def __in... |
932d04977a6abef3cb6326f4016eec75252c83ec29ad624146015a02407a44b7 | Python | 6,048 | 157 | import logging
import re
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import linegraph
log = logging.getLogger(__name__)
VERSION_REGEX = r"skewer v([\d\.]+) \[.+\]"
class MultiqcModule(BaseMultiqcModule):
def __init__(self):
super().__init__(
na... |
cb9bd3f9e4cdd118c77027dd3ddbe1be065260fcb87913d7339a084fac82d6c1 | Python | 6,048 | 136 | # 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... |
ecfc8c84b40565c185ba9cb5666f51f68d96e420f8335f4330961040d6d5377d | Python | 6,053 | 168 | import tensorflow as tf
import numpy as np
from common import log, b_dot, b_mult, Config
import time
from matplotlib import pyplot as plt, rcParams
rng = np.random.default_rng()
tf .get_logger().setLevel('ERROR') #remove warning messages for taking second derivatives
rcParams['figure.dpi'] = 600
#sol... |
500666dd29f510e9500a30f09ca701ac9cda99510464aaac32545792f4035a24 | Python | 6,056 | 163 | """Data loading utilities for TimeFlies project."""
import os
from pathlib import Path
from typing import Any
import pandas as pd
import scanpy as sc
from anndata import AnnData
from ..utils.path_manager import PathManager
class DataLoader:
"""
A class to handle data loading operations.
This class man... |
f9085c5e9578567a3190b36bc084d19c6e281108471500e4d39b0a8fb2ce68db | Python | 6,057 | 204 | # -*- 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
Licens... |
19b50067cac6a8fb9ab3a21ee1ab2298efd2932961b8822c0136adfb3ca11c75 | Python | 6,058 | 188 | """
Tools for the Ontology Mapper agent.
"""
import asyncio
from functools import lru_cache
from typing import Dict, List, Optional
from oaklib import get_adapter
from pydantic_ai import RunContext, ModelRetry
from aurelian.utils.ontology_utils import search_ontology
from aurelian.utils.search_utils import web_search... |
2869baff474ca1b82cacc99077aad5d30877d166ddcbbcc54db6a162d4dd30ce | Python | 6,060 | 125 | from PySide6.QtWidgets import QWidget, QLabel, QHBoxLayout, QVBoxLayout, QScrollArea, QPushButton, QSizePolicy, QGridLayout, QSpacerItem
from PySide6.QtGui import QIcon, QPixmap
from PySide6.QtCore import QSize, Signal
from gui.UtilsWidgets.QCustomIconsPushButton import QCustomIconsPushButton
class QCollapsibleGroup... |
efec31d405b9689470570e49e666eb90c79f29494da57adf1478a51e9770be87 | Python | 6,060 | 165 | """MultiQC submodule to parse output from Picard RrbsSummaryMetrics"""
import logging
from typing import Dict
from multiqc.modules.picard import util
from multiqc.plots import bargraph
# Initialise the logger
log = logging.getLogger(__name__)
def parse_reports(module):
"""Find Picard RrbsSummaryMetrics reports... |
d649d9c948ee96daac6ccd5dd7676ce7d04299b9077bc2445846688271b264b0 | Python | 6,065 | 122 | import os
import numpy as np
import pandas as pd
from multiprocessing import cpu_count, pool
from matplotlib import pyplot as plt
from scipy.signal import savgol_filter
import percephone.core.recording as pc
import percephone.plts.stats as ppt
from Figures.response_decoding import get_activity_by_frame_df
def plot... |
41fe15d50c6cb9ba18e0c6d8b62d966b213ed6a16c977549b87ddf6906f369a4 | Python | 6,066 | 164 | """
components/datasets/kidney_dataset.py — FAHZU Kidney Dataset Adapter
=====================================================================
Wraps the P1 ``KidneyLoader`` as a ``BaseDataset`` registered under
``"kidney"`` for use in the MF framework pipeline.
The loader bridges P1's CSV-file-based data access and th... |
4aab82b78032fcee809296fd67b53599f1e100c80ed49e29f6d76daa8a06db48 | Python | 6,068 | 175 | """Metrics collection, caching, and export.
All training/evaluation data is cached as structured files (CSV, JSON, NPZ).
Visualization functions read from these caches — never from live training state.
"""
import json
import os
from datetime import datetime
import numpy as np
import pandas as pd
class MetricsLogge... |
f498642c9c9726ca1561b9a9cbbe05210169ac43d0d3e9a0dd76109b90abd5cb | Python | 6,068 | 166 | #!/usr/bin/env python3
import pandas as pd
import numpy as np
import pyBigWig
import matplotlib.pyplot as plt
import seaborn as sns
from scipy import stats
from pathlib import Path
import os
import logging
import argparse
import gtfparse
# Set up logging
logging.basicConfig(
level=logging.INFO,
format='%(asct... |
5c36f413a7449dd961cf166c0901da4484b2d1330296692880da01a0a0096b75 | Python | 6,069 | 165 | import os
import pathlib
from openmmtools import states
from openmmtools.states import GlobalParameterState
def serialize(item, filename: pathlib.Path):
"""
Serialize an OpenMM System, State, or Integrator.
Parameters
----------
item : System, State, or Integrator
The thing to be serializ... |
2674634f7f26775107527bf4a81b2859fb42a800d15278c0cfa57dde7d2038d4 | Python | 6,071 | 198 | """
Training utilities — epoch runners, validation, and computational profiling.
"""
import time
import numpy as np
import torch
import torch.nn as nn
from sklearn.metrics import (
precision_recall_fscore_support,
classification_report,
confusion_matrix,
)
# -------------------------------... |
16032107ef88c36e720a680d468677f2798286fe3a154885bea695c2cf20a197 | Python | 6,072 | 201 | #!/usr/bin/env python3
from mayavi import mlab
mlab.options.offscreen = True
import numpy as np
from glob import glob
import pandas as pd
import os.path
import cv2
import sys
import skvideo.io
from tqdm import tqdm, trange
import sys
from collections import defaultdict
from matplotlib.pyplot import get_cmap
from .co... |
e76aadf8a11afeefc2498ba8f7f6db9cb590c76d74a34c9d9cb260ac655abee0 | Python | 6,072 | 164 | from PySide6.QtWidgets import QWidget, QLabel, QHBoxLayout, QVBoxLayout, QScrollArea, QPushButton, QSizePolicy,\
QGridLayout, QSpacerItem, QStackedLayout
from PySide6.QtGui import Qt, QIcon, QPixmap, QFont
from PySide6.QtCore import QSize, Signal
import os
from abc import abstractmethod
class Header(QWidget):
... |
2683de9cacf84c08e7737d2d09980bb67c26d76e1e0f19b9e6961906ad7c9638 | Python | 6,073 | 154 | """
Measurements
============
Contains the :class:`Measurement` class which is used to define a single free energy difference,
as well as the :class:`ReferenceState` class which denotes the end point for absolute measurements.
"""
from cinnabar.vendor.openff.models.models import DefaultModel
from cinnabar.vendor.open... |
9148fe5b98a5b371f40558459c35b254ace437aaa243614db2c6228153fe173b | Python | 6,079 | 147 | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 20 09:08:37 2023
@author: ashwin.bhandiwad
"""
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from scipy.stats import boxcox
def subset_subcortical(overlap_data):
subcort_subset = pd.read_excel(path+'anterograde_ann... |
4431e365d29efa88ac0904c9b229e36365ed446520bae1504291be770b4f4ee4 | Python | 6,081 | 181 | class fg:
BLACK = "\u001b[30m"
RED = "\u001b[31m"
GREEN = "\u001b[32m"
YELLOW = "\u001b[33m"
BLUE = "\u001b[34m"
MAGENTA = "\u001b[35m"
CYAN = "\u001b[36m"
WHITE = "\u001b[37m"
ENDC = "\033[0m"
BOLD = "\033[1m"
UNDERLINE = "\033[4m"
def pipeline_aesthetic_start(config):
... |
dcdb8845dc305308de824f3ccc6c11c0c9755411ba18aad30cb81e1e26815b71 | Python | 6,082 | 161 | # coding=gbk
import os
import imageio
import numpy as np
import nibabel as nib
from tqdm import tqdm
from scipy import io
from scipy.signal import detrend
from scipy.ndimage import zoom
import matplotlib.pyplot as plt
if __name__ == '__main__':
subjects = ['S1', 'S2', 'S3', 'S4', 'S5', 'S6', 'S7', 'S... |
f0b24bb5f67df7301c578bca2756bea1d331836b042260fb44c360fc4adefb56 | Python | 6,082 | 206 | """Check a project and backend by attempting to build using PEP 517 hooks.
"""
import argparse
import logging
import os
from os.path import isfile, join as pjoin
from pip._vendor.toml import TomlDecodeError, load as toml_load
import shutil
from subprocess import CalledProcessError
import sys
import tarfile
from tempfil... |
f488380f02413a176f06904e796eac1c976fc4e0a1fec40f597828d4be8d6187 | Python | 6,084 | 186 | from __future__ import annotations
from collections import OrderedDict
from dataclasses import dataclass
from typing import ClassVar, TypeVar
import torch.nn.functional as F
from torch import Tensor, nn
from beyond_backprop.networks.layers import Reshape, Sequential
from beyond_backprop.utils.utils import list_field... |
b625370e1b922cfb79a78433791cb65e0c5dcdfb9637b898ae525eca84ccd505 | Python | 6,089 | 184 | """Unit tests for CLI commands functionality to increase coverage."""
import pytest
from timeflies.cli.parser import create_main_parser, parse_arguments
@pytest.mark.unit
class TestCLIArgumentHandling:
"""Test CLI argument handling and validation."""
def test_parse_arguments_all_commands(self):
"""... |
f091847f470694d1205393bc4c54742f080428d727e41b0e95c7872da749383e | Python | 6,094 | 138 | import numpy as np
from trained_results_funcs import find_best_layer
from plotting_functions import plot_across_subjects
from matplotlib import pyplot as plt
import pandas as pd
import seaborn as sns
from trained_untrained_results_funcs import calculate_omega
dataset_arr = ['pereira', 'fedorenko', 'blank']
feature_ext... |
967fdc8e4a6d26d5b7362b22740ad617556530ba3df1c6ffaea1c117af37911e | Python | 6,108 | 128 | 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... |
bfe31540a1d6a15cb3bcde59cbcce6cf686eff5a2d62d425ea754a35f3307a65 | Python | 6,113 | 155 | import unittest
import numpy as np
import psychofit as psy
class PsychofitTest(unittest.TestCase):
def setUp(self) -> None:
"""Data are 3 x n arrays"""
data = {'weibull50': np.vstack([
10 ** np.linspace(-4, -1, 8),
np.ones(8) * 80,
np.array([0.5125, 0.35, 0.5625... |
ed8e4c8c65b03c3c7da53721ff94a172466946849fd8a9bdee3ffc1d71ef4f6a | Python | 6,114 | 173 | """User interface to authentication layer for data/models."""
import os
import requests
from pathlib import Path
from hashlib import md5
from tqdm import tqdm
import logging
import tarfile
import zipfile
_api_endpoint = "https://users.deepcell.org/api/getData/"
_asset_location = Path.home() / ".deepcell"
def fetch... |
717b2ebc5754967f0f280ae84cee6676e8583f36a4f0a9a9cc998b3f0fc80121 | Python | 6,120 | 175 | import logging
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import bargraph, table
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule):
def __init__(self):
super().__init__(
name="MosaiCatcher",
anchor="mosaicatch... |
0ce2c585db3736eb041e99a788517ef2fa11a6aa22e11937cab15b0cb4037aac | Python | 6,126 | 150 | ###################### Enhanced Metrics for K-Fold ######################
def dice_coefficient_multiclass(y_true, y_pred, class_id):
"""Calculate Dice coefficient for specific class"""
y_true_class = (y_true == class_id).astype(np.float32)
y_pred_class = (y_pred == class_id).astype(np.float32)
... |
107f72c2e38975bc8b702b144618ddf309e65a55b5a56a775e33de3207745fb6 | Python | 6,126 | 126 | """
Théo Gauvrit 18/01/2024
Multiple Linear regression analysis
"""
import matplotlib
import numpy as np
from percephone.analysis.utils import kernel_biexp
import matplotlib.pyplot as plt
matplotlib.use("Qt5Agg")
plt.switch_backend("Qt5Agg")
def regressor_labels(rec, timings, duration, len_signal, amplitude=100):
... |
ad39d74231a2f4353e8d224c63c863b77592cbe8b0254d08084a265dc15aa375 | Python | 6,128 | 175 | 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 application fixture specifically for LDAP testing."""
# Override config for LDAP tests
app.config["USE_LDA... |
f7d9c15fa8a7c2965269910304d18ad1472dbf090ee5342faf854b5ebb37e3af | Python | 6,128 | 196 | from copy import copy
from collections import defaultdict
import pytest
from fastapi.testclient import TestClient
from gufe import AlchemicalNetwork, NonTransformation
from alchemiscale.settings import get_base_api_settings
from alchemiscale.storage.statestore import Neo4jStore
from alchemiscale.compute import api
f... |
8f602d763114fd5a00857498e6434e4e6c1d1eebdca53145673cab1398377964 | Python | 6,130 | 145 | """Super Special-Case MultiQC module to produce report section on software versions"""
import logging
from html import escape
from textwrap import dedent
from typing import Dict, List, Optional
from multiqc import config
from multiqc import report
from multiqc.base_module import BaseMultiqcModule
from multiqc.types i... |
1bf815e3fa7892dc59834933db0190d2ef2406e24163f1f48b5849c75b3dffd1 | Python | 6,131 | 176 | """Utils for data load, save, and process (e.g., prompt construction)"""
import json
import os
import re
import yaml
DOMAIN_CAT2SUB_CAT = {
'Art and Design': ['Art', 'Art_Theory', 'Design', 'Music'],
'Business': ['Accounting', 'Economics', 'Finance', 'Manage', 'Marketing'],
'Science': ['Biology', 'Chemis... |
ba3dc36c4d041ef2b3c4c2733633bc8bcc1edf1cd0dbbb7a7f1a529ec1456b8d | Python | 6,131 | 203 | #!/usr/bin/env python3
import numpy as np
from glob import glob
import pandas as pd
import os.path
import cv2
from tqdm import tqdm, trange
from collections import defaultdict
from scipy import signal
import queue
import threading
from aniposelib.cameras import CameraGroup
from .common import make_process_fun, get_n... |
fd6e741c6e2ffb96998bea8a9a1e3c45a50c59b873ae013e879fcbe1271ec099 | Python | 6,135 | 153 | import sys, os, shutil
import cando as cnd
cnd.get_test()
os.chdir("cando/data/v2.2+/test")
print(os.getcwd())
print('\n')
# Set all variables
matrix_file = 'test-matrix.tsv'
inds_map = 'test-inds.tsv'
cmpd_map = 'test-cmpds.tsv'
cmpd_dir = 'test-cmpds_mol/'
new_cmpds = 'test-new_cmpds.tsv'
#cmpd_scores = 'test-cmpd_... |
9e6c8ccaec731bcec337a2b7464d8c53324b30b47af4cad6a5d9c7ccec155304 | Python | 6,136 | 145 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
a724cc689d09b8f94ca205ec2cf3cf44758dba2bd0d45ebb602b8caa5da13a55 | Python | 6,139 | 165 | #! /usr/bin/env python
from __future__ import print_function
import argparse
import sys
import cyvcf2
import collections
def argument_parsing():
"""
Parse command-line options.
"""
parser = argparse.ArgumentParser(description='Split BND calls')
parser.add_argument('-v', '--vcf', metavar='input.vcf... |
92780a24cca87ddb029f0be886fb931c5231b6c232ab2d7a60350d3ca3a5281f | Python | 6,140 | 217 | from refs import llm_base_refs
from refs.paper import animal_preference_numbers_refs
from truesight import list_utils
from truesight.experiment.services import (
DatasetRef,
ExperimentDataRef,
ExperimentRef,
SystemPromptLLMRef,
)
_df_cache = {}
def _get_icl_prompt(dataset: DatasetRef, seed: int, n_s... |
7602cf013a94057af9bb4c3893add9d5654df1a6819ef957f9d01487a7d5c134 | Python | 6,149 | 194 | # -*- coding: utf-8 -*-
"""
.. module:: pytfa
: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 A... |
b471faf547d14a59fce79ffe9ed0c7b555975d7995947294a2c3ab5781894b0c | Python | 6,151 | 197 | # -*- coding: utf-8 -*-
"""
Created on Mon Jun 12 11:18:15 2023
@author: ashwin.bhandiwad
"""
import csv,multiprocessing,nrrd,json,sys,os
import numpy as np
from pathlib import Path
from anytree import Node
from neuron_morphology.swc_io import morphology_from_swc
from neuron_morphology.feature_extractor.data import D... |
060fa6c89a741dce1976aa7fa1a27a56df57b98ffb2b591014ae6b49dc747b49 | Python | 6,158 | 174 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
import io
import matplotlib
from rdkit import Chem
from typing import Dict, Tuple
from openfe.utils.network_plotting import GraphDrawing, Node, Edge
from gufe.visualization.mapping_visualiza... |
d4eb79d5551c265f603fa0ea486922593d77af516213a142d33a131b48aa049f | Python | 6,162 | 147 | #!/usr/bin/env python3
import argparse
import sqlite3
from functools import partial
from itertools import combinations, chain
from multiprocessing import Pool
from os import path
from pmapper.utils import load_multi_conf_mol
from pmapper.customize import load_smarts
from rdkit import Chem
from rdkit.Chem import AllCh... |
159f5b5696c628ca7f02aace8a3dda7fb16c37bd21a4ac5b41638541dfab7252 | Python | 6,166 | 143 | import logging
from multiqc import config
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import violin
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule):
"""
This module requires that PRINSEQ++ has been run with the flag `-VERBOSE 1`.
I... |
97fa75b6de8da99c45195e37273be66f670a53ac3904a410546408655991f5e6 | Python | 6,171 | 138 | # 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... |
c425983b86eea395dc65de1f0977a76e247d69b2f7410b773288724d9bc546e8 | Python | 6,173 | 181 | """Tests for AlchemiscaleBaseClientParam and environment variable handling."""
from contextlib import nullcontext
from enum import Enum, auto
import pytest
import warnings
from alchemiscale.base.client import AlchemiscaleBaseClientParam
class RecordType(Enum):
WARN = auto()
RAISE = auto()
NONE = auto()
... |
627a6683fc9af68c2f82ceab296e9ee88a20a45e6e350b7ba77f6180ddb4e94c | Python | 6,175 | 216 | # 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 pytest
from gufe.tests.test_tokenization import GufeTokenizableTestsMixin
from openfe.protocols import openmm_septop
@pytest.fixture
def protocol():
ret... |
93ea4a5d0a9f1a70995672fd206c55333b6018024980a4bf7f2d4b2cc3d4a5c8 | Python | 6,184 | 161 | # -*- 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 ... |
a31b486425f7b6bc6c1eccf941640f5f799ffe90ce10c983429eb66696d6e216 | Python | 6,188 | 199 | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... |
fcf9864d67fd19dd59969e5636c96b8c1e6aeddf75160b7fd0eeb94d38121364 | Python | 6,195 | 116 | import sys
import os
import glob
import re
import click
import numpy as np
import random
import string
import logging
from typing import *
import velocyto as vcy
from ._run import _run
# logging.basicConfig(stream=sys.stdout, format='%(asctime)s - %(levelname)s - %(message)s', level=logging.DEBUG)
def id_generator(s... |
53776450ab0aa5ad3b65c069825ae724a4d840625d6a54a8af986d1f405a7dcb | Python | 6,198 | 178 | #!/usr/bin/env python
from __future__ import print_function
from array import array
import sys
try:
import scipy
from scipy import sparse
except:
scipy = None
sparse = None
__all__ = ['svm_read_problem', 'evaluations', 'csr_find_scale_param', 'csr_scale']
def svm_read_problem(data_file_name, return... |
984c2f33e0f25992eb11c7e20d4e1c11e5409214af4faa30383c538f9078f425 | Python | 6,207 | 146 | #!/usr/bin/python
"""
A vendored and modified version of OpenMMTools' AbsoluteAlchemicalFactory.
The modifications here, although experimental, should support virtual sites.
"""
import copy
import logging
from openmmtools import forcefactories, utils
from openmmtools.alchemy.alchemy import (
AbsoluteAlchemicalF... |
c61546d08fb154cb99239124a3a50a54581e4a7722674c710522d10293e026f4 | Python | 6,208 | 146 | import regex
import nwalign as nw
import swalign
import string
def reverseComplement(sequence):
transtab = string.maketrans("ACGT","TGCA")
return sequence.translate(transtab)[::-1]
def regexFromSequence(seq, lookahead=True, indels=1, errors=7):
"""
Given a sequence with ambiguous base characters, retu... |
aad09694cd75df105500d3d8463b8475e71dd2dd678688edb9316ff6385cb1a3 | Python | 6,210 | 179 | #!/usr/bin/env python3
"""
Preprocess Registered Files - Final Production Version
====================================================
This script standardizes the input nifti imaging file spatially to reach a 1*1*N stack of data arrays.
It uses pixel spacing for rescaling to reach 1*1 resolution.
Then, it employs zer... |
81ae9c2bfac214437e363ec6a7749897fa5b59f10043efdba906afa0d66334dd | Python | 6,212 | 181 | import numpy as np
import pandas as pd
import os, glob, sparse, yaml
from Bio import SeqIO
BASE_TO_COLUMN = {'A': 0, 'C': 1, 'T': 2, 'G': 3, '-': 4}
import sklearn.metrics
import sklearn.utils
import scipy.stats as st
import matplotlib.pyplot as plt
import seaborn as sns
def plot_histories(path, patience_epochs=200,... |
67d0319eca04bdbd5526fc6e5098aac0ff0b37968f91eda56f9b835d0699f7bc | Python | 6,216 | 219 | import logging
from abc import ABC
from collections.abc import Callable, Iterator
from multiprocessing import Pool
from typing import Literal
import numpy
import openmm
import openmm.unit
from openff.interchange.exceptions import UnassignedValenceError
from openff.interchange.operations.minimize import (
_DEFAULT_... |
a42518d6cf2aa235d89700e6db8e82530149bafd86a3075812ca909d3ba2d6f5 | Python | 6,229 | 163 | """
:mod:`alchemiscale.compute.manager` --- compute manager for creating compute services
=====================================================================================
"""
from abc import abstractmethod
import logging
import time
from ..storage.models import (
ComputeManagerID,
ComputeManagerInstruct... |
80e8ff4e1dc5e15cfa59c0d8c554dd2a8da4ea403abb840bdba0c7437a79a468 | Python | 6,231 | 177 | #!/usr/bin/env python3
import argparse, math, csv
from pathlib import Path
import numpy as np
from scipy.sparse import load_npz, csr_matrix, issparse
from decimal import Decimal
FOLDER_MAP = {'uf20':'H_matrix_uf20','uf50':'H_matrix_uf50','uf75':'H_matrix_uf75','uf100':'H_matrix_uf100','uf175':'H_matrix_uf175','uf250':... |
c0a19292cb988e38603986bf8c3eae95a2a93d7694ccf8b2cdf44d353e033a2a | Python | 6,233 | 178 | import logging
import os
import shutil
from optparse import Values
from typing import List
from pip._internal.cache import WheelCache
from pip._internal.cli import cmdoptions
from pip._internal.cli.req_command import RequirementCommand, with_cleanup
from pip._internal.cli.status_codes import SUCCESS
from pip._internal... |
64048f154f899221d202ee740d06a32d30b5ba01425c9d69a3f20af8e43c15b8 | Python | 6,236 | 182 | import collections
import os
import sys
import numpy as np
import torch
import matplotlib.pyplot as plt
import pandas as pd
from torch.utils.data._utils.collate import np_str_obj_array_pattern, default_collate_err_msg_format
plt.switch_backend('agg')
def adjust_learning_rate(optimizer, epoch, args):
# lr = args... |
44fc324b747ea6068d43f4cdae049950a8541e5308f6aee1b9d3f48b0fe16f93 | Python | 6,237 | 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.... |
140339916266d462dbed860df6b09daa2829ed6d8fe507f6d6bd40e8476bd96b | Python | 6,238 | 214 | # -*- 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 ... |
2d41eb5c782685ad3b7259a5e8a246619c4baa346524abbd8f06b32263fde410 | Python | 6,239 | 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.... |
321a890968cf08b52569d064436bea34faa8d4125a4a8f845ac5e70ebbd90c86 | Python | 6,239 | 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.... |
ae514daf01c718c27c5e158059f2c81cb6015db13cee0ccfacc7c27fb40c9a10 | Python | 6,239 | 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.... |
664d7351dfb84cea5ac021a451e27bd29e7b86e26af3c57f9f23c2a8e383bb9c | Python | 6,240 | 190 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 7 11:31:23 2025
@author: saiful
"""
import os
import sys
import torch
import dgl
import pickle
import pandas as pd
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from dgl.nn import SAGEConv
from sklearn.linear_model import ... |
13b4f67dacf1bda36c904b8666aaa54797a36b907fe9d2e1abe1c30791c51210 | Python | 6,241 | 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.... |
e83a7a3cbd08946ebc6eb20c196bfde6180a339923a6b098a715ed401034999a | Python | 6,241 | 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.... |
04be5e2194993fff6ba30037c20eeb04bc6107394f0ab09cef1317529de84dd0 | 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.... |
127a32823fbc76232f5edc0776963eda91b58321c90286053dca1592a3298af7 | 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.... |
2f61bab26781c93a6bd6ac8fb72a77b8a670378f8debef5a404b81ab85345e65 | 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.... |
78681ce4510570594b4fb47f13a5655cd91185df6c08cb6dda861cd91858e4cf | 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.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.