sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
182a40bb8c6c6fddd0cc438d93be7abbcb13b16d12b90eeac16754e8004e3878 | Python | 13,862 | 336 | # Very slightly adapted from perses https://github.com/choderalab/perses
# License: MIT
# OpenFE note: eventually we aim to move this to openmmtools where possible
import numpy as np
import warnings
import copy
from openmmtools.alchemy import AlchemicalState
class LambdaProtocol(object):
"""Protocols for perturb... |
6f727385417e7028d0f048e965d4da4250c871c1011533d4ebfb377b785aa03d | Python | 13,872 | 292 | import logging
import re
from datetime import date, datetime
from html import escape
import yaml
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import bargraph
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule):
"""
Currently only the "Allel... |
0f222d36d48ac74070fc784923399baae11cea469539f141ec75735ff8d81d29 | Python | 13,883 | 277 | import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from data import DEFAULT_FEATURES, DEFAULT_VISION_FEATURES, DEFAULT_LANG_FEATURES, TRAINING_MODES, MODALITY_AGNOSTIC, MODALITY_SPECIFIC_IMAGES, MODALITY_SPECIFIC_CAPTIONS
from eval import ACC_MODALITY_AGNOSTIC, ACC_CROSS_IMAGES_TO_CAPTIONS, ACC_... |
8a095bc606818a2b42f7845fc8f86d7538afd4d8c31df3b19710b3d60c075eb7 | Python | 13,901 | 319 | import string
from collections import defaultdict
from typing import Literal
import numpy as np
import pandas as pd
from cinnabar import FEMap
from cinnabar.stats import _AVAILABLE_STATS
def compare_and_rank_results(
femap: FEMap,
prediction_type: Literal["nodewise", "edgewise"] = "edgewise",
rank_metri... |
96021db12c9ca9f0745e6e41889cd719e20a4fbc9b0903053c902091cc0f6b5b | Python | 13,908 | 396 | """
Low-level helpers for the SecureTransport bindings.
These are Python functions that are not directly related to the high-level APIs
but are necessary to get them to work. They include a whole bunch of low-level
CoreFoundation messing about and memory management. The concerns in this module
are almost entirely abou... |
c86d10efcce62236465ebffced51e6fc4a3b8286cb30093593a81f54dbacac89 | Python | 13,908 | 330 | import numpy as np
import pandas as pd
import glob, os, subprocess, vcf, shutil, sparse, yaml, sys, argparse, pickle, warnings, tracemalloc
import scipy.stats as st
warnings.filterwarnings("ignore")
# utils files are in a separate folder
sys.path.append("utils")
from data_utils import *
from model_utils import *
from... |
8e810320cf15e225882b82b27019f144e07d6fd9319466009891c7c777c03629 | Python | 13,924 | 288 | import sys
import os
import glob
import re
import gzip
import array
import loompy
import numpy as np
import random
import string
import subprocess
import multiprocessing
import csv
import itertools
from collections import defaultdict
import logging
import h5py
from typing import *
import velocyto as vcy
def id_genera... |
26439150a50c52836bd3d8c8c1bb2fbbb336158524b5e001f056c5f31bd9b076 | Python | 13,925 | 393 | """MultiQC Utility functions, used in a variety of places."""
import array
import json
import logging
import math
import shutil
import sys
import time
from pathlib import Path
from typing import Any, Dict, List, Optional, Union
import numpy as np
from pydantic import BaseModel
logger = logging.getLogger(__name__)
... |
f6d2845cac1b1b8120cf6eb8208197545227182914fc877e1995adafce77f8f0 | Python | 13,929 | 341 | import logging
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 supports outputs from MetaPhlAn, that look like the followin... |
1a5c4b4a359b511027c52490b4de1d2b52e6d51eac3e1428e1931345c3747597 | Python | 13,942 | 340 | # Very slightly adapted from perses https://github.com/choderalab/perses
# License: MIT
# OpenFE note: eventually we aim to move this to openmmtools where possible
# turn off formatting since this is mostly vendored code
# fmt: off
import copy
import warnings
import numpy as np
from openmmtools.alchemy import Alchem... |
1a9c3be5f144f607fcd3096c9d5dbe5af6ee45b7af466ba577e30afc13ab9f6b | Python | 13,973 | 356 | import re as _re
from collections import Counter as _Counter
from collections import defaultdict as _defaultdict
from hetnetpy.hetnet import MetaGraph as _MetaGraph, MetaEdge as _MetaEdge, MetaPath as _MetaPath
from ._graphs import get_abbrev_dict_and_edge_tuples
__all__ = ['dataframes_to_metagraph', 'metapaths_to_js... |
921b9ffbdf263136c224666b73b8b340756bb7e8a9af147b4628f1e13e916b1b | Python | 13,977 | 300 | # -*- coding: utf-8 -*-
#
# Copyright 2014 David Emms
#
# This program (OrthoFinder) is distributed under the terms of the GNU General Public License v3
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Sof... |
615d9cb63dd2cfe017ac424bcc64340257c83eb9cb8e6b6913df4bd55831c1c0 | Python | 13,979 | 495 | """
Logger copied from OpenAI baselines to avoid extra RL-based dependencies:
https://github.com/openai/baselines/blob/ea25b9e8b234e6ee1bca43083f8f3cf974143998/baselines/logger.py
"""
import os
import sys
import shutil
import os.path as osp
import json
import time
import datetime
import tempfile
import warnings
from c... |
28fff26870344c5140b1048899cfc53873be5aadcf3477ff6ca39b29cae0754e | Python | 13,981 | 430 | from __future__ import absolute_import
import re
from collections import namedtuple
from ..exceptions import LocationParseError
from ..packages import six
url_attrs = ["scheme", "auth", "host", "port", "path", "query", "fragment"]
# We only want to normalize urls with an HTTP(S) scheme.
# urllib3 infers URLs withou... |
2c0b9a70b29f13cd7a50b76c45b0671767475e3b4737ca354253371cf3dd9780 | Python | 13,981 | 437 | # 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,... |
89d18a44564b8a904730223bf4ca109ccd935ae05ff3462024c121f58fb3167f | Python | 13,992 | 303 | import numpy as np
import pandas as pd
import os, glob, sparse
from Bio import SeqIO
import tensorflow as tf
from tensorflow.keras import backend as K
from tensorflow.keras import layers, models
from tensorflow.keras.utils import Sequence
# need lineage processing functions from here
from data_utils import *
data_dir... |
b8661ff20fb4d6771a173f6be10f266cfc15fbc2e5da048169e52faa6554f762 | Python | 14,000 | 392 | """
Module for handling plot data storage in a single parquet file.
This replaces the individual plot parquet files with a single file that contains data from all plots.
It also stores all report metadata (modules, data sources, configs) to make reports fully reproducible.
"""
import json
import logging
import os
from... |
207ca024700fc97c2a47ecd566e99901383714d99869579a95640a656afc5c47 | Python | 14,014 | 298 | from __future__ import print_function
import subprocess
import sys
import os
import argparse
import regex
import re
import HTSeq
import pyfaidx
from findCleavageSites import get_sequence, regexFromSequence, alignSequences, reverseComplement, extendedPattern, realignedSequences
"""
Run samtools:mpileup and get all id... |
c11ca647a85fd48c9111a46357495797258dedb4992d10f3c959fe986299e81c | Python | 14,025 | 414 | """
Unified database schema management for Ethopy analysis.
This module provides a simple, unified interface for database connections
and schema access with automatic caching and configuration management.
"""
import datajoint as dj
import os
import logging
from typing import Dict, Any, Optional
logger = logging.getL... |
c38428485d359d11092bc36a7343200576df89e15787162e922be6af12901cfc | Python | 14,059 | 389 | # 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,... |
ca0936e6a1d654279227dbe1dff4d415f36fe34b07c44ba3e1440fa87a30ae69 | Python | 14,067 | 429 | import random
import string
from typing import Callable, Tuple
from uuid import UUID
import re
from sqlalchemy import distinct, select
from sqlalchemy.dialects.postgresql import insert
from sqlalchemy.orm import Session, aliased
from truesight.external.data_models import LLMResponse
from truesight.llm import services ... |
6d87b9259f90ccd227f6e20d10bf14e616c9f933ea06d19732aee53da5ccd760 | Python | 14,072 | 385 | """Integration tests for StrategistService."""
import pytest
import threading
import time
from datetime import datetime, timezone
from pathlib import Path
from tempfile import TemporaryDirectory
from alchemiscale.models import ScopedKey, Scope
from alchemiscale.storage.statestore import Neo4jStore
from alchemiscale.s... |
328b25cb5347388a7cd0775230f3587331adf468ce061980ad8715288985a114 | Python | 14,097 | 369 | #!/usr/bin/env python3
"""
数据库加载器 - 加载并解析各数据库 (支持四分类)
四分类定义:
- same_only: 基因仅在当前癌症类型有记录(无其他癌种)
- same_and_other: 基因在当前癌症类型有记录,同时也在其他癌种有记录
- other_only: 基因仅在其他癌症类型有记录(当前癌种无记录)
- not_supported: 基因在数据库中没有任何癌症关联记录
"""
import pandas as pd
from pathlib import Path
import sys
sys.path.insert(0, str(Path(__file__).parent.pa... |
04f4397f8d348d7b0a8ab73642ebbcc5f030dca3a40f5c39448d3fa848efd3cc | Python | 14,109 | 334 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
import os
import openmm
import pytest
from gufe import SmallMoleculeComponent
from openff.units import unit
from openmmtools.states import ThermodynamicState
from openfe.data._registry imp... |
f9c37e8edb1ef69888a009a654a9b028080d4993f0bfddf24281ea7ba676624c | Python | 14,110 | 416 | #!/usr/bin/env python
from __future__ import print_function
from builtins import object
__applicationName__ = "doxypy"
__blurb__ = """
doxypy is an input filter for Doxygen. It preprocesses python
files so that docstrings of classes and functions are reformatted
into Doxygen-conform documentation blocks.
"""
__doc__ ... |
f20536d1f3353ad372d3ab64f383c5aaa9cad354b9f4b03e5c51cf3e7aed90ee | Python | 14,111 | 360 | import logging
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 supports outputs from sylphtax, that look like the following... |
57c7da034c3eb810b9d8ea3c5d5b956f21c1516dacce63df614c1930ecd63ce0 | Python | 14,114 | 372 | """Parse riker `wgs` outputs (wgs-metrics.txt + wgs-coverage.txt)."""
import logging
from collections import defaultdict
from typing import Dict, List, Optional
from multiqc import config
from multiqc.plots import bargraph, linegraph, table
from multiqc.plots.bargraph import BarPlotConfig
from multiqc.plots.table imp... |
266db147f42c586ac9dbd2681ca8ab3ca751df633ed457419614b6762bd3cdca | Python | 14,121 | 384 | # 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... |
1353dceddc2c2aa769db67a5a3e4452b0073358ad9c5004ffa92d3095006dd5b | Python | 14,139 | 466 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
PLOT FOR ENCODING OF DNN LAYERS.
@author: AlexanderLenders, Agnessa Karapetian
"""
# -----------------------------------------------------------------------------
# STEP 1: Initialize variables
# ------------------------------------------------------------------------... |
222af199e0876e5d421d3ee910f810ead4f1f7053ce789fe776a7cd12bbcb797 | Python | 14,151 | 496 | import os
import sys
import tempfile
import operator
import functools
import itertools
import re
import contextlib
import pickle
import textwrap
import builtins
import pkg_resources
from distutils.errors import DistutilsError
from pkg_resources import working_set
if sys.platform.startswith('java'):
import org.pyt... |
41a184c74b955d2320b72bc8ae140089ad34007e5a085615ee784833d52239d2 | Python | 14,156 | 296 | # -*- coding: utf-8 -*-
#
# Copyright 2014 David Emms
#
# This program (OrthoFinder) is distributed under the terms of the GNU General Public License v3
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Sof... |
806674f702c278df6155dd9bc0e1304a93a1cb64d079788a1295f6517932df5f | Python | 14,161 | 566 | #!/usr/bin/env python3
# ----------------------------------------------------------------------------
# Copyright (c) 2020--, Qiyun Zhu.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------... |
d504a1bb12ad35552d9191fd9afa12162cc32f0abe671a2dd17391513fa72383 | Python | 14,181 | 449 | #!/usr/bin/env python3
__author__ = 'Pavel Polishchuk'
import argparse
import sys
import warnings
from collections import deque
warnings.filterwarnings(
'ignore',
message='Deprecated in version 2.8.0.*',
category=DeprecationWarning,
)
import prolif as plf
from rdkit import Chem
def read_contacts(conta... |
c5c57684a03ccf7aa38887fd27ec212bdab92ff8f342025f34d39126f02f2846 | Python | 14,206 | 347 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on 2/18/2022
Full Model class
Author: dzhi, jdiedrichsen
"""
import numpy as np
import torch as pt
from torch.utils.data import DataLoader, TensorDataset
import HierarchBayesParcel.emissions as emi
import HierarchBayesParcel.arrangements as arr
import warnings... |
ee10618c1a9f50e1b6a878276129441ce9bc7497e09c0bfaa2f4782d92a9bec2 | Python | 14,216 | 352 | # 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,... |
a1b7631aea87162da406c518f4bfc9cbab11338adc7328608d3828c7093d4fc6 | Python | 14,238 | 388 | """
viz/lodo_results.py — Fig 5-8/5-9: LODO-CV Results
====================================================
"""
from __future__ import annotations
from pathlib import Path
from typing import Optional
import numpy as np
from .mdpi_style import (
FS_LABEL,
FS_SMALL,
FS_TICK,
FS_TINY,
MDPI_DPI,
... |
a59d998173313b1ac705eb5973ef99dcf52d8a32ce8826bcce86b8a82077d7ec | Python | 14,245 | 312 | import copy
import os
import pickle
import numpy as np
import pandas as pd
from nilearn import datasets
from nilearn.surface import surface
from tqdm import tqdm
from analyses.decoding.searchlight.searchlight import get_adjacency_matrix
from utils import export_to_gifti, HEMIS, FS_HEMI_NAMES
def calc_clusters(score... |
38ece1adfe846611438d057b306b8cd627317c30b39c079c1e949d5beca839af | Python | 14,251 | 434 | # -*- coding: utf-8 -*-
"""
Outline code test for IGRF candidate evaluation
# Load available candidates
# Figure out the ordering and labels from each candidate - have a strict
# naming convention?
# Tests are -
Check files are correctly formatted, then:
1) power spectra
2) RMS differences
3) Degree corre... |
2b5959fa7185b76404f8935624eb83ee882315f882f2ce6c380ebb3dd90bacd6 | Python | 14,257 | 392 | # 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,... |
1d2a8540629aecfe4b55e4136e958c3ae9400a65ea9a6dbe18cab5b0ef047544 | Python | 14,258 | 301 | import argparse
from functools import partial
import os
import time
import feabas
from feabas.concurrent import submit_to_workers
from feabas import config, logging, storage
def match_one_section(coordname, outname, **kwargs):
logger_info = kwargs.get('logger', None)
logger = logging.get_logger(logger_info)
... |
e0020c2623cbe370ba99cdb2d75def3177989c1ec060952ee1775c00c638b243 | Python | 14,263 | 430 | """
:mod:`alchemiscale.compute.service` --- compute services for FEC execution
==========================================================================
"""
import gc
import sched
import time
import logging
from uuid import uuid4
import threading
from pathlib import Path
import shutil
from gufe import Transformatio... |
ac97ced5ed68997c9e610b7a994a9565256cea8a8226dea855a490188c0329da | Python | 14,273 | 373 | import logging
import os
import re
import numpy as np
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import bargraph, linegraph
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule):
"""
The JCVI module parses the output of `python -m jcvi.anno... |
19094e2effa71e82582ab2b65cb6255912acb582ee76cd94e49ed41f6f3b3900 | Python | 14,292 | 395 | import pathlib
import os
import pandas as pd
import numpy as np
import torch
import torchvision.transforms as transforms
from torch.utils.data import Dataset
from PIL import Image
from torch.utils.data import random_split
from torch.utils.data import DataLoader
import torch.nn as nn
import torch
from torch.... |
8c72983f6cdef17350e02d6c57d3c126d1d169c9c38f1678e257118e74dfa2f1 | Python | 14,292 | 395 | import pathlib
import os
import pandas as pd
import numpy as np
import torch
import torchvision.transforms as transforms
from torch.utils.data import Dataset
from PIL import Image
from torch.utils.data import random_split
from torch.utils.data import DataLoader
import torch.nn as nn
import torch
from torch.... |
dd579a8a9a0bb3e05926d1742e5ba8789c8e712aae6fb0641e9589012dd5f9d2 | Python | 14,292 | 395 | import pathlib
import os
import pandas as pd
import numpy as np
import torch
import torchvision.transforms as transforms
from torch.utils.data import Dataset
from PIL import Image
from torch.utils.data import random_split
from torch.utils.data import DataLoader
import torch.nn as nn
import torch
from torch.... |
7c2f0a3f840bcd1d5e887b7c64d5d02d87cbc571872be36b91216d8f749f3b55 | Python | 14,297 | 395 | import pathlib
import os
import pandas as pd
import numpy as np
import torch
import torchvision.transforms as transforms
from torch.utils.data import Dataset
from PIL import Image
from torch.utils.data import random_split
from torch.utils.data import DataLoader
import torch.nn as nn
import torch
from torch.... |
56cf4ef5dda2f2d16eba920fbc070ae57aaf306bc4557a828b627537c00f2c11 | Python | 14,298 | 395 | import pathlib
import os
import pandas as pd
import numpy as np
import torch
import torchvision.transforms as transforms
from torch.utils.data import Dataset
from PIL import Image
from torch.utils.data import random_split
from torch.utils.data import DataLoader
import torch.nn as nn
import torch
from torch.... |
d243640b0f8b795876cc6f65563a46524d8f3380868f77a3c4053b20a9b928d8 | Python | 14,298 | 395 | import pathlib
import os
import pandas as pd
import numpy as np
import torch
import torchvision.transforms as transforms
from torch.utils.data import Dataset
from PIL import Image
from torch.utils.data import random_split
from torch.utils.data import DataLoader
import torch.nn as nn
import torch
from torch.... |
9f7f7484bb83a2b855f881fdbd50c27577a21e455f29e75790f240d74dfb2eb7 | Python | 14,301 | 370 | """ @package forcebalance.recharge
A target to train bond charge corrections (currently only the SMIRNOFF force
field format is supported) against electrostatic potential data.
author Simon Boothroyd
@date 07/2020
"""
from __future__ import division, print_function
import json
import os
import numpy as np
from forc... |
63e74323a04e21c700aff706cf040ffdc2d9bffdf8356d15a5be9ed99fc606d3 | Python | 14,302 | 450 | """Analyse torsion drive data using different force fields."""
import os
import pathlib
from multiprocessing import freeze_support
from typing import Literal
import click
import numpy as np
from matplotlib import pyplot
from openff.toolkit import Molecule
from rdkit.Chem import AllChem, Draw
from yammbs.torsion impo... |
7989aaf0bf867d4db85ef98b6462348fb331cbb3848949f2fd96f0ddddc84ea2 | Python | 14,302 | 397 | import pathlib
import os
import pandas as pd
import numpy as np
import torch
import torchvision.transforms as transforms
from torch.utils.data import Dataset
from PIL import Image
from torch.utils.data import random_split
from torch.utils.data import DataLoader
import torch.nn as nn
import torch
from torch.... |
403fdf28fadd7291bbfc9f2021e6b51c1f9c6f51d3bc706876041cf4d7fea5dc | Python | 14,312 | 338 | import logging
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 results generated by HiCExplorere's hicBuildMatrix, a subtool t... |
07ef10934ece77e61aa5ab4bf0fef6255676117a7baf9de93be3a805d59f7622 | Python | 14,318 | 379 | import numpy as np
import math
from pathlib import Path
import numpy as np
import re
def generate_verilog_modules(
H_FILE: str,
COLORMAP_FILE: str,
C_VAL: int,
MODULE_FILE: str,
READOUT_FILE: str,
H_WIDTH: int = 5,
TH_WIDTH: int = 16
) -> None:
'''Generates solver.v and solver_read... |
a27832ae5a5b898c952ae641b2d441195d9872b6515392745a0fa62dcdadd571 | Python | 14,319 | 364 | #!/usr/bin/env python3
"""
CpG Enrichment Analysis using BigWig Signal
This script analyzes MeCP2 enrichment at CpG islands by extracting signal
intensities from BigWig files (RPKM-normalized) using pyBigWig.
Signal extraction method:
- Mean signal intensities extracted from bigWig files for each replicate
- Requires... |
18d6e69a80578f84527b029d7f768beaf74e6773edf390ae8b82bef6aa362c85 | Python | 14,339 | 434 | # -*- coding: utf-8 -*-
"""
Outline code test for IGRF candidate evaluation
# Load available candidates
# Figure out the ordering and labels from each candidate - have a strict
# naming convention?
# Tests are -
Check files are correctly formatted, then:
1) power spectra
2) RMS differences
3) Degree corre... |
429d3f0d9adb43b12c8a7df9762e922ea022c288d80545d2ad12849cbbc48143 | Python | 14,345 | 343 | """MultiQC module to parse output from ganon classify"""
import logging
import re
from typing import Dict, Optional, Tuple, Union
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import bargraph, table
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule... |
de77f154f9d7a57c863e7f2ad992a8d26493b25b6e7944b200ac720f5f835b2a | Python | 14,356 | 404 | #!/usr/bin/env python3
"""
Gradient-Driven Adaptive Time Stepping for Neural Circuit Simulations
Automatically adjusts time step based on population activity gradients,
providing efficient simulation while maintaining accuracy.
"""
import numpy as np
import torch
from torch import Tensor
from dataclasses import datac... |
2cc7ef2f5b01440654a6a8c499abb9a118a2cbbc386ea774c70d52fa4f30ba00 | Python | 14,359 | 316 | #!/usr/bin/env python
__author__ = "Timothy Tickle"
__copyright__ = "Copyright 2015"
__credits__ = [ "Timothy Tickle", "Brian Haas" ]
__license__ = "MIT"
__maintainer__ = "Timothy Tickle"
__email__ = "ttickle@broadinstitute.org"
__status__ = "Development"
import argparse
import csv
import matplotlib.pyplot as plt
imp... |
d413b0143662c6ae6fcd67da33fa5ba94359a2fef6a261ba8a9b35702f07e407 | Python | 14,367 | 434 | # -*- coding: utf-8 -*-
"""
Outline code test for IGRF candidate evaluation
Example for the DGRF2015 candidate submitted in October 2019
# Load available candidates
# Use the alphebetical ordering and labels from each candidate -
# There is a set naming convention
# Tests are -
Check files are correctly fo... |
ca0ef6617963af529dfea0a69b86cd8f4d7398d1f6e90ee27ea66264b9e8e53a | Python | 14,386 | 345 | """MultiQC submodule to parse output from Picard ValidateSamFile"""
import logging
from typing import List, Tuple, Union
from multiqc.plots import table
from multiqc.plots.plot import Plot
# Initialise the logger
log = logging.getLogger(__name__)
# Possible warnings and descriptions
WARNING_DESCRIPTIONS = {
"AD... |
f0d76cfe441aea8d0811b53d56685c6bec873a2e4a28f4ac9884fe2de9fbf37f | Python | 14,392 | 317 | # ---------------------------------------------------------------
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
# ---------------------------------------------------------------
# coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "Licens... |
a5ff98c24b3d765efde0f041648a142759d52b4574ff189d953f775a7bd49555 | Python | 14,409 | 299 | """
==============================================================
Replicating Ismail et al. 2026
==============================================================
"""
# sphinx_gallery_thumbnail_number = 1
# %% [markdown]
# 0. Overview
# ---------------------------------------------------
#
# This example replicates mode... |
5a6e0301240d64db91499909f69b217a1ff8457906ac25ac0b2f29a8edd57783 | Python | 14,420 | 241 | import logging
import os
import shutil
from time import sleep
import platform
import traceback
import requests
import zipfile
import pytest
from PySide6.QtCore import Qt
from gui.RaidionicsMainWindow import RaidionicsMainWindow
from utils.software_config import SoftwareConfigResources
from utils.data_structures.UserP... |
e6fcebe8a6032d64f16fc466073cf4e225fdb95c35a32ed65e25a7db0a0d53f4 | Python | 14,425 | 326 | """
==============================================================
Replicating Ismail et al. 2025
==============================================================
"""
# sphinx_gallery_thumbnail_number = 1
# %% [markdown]
# 0. Overview
# ---------------------------------------------------
#
# This example replicates mode... |
9ba295efaee9f7fa89a1ca414cac31bdb322019e1ea8c4151c18da4152da60a2 | Python | 14,430 | 411 | """
Code to initialise the MultiQC logging
"""
import datetime
import logging
import os
import shutil
import sys
from pathlib import Path
from typing import Callable, List, Optional, TypeVar
import coloredlogs # type: ignore
import rich
import rich.jupyter
import rich.progress
from rich.logging import RichHandler
fr... |
1e3de8cbca90bba389b6cbb5783a6bce3b317bdb4815f14b37027c7b479271d7 | Python | 14,441 | 385 | import pathlib
import os
import pandas as pd
import numpy as np
import torch
import torchvision.transforms as transforms
from torch.utils.data import Dataset
from PIL import Image
from torch.utils.data import random_split
from torch.utils.data import DataLoader
import torch.nn as nn
import torch
from torch.... |
70373c88f6c65bc0436c85edc475d93df165b6decc2f57d73eb20f619bdd8957 | Python | 14,442 | 385 | import pathlib
import os
import pandas as pd
import numpy as np
import torch
import torchvision.transforms as transforms
from torch.utils.data import Dataset
from PIL import Image
from torch.utils.data import random_split
from torch.utils.data import DataLoader
import torch.nn as nn
import torch
from torch.... |
13eb5d7903cee169ac14f34771545856144b3040550992d27df01f93dcb81b3a | Python | 14,443 | 385 | import pathlib
import os
import pandas as pd
import numpy as np
import torch
import torchvision.transforms as transforms
from torch.utils.data import Dataset
from PIL import Image
from torch.utils.data import random_split
from torch.utils.data import DataLoader
import torch.nn as nn
import torch
from torch.... |
c8b4a938f17fbfb60dddf987a05e021b7ae818b545313d327510f350592d8d93 | Python | 14,444 | 385 | import pathlib
import os
import pandas as pd
import numpy as np
import torch
import torchvision.transforms as transforms
from torch.utils.data import Dataset
from PIL import Image
from torch.utils.data import random_split
from torch.utils.data import DataLoader
import torch.nn as nn
import torch
from torch.... |
a8e5ec3483bd262d95c947d37fd5b12dfd6dbc649dd583d1a467a5b2076ca2a5 | Python | 14,446 | 385 | import pathlib
import os
import pandas as pd
import numpy as np
import torch
import torchvision.transforms as transforms
from torch.utils.data import Dataset
from PIL import Image
from torch.utils.data import random_split
from torch.utils.data import DataLoader
import torch.nn as nn
import torch
from torch.... |
7dcd81a70bad572fb837ee28e002f4ba8cbb160c96b456fe2fb3b59bb76e35d3 | Python | 14,454 | 388 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
import abc
import warnings
from typing import Callable, Iterable, Optional, Type
from gufe import (
AlchemicalNetwork,
ChemicalSystem,
LigandAtomMapping,
LigandNetwork,
P... |
e5ee04b36c35ba59bd7172bf6909a7ad429d7f9e05ebb34335e5d1bcf4890a81 | Python | 14,467 | 390 | import pathlib
import os
import pandas as pd
import numpy as np
import torch
import torchvision.transforms as transforms
from torch.utils.data import Dataset
from PIL import Image
from torch.utils.data import random_split
from torch.utils.data import DataLoader
import torch.nn as nn
import torch
from torch.... |
d631ea4c71ee601959fe213769389f04f1085235ca954b18c790e58ab84d5785 | Python | 14,472 | 390 | import pathlib
import os
import pandas as pd
import numpy as np
import torch
import torchvision.transforms as transforms
from torch.utils.data import Dataset
from PIL import Image
from torch.utils.data import random_split
from torch.utils.data import DataLoader
import torch.nn as nn
import torch
from torch.... |
b610fe79da78206a5dfdd5167feba8256e9a8fb219c48cf0d7dbf4367d8b6ac0 | Python | 14,474 | 395 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
import abc
from typing import Iterable, Callable, Type, Optional
import warnings
from gufe import (
Protocol,
AlchemicalNetwork,
LigandAtomMapping,
Transformation,
Chemic... |
a0ef141dc82c573d139429a58a23b7ec80e3eb518c87ac89da7513380a331182 | Python | 14,487 | 371 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
import os
import pathlib
import MDAnalysis as mda
import pooch
import pytest
from openfe.protocols.restraint_utils.geometry.boresch.geometry import (
BoreschRestraintGeometry,
find_b... |
cf2c9c599e0ed56d85f0b879d4c9ebaefe0b58da8e07cfedc8332f6d2cb68952 | Python | 14,494 | 308 | import json
import logging
import re
from typing import Dict
from multiqc import config
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import bargraph, table
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule):
"""
[Deacon](https://github.com... |
9d59100ac81656a33a5c2565fa6aef597e5cacc5ecec7c8cb671bf554c8747f4 | Python | 14,500 | 322 |
from complexity_fidelity import *
# Synthetic noise generators
def generate_white_noise(length=10000, num_signals=10):
"""White noise (H≈0.5)."""
return [np.random.randn(length) for _ in range(num_signals)]
def generate_pink_noise(length=10000, num_signals=10):
"""Pink noise (H≈1.0) via 1/sqrt(f) shaping... |
48df70f13c8a7d5f5c22412fe62bcbdfabe92e5514888241b045d3f78e4dee82 | Python | 14,501 | 430 | #!/usr/bin/env python3
# ----------------------------------------------------------------------------
# Copyright (c) 2020--, Qiyun Zhu.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------... |
3c2aa9abeccc90d00f2aea4c9d74094a9babf8fa26eb9ce715fa2582f5c0fbd6 | Python | 14,517 | 344 | """
components/methods/sklearn_methods.py — Traditional ML Baselines
=================================================================
Implements 9 baseline methods from P1/P2 as registered ``BaseMethod``
subclasses so they can be plugged into any MF experiment.
Registry keys
-------------
- ``lr`` — Log... |
17eb639e773422bab4386e0c29a1955a4c9365c7cfe574052ec94f79da4c8ade | Python | 14,523 | 480 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
MULTIVARIATE NOISE NORMALIZATION (WHITENING) FOR ENCODING
This script conducts the MVNN for the enconding analysis. Note that the MVNN
for the decoding analysis is implemented in a different script. Thus, only
use this MVNN for encoding.
Acknowledgments: This script... |
ea2e62ba69deb60ef0291c81b013c40a968d640e6a8b51c97af1c1212c7d52f6 | Python | 14,531 | 344 |
import argparse
import torch
import numpy as np, h5py
import os
import torch.optim as optim
import torchvision
from backbones.ncsnpp_generator_adagn import NCSNpp
from dataset import CreateDatasetSynthesis
import torch.nn.functional as F
import torchvision.transforms as transforms
def psnr(img1, img2):
#Peak S... |
30d5909d142dac5dd6f74fb3372387822d3c7d0d4255d19597eae682ebc9e2d2 | Python | 14,534 | 414 | from __future__ import division
import numpy as np
import bitarray as ba
def getBlockLefts(coords, max_dist):
'''
Converts coordinates + max block length to the a list of coordinates of the leftmost
SNPs to be included in blocks.
Parameters
----------
coords : array
Array of coordinat... |
021c15c7b1fcca420a18e234bda9054c3e75b99efa6359974b3c32b611a9d143 | Python | 14,544 | 368 | """External baseline: Pretraining-Aware (PA) diffusion model.
A conditional diffusion baseline that mirrors MRI2PET's two-stage
training (MRI-only pretrain → paired fine-tune) but uses an alternative
pretraining pretext task rather than the style-transferred PET targets
employed by ``src/models/diffusionModel.py``. Ar... |
d219010891e9e2fc3b4e84f9c5095e4add4eb116dca4492ff0e01c0c27030645 | Python | 14,545 | 362 | import argparse
import gc
import time
import warnings
import numpy as np
from joblib import Parallel, delayed
from nilearn import datasets
from nilearn.decoding.searchlight import GroupIterator
from nilearn.surface import surface
from sklearn import neighbors
from sklearn.exceptions import ConvergenceWarning
import o... |
d7470cb4bed33d49b6ca8f38dc643968b27c27f8773a710abc66e41b1c5e0f62 | Python | 14,556 | 324 | """ modified vibration.py for internal coordinate hessian fitting
"""
from __future__ import division
from builtins import zip
from builtins import range
import os
import shutil
from forcebalance.nifty import col, eqcgmx, flat, floatornan, fqcgmx, invert_svd, kb, printcool, bohr2ang, warn_press_key, pvec1d, pmat2d
imp... |
cfea39d6fb7daff9762031b9222a1338a1b36677b8172dff15cfbbcedace8782 | Python | 14,565 | 417 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from ..constants import scopingElements, tableInsertModeElements, namespaces
# The scope markers are inserted when entering object elements,
# marquees, table cells, and table captions, and are used to prevent for... |
6a94a51f306ebdbfbf9c8c24ad77e8576f4e5487153edc238215bf73a64f4f9c | Python | 14,574 | 437 | from unittest import mock
import pytest
from importlib import resources
import shutil
from click.testing import CliRunner
from ..utils import assert_click_success
from openfe.protocols.openmm_utils.charge_generation import HAS_OPENEYE
from openfecli.commands.plan_rbfe_network import (
plan_rbfe_network,
plan_... |
1b61db10747c5da8d6a1c96ba0d373be5048ad99fc248c8f1ca572541b047397 | Python | 14,590 | 310 | import logging
import re
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import bargraph
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule):
"""
The module parses results generated by [Bowtie 2](http://bowtie-bio.sourceforge.net/bowtie2/)
... |
933ca5e5ee55d610580644d7c9d7dbbbc94bd6a485ab4f8f2b337addb2073feb | Python | 14,590 | 392 | import pathlib
import os
import pandas as pd
import numpy as np
import torch
import torchvision.transforms as transforms
from torch.utils.data import Dataset
from PIL import Image
from torch.utils.data import random_split
from torch.utils.data import DataLoader
import torch.nn as nn
import torch
from torch.... |
33a992e74f3bd81db0cb9ca052c2142722c3c5dc54a9d38197549f476a42e794 | Python | 14,593 | 382 | """
viz/fahzu_viz.py — Fig 5-10: FAHZU Real-World Validation Visualization
======================================================================
Supports single query (kidney only) or dual query (kidney + CRC).
"""
from __future__ import annotations
from pathlib import Path
from typing import Any, Dict, List, Option... |
c9fd0569d936322c4ba6e4b922e90e5e49ea890669b8f03e329dae56b97ef1dc | Python | 14,600 | 361 | import re
import hydra
from omegaconf import MISSING, OmegaConf, DictConfig
from dataclasses import dataclass, field
from typing import Optional, Dict, List, Any
from pathlib import Path
from hydra.plugins.search_path_plugin import SearchPathPlugin
from hydra.core.plugins import Plugins
from cheese3d.utils import mayb... |
c2004316bbb92d65581c32c4d0914b0bd61a078a2ba045b4402d49e486fe24f0 | Python | 14,615 | 324 | import logging
import math
from PySide6.QtWidgets import QWidget, QVBoxLayout, QPushButton, QLabel, QHBoxLayout, QScrollArea, QSizePolicy
from PySide6.QtCore import Qt, QSize, Signal
from PySide6.QtGui import QIcon, QPixmap
import os
from utils.software_config import SoftwareConfigResources
from gui.LogReaderThread im... |
a3427ce73957c6987879d1b5fd2269fbee5f4701d196c867cd4b04e607552931 | Python | 14,631 | 331 | #!/usr/bin/python
"""
Estimate 2D free energy surface for alanine dipeptide parallel tempering data using MBAR.
PROTOCOL
* Potential energies and (phi, psi) torsions from parallel tempering simulation are read in by temperature
* Replica trajectories of potential energies and torsions are reconstructed to reflect th... |
f9145244727d76dbc87f3ca021d16b48ae456f8a25bce3b609ae7067ff6abf9e | Python | 14,636 | 412 | import numpy as np
import glob
import json
import gufe
from gufe.tokenization import JSON_HANDLER
from gufe import SmallMoleculeComponent as SMC
from cinnabar import Measurement, FEMap
from openff.units import unit
import pathlib
import click
import csv
from tqdm import tqdm
def get_names_from_unit_results(result) ->... |
516dad69e00b9238102321bc1e82e9a7b71a992fd36fb91efc27a0cc2ff920a2 | Python | 14,646 | 369 | import json
import logging
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import bargraph, linegraph
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule):
def __init__(self):
super().__init__(
name="miRTrace",
anchor... |
b92764554743147d3aa215cf57757f33678c74e8c749d380e8f12db404c97b4c | Python | 14,654 | 383 | """Integration tests for evaluation workflows that require actual models and data."""
import tempfile
from pathlib import Path
from unittest.mock import MagicMock, patch
import numpy as np
import pandas as pd
import pytest
from timeflies.evaluation.interpreter import Interpreter
from timeflies.evaluation.metrics imp... |
c5b0125b25525cd22bc7fd0610bb95574db485d73858fee593d699bb24c1803d | Python | 14,666 | 378 | #!/usr/bin/env python3
"""
PGLS Analysis Script
=====================
Phylogenetic Generalized Least Squares (PGLS) analysis for Yasuda et al. (iScience, 2026)
Corresponds to Supplementary Figure 2 and Supplementary Table S7.
Background:
Standard Spearman correlation ignores phylogenetic non-independence.
PGLS cor... |
9049056991219c40ffde0da8e32177721d41f56d62a0ec22d063783f683088a5 | Python | 14,678 | 367 | # %% [markdown]
### Prepare data with different signal to noise ratio in observed SEEG
#%%
import numpy as np
import matplotlib.pyplot as plt
import lib.preprocess.envelope
import os
import lib.io.stan
# %%
data_dir = 'datasets/syn_data/id001_bt'
results_dir = 'results/exp10/exp10.88.1/snr0.1_5.0_step0.1_10samples_per_... |
ced2625d2329518d3e7b17c6493d490da9e2744f30c38d833b9e02d3399a8e2d | Python | 14,692 | 320 | """Inline-fixture unit tests for the riker module.
The fixture strings here are short slices of real riker outputs (1000 Genomes
samples HG00240 / HG03953); they're enough to exercise the parsers without
embedding multi-megabyte histograms.
"""
import pytest
from multiqc import report
from multiqc.base_module import... |
f746a4749dd298d877228bcdcc04bcb67e5bf8f41e786ea4ff076bf6be5023c0 | Python | 14,692 | 453 | #!/usr/bin/env python3
"""
Training command for Hi-Compass.
"""
import logging
import os
import torch
from argparse import Namespace
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(levelname)s - %(message)s'
)
logger = logging.getLogger(__name__)
def configure_parser(parser):
"""
Co... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.