sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
ff46d240a2d2ca5a0b3f0f307c62c92fc72b230ecdb87efb30b5a00718845525 | Python | 18,167 | 342 | import logging
from PySide6.QtWidgets import QWidget, QHBoxLayout, QVBoxLayout, QGridLayout, QLabel, QPushButton, QSplitter,\
QStackedWidget, QDialog
from PySide6.QtGui import QIcon, QPixmap
from PySide6.QtCore import Qt, QSize, Signal
import os
from utils.software_config import SoftwareConfigResources
from gui.S... |
1f829628a5fc5c56a1a6c18cab05bf628e54c665fe37e01edd9955f88217570d | Python | 18,172 | 611 | # 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,... |
7a494a40f502717d2671682c4aa982a4197da4c2a57bebeb47747408c79823e1 | Python | 18,181 | 357 | # tests/test_early_stopping.py
import pytest
from unittest.mock import Mock, patch
import torch
import numpy as np
from early_stopping_pytorch import EarlyStopping
# Fixtures to mock model and temporary checkpoint path
@pytest.fixture
def mock_model():
"""
Fixture to create a mock PyTorch model.
Returns... |
6845ed1cad0b6b89c63fb9aee4de42437b667e369cccbc1b1a2f00af8a06cf9a | Python | 18,192 | 556 | """
The main purpose of this module is to expose LinkCollector.collect_sources().
"""
import cgi
import collections
import functools
import html
import itertools
import logging
import os
import re
import urllib.parse
import urllib.request
import xml.etree.ElementTree
from optparse import Values
from typing import (
... |
fcc025403bb0887242a1a107c6092d6cd5c3a18ef8913b566e87284b8a0bf240 | Python | 18,259 | 482 | """
This module provides functions useful to interact with MultiQC in an interactive
Python environment, such as Jupyter notebooks.
"""
import logging
from collections import defaultdict
from pathlib import Path
from typing import Dict, List, Optional, Sequence, Union
from numpy import isin
from multiqc import confi... |
98dfaa47ad51efa84bf02649f299cf78bd273fd0f4b2a990d7f997c148f4e773 | Python | 18,271 | 521 | import asyncio
from collections import defaultdict
from loguru import logger
from truesight import config
from truesight.external.data_models import LLMResponse, Prompt
from sqlalchemy import select
from sqlalchemy.dialects.postgresql import insert
from sqlalchemy.orm import Session
from truesight import list_utils, pr... |
79e5384af11488596bd4bc992f34952ec8d25cff8689ce02d41eb199b683e776 | Python | 18,292 | 528 | import numpy as np
from src.microcircuit import *
import src.init_MC as init_MC
import src.init_signals as init_signals
import src.run_exp as run_exp
import logging
def extract_offdiagonal(mat, layers):
offdiag = [None for _ in layers[1:]]
for idx, _ in enumerate(layers[:-1]):
lower_row = np.sum(layers[:idx], d... |
f8fe6b8c7d5a6ed98be720323d40487064706e32f115a668b7a017be6a866e65 | Python | 18,296 | 527 | """
viz/curves.py — Fig 5-4/5-5: AUC Degradation and Label Efficiency Curves
=========================================================================
"""
from __future__ import annotations
from pathlib import Path
from typing import Dict, List, Optional
import numpy as np
from .mdpi_style import (
FS_LABEL,
... |
9b58a67d1000fc881ef9de3ed4da422037e94a98451c0d123723534df8206b00 | Python | 18,316 | 548 | import base64
import functools
import hashlib
import importlib.metadata
import logging
import os
import platform
import socket
import subprocess
from dataclasses import dataclass, field
from datetime import datetime
from getpass import getpass, getuser
from itertools import product
from multiprocessing.shared_memory im... |
7e428b59f7ab776d8002e626d6ca60dea9b02ad85d0fbe61d780b04beea93754 | Python | 18,328 | 544 | # Copyright 2024 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,... |
fbad243a877de33f5c7915d1c6f4467d4b52740bb823cd01ee821e092d2730ba | Python | 18,330 | 349 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
import glob, re, itertools, inspect
import gzip
from datetime import datetime
from collections import OrderedDict
from os import path
import numpy as np
import six
encoding = 'utf-8'
vr_pa... |
df94e65a4a2ca3829bb8eab98b0f69729a3a4ece227740fb710c8afcd93c1325 | Python | 18,335 | 519 | import logging
from collections.abc import Callable, Generator
from multiprocessing import Pool
from typing import Literal
import numpy
import openmm
from numpy.typing import NDArray
from openff.toolkit import Molecule
from pydantic import Field
from tqdm import tqdm
from yammbs._base.array import Array
from yammbs._... |
3c19642f8a9df7b279cc02d952e6108121f5ec3bd35d9e57fa8c3215c4f4a974 | Python | 18,336 | 503 | import numpy as np
import pytest
import shapely
from shapely import Geometry, GeometryCollection, LineString, Point, Polygon
from shapely.testing import assert_geometries_equal
from shapely.tests.common import all_types, empty, ignore_invalid, point, polygon
pytestmark = pytest.mark.filterwarnings(
"ignore:The sy... |
b70781272e087fdeb510b6f4b6ad33a6c134770cf81931c6f43efe2c03dc740b | Python | 18,349 | 430 | import nibabel as nb
import numpy as np
def load_mgh(filename):
""" import mgh file using nibabel. returns flattened data array"""
mgh_file=nb.load(filename)
mmap_data=mgh_file.get_data()
array_data=np.ndarray.flatten(mmap_data)
return array_data;
# function to load mesh geometry
def load_mesh_geo... |
3e34542050a5967dfc609f460a979a5be585b484bd954fa71dcf2812efd842c9 | Python | 18,353 | 548 | import base64
import functools
import hashlib
import importlib.metadata
import logging
import os
import platform
import socket
import subprocess
from dataclasses import dataclass, field
from datetime import datetime
from getpass import getpass
from itertools import product
from multiprocessing.shared_memory import Shar... |
0a1578ef8df19da3e437b1cd3946a0fe1a5ef036ec0fd8ba8629e14598373018 | Python | 18,374 | 474 | import csv
import io
import logging
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import bargraph, linegraph, table
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule):
def __init__(self):
super().__init__(
name="ngsderive",
... |
de4827b97cb420119ff3ec5d2afa10af77f290e7620954e9c8c7bec7fa9c8500 | Python | 18,379 | 451 | import numpy as np
from numba import jit
from sklearn.neighbors import kneighbors_graph, NearestNeighbors
from scipy import sparse
import logging
from typing import *
# Mutual KNN functions
@jit(signature_or_function="Tuple((float64[:,:], int64[:,:], int64[:]))(int64[:,:], float64[:, :], int64[:], int64, int64, bool... |
17a7c96c2a0e58622c1cebce075e5da7fea32f1068ed498c381e7bcbeb98151d | Python | 18,421 | 489 | import warnings
import sys
import csv
import re
import argparse
import pathlib
import blessed
from .. import __version__ as VERSION
from .. import reg
from ..reg import PlateReader, BioformatsReader
from ..filepattern import FilePatternReader
from ..fileseries import FileSeriesReader
from ..zen import ZenReader
def m... |
cc3eaeaf2e49719c1375e429228d3a9a014c9a6595e43914e4fa845549081677 | Python | 18,430 | 471 | """
viz/heatmap.py — Fig 5-2: Decoupling Heatmap, Fig 5-3: Winner Map
==================================================================
"""
from __future__ import annotations
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple
import numpy as np
from .mdpi_style import (
FS_LABEL,
... |
a3254fe073df736c4eb4ff7dfd5dc0522cbad2ac7eb01acf62d8f1f7c39699d8 | Python | 18,444 | 520 |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... |
64abbb2d2e7d1982586f1ae810bbe75cd7c8c213d1712215d8bc25e618962387 | Python | 18,477 | 556 | # This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains th... |
0073d86f2dfaf6d8b47687e05124506e4bc1618a272c1cba5a6aa108d3634046 | Python | 18,486 | 558 | import numpy as np
import pytest
from pymbar import FES
from pymbar.utils import ParameterError
from pymbar.utils_for_testing import assert_almost_equal
try:
import sklearn # pylint: disable=unused-import
has_sklearn = True
except ImportError:
has_sklearn = False
beta = 1.0
z_scale_factor = 12.0
def ... |
b2ba5e7db4a66902137dc84c2ce6f742abdfa40d40b7a0fefd4d01c3eaa0bb61 | Python | 18,486 | 507 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
import sys, os, re, glob, shlex, string
import subprocess, multiprocessing, ctypes, time, uuid
import importlib
import json
import tables, warnings
from datetime import datetime
from itertool... |
8581016ca326ba2ee3468437b54aca6e6c99192dbd18c11ebf029ee02f400136 | Python | 18,487 | 558 | import numpy as np
import pytest
from pymbar import FES
from pymbar.utils import ParameterError
from pymbar.utils_for_testing import assert_almost_equal
try:
import sklearn # pylint: disable=unused-import
has_sklearn = True
except ImportError:
has_sklearn = False
beta = 1.0
z_scale_factor = 12.0
def ... |
6502cad1d8b7b756fa96b8a673de8b43a3fec9f5aca83c0a7443cc729712980a | Python | 18,524 | 517 | """GraphSGAN training orchestrator with WGAN-GP support.
Modernized from P1-scripts/GraphSGAN.py and GraphSGAN (1).py:
- Removed all Variable() wrapping
- torch.no_grad() replaces volatile=True
- torch.utils.tensorboard replaces tensorboardX
- state_dict() for model saving
- Rebuilt WGAN-GP training method
"""
import... |
0709df39dc6d754569f986301d7f0992e4b210d352cfcdbdc9191c8131fc4870 | Python | 18,551 | 632 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import xml.etree.ElementTree as ET
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import Any, Dict, List, Optional, Tuple, Union
import numpy as np
import pytest
from distributed import Client, LocalCluster
from readlif.reader imp... |
a176ac12318844da4cd0a8767cc8114d56bb648bc73ec1aad99bb9127d82f6a4 | Python | 18,568 | 544 | #!/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 mpl_toolkits.mplot3d import Axes3D
from scipy.interpolate import interp1d
from scipy.interpolate import CubicSpline
from... |
e9718205cfef8c315d2f621e162c84485f146017535805341e6202e96cac869d | Python | 18,585 | 584 | # Copyright 2018-2023 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 wri... |
ae9c5ab9ee4ef3357276d11285a93a3d30d910663911caa6a218aeb3898bc79b | Python | 18,599 | 585 | import numpy as np
import pytest
from numpy.testing import assert_array_equal
import shapely
from shapely import LinearRing, Polygon
from shapely.testing import assert_geometries_equal
from shapely.tests.common import empty_point, line_string, linear_ring, point, polygon
pnts = shapely.points
lstrs = shapely.linestri... |
24711ef45b10aba5ba09c04bb8c0b033415ced11ebd82453c802a4b44323e88d | Python | 18,642 | 556 | """Core interface module for EthoPy.
This module provides the base interface for hardware interaction and configuration of
hardware based on setup index.
"""
import logging
from dataclasses import dataclass, fields
from dataclasses import field as datafield
from importlib import import_module
from typing import Any, ... |
0db8a326b0dae3af81a9e8524a8b8e279307a15c52a74bfa5b9f64e661d21086 | Python | 18,665 | 395 | import argparse, sparse, sys, os, glob, yaml, tracemalloc
import numpy as np
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import backend as K
from tensorflow.keras import layers, models
from tensorflow.keras.utils import Sequence
from deepexplain.tensorflow import DeepExplain
# utils file... |
1403e8c02a8a7a690f09a7ffdd8e41cff351c94c792a0273f46803b4b3ad0772 | Python | 18,674 | 530 | """Test MBAR by performing statistical tests on a set of model systems
for which the true free energy differences can be computed analytically.
"""
import numpy as np
import pytest
from pymbar import MBAR
from pymbar.testsystems import harmonic_oscillators, exponential_distributions
from pymbar.utils_for_testing impor... |
0ac5441dd9eb14d728a4331505809db2b12b1e011300bbaeffd3205f5b3afeab | Python | 18,684 | 424 | import argparse
import sys
import matplotlib.pyplot as plt
import os
import numpy as np
import pandas as pd
import nibabel as nib
from scipy.stats import pearsonr, spearmanr
from statsmodels.stats.multitest import multipletests
from scipy import stats
import itertools
from scipy.spatial import distance
import glob
impo... |
6b02941621e3071c5a4cb59cd89acc23887f82dc0c3d3ada426eef36cbe6d141 | Python | 18,684 | 424 | import argparse
import sys
import matplotlib.pyplot as plt
import os
import numpy as np
import pandas as pd
import nibabel as nib
from scipy.stats import pearsonr, spearmanr
from statsmodels.stats.multitest import multipletests
from scipy import stats
import itertools
from scipy.spatial import distance
import glob
impo... |
84e8214192f5e687ab633cd799530c207d44de4dc2ee0ca4af0d7b29cb7c0d20 | Python | 18,694 | 585 | """
:mod:`alchemiscale.compute.api` --- compute API components
==========================================================
"""
import json
import datetime
from datetime import timedelta
import random
from fastapi import FastAPI, APIRouter, Body, Depends, HTTPException, Request
from fastapi import status as http_statu... |
29c5bb2eeef490b0eabc2602d280182edec2769646f0e7bca780da3973a6ef6f | Python | 18,695 | 409 | import copy
import numpy as np
import math
import random
from distance_functions import *
from mutation_functions import *
from dynamics import *
# non-overlapping generations in a haploid infinite population, the change in relative frequency is proportional to the product of fitness and frequency of a given t... |
5dc0841f85a935bacd5a09931a7e4619b4118ba28ff37d14d0bc09575a7dc2ff | Python | 18,715 | 530 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
BOOTSTRAPPING ENCODING (DIFFERENCE)
This script calculates Bootstrap 95%-CIs for the encoding accuracy for each
timepoint (in ms) and each feature. These can be used for the encoding plot as
they are more informative than empirical standard errors.
In addition, this ... |
abebdffd333733245b65c167dfe5422990527f4a048468efec115e666ffb930e | Python | 18,748 | 539 | from __future__ import absolute_import
import datetime
import logging
import os
import re
import socket
import warnings
from socket import error as SocketError
from socket import timeout as SocketTimeout
from .packages import six
from .packages.six.moves.http_client import HTTPConnection as _HTTPConnection
from .pack... |
52405e71e1a08d49d56dd42b370f9d9af544da0478ab41c43fcd0781219b197e | Python | 18,771 | 436 | import logging
import os
from PySide6.QtWidgets import QLabel, QHBoxLayout, QVBoxLayout, QLineEdit, QListWidget, QListWidgetItem, QErrorMessage,\
QPushButton, QFileDialog, QSpacerItem, QComboBox, QStackedWidget
from PySide6.QtCore import Qt, QSize, Signal
from PySide6.QtGui import QIcon, QPixmap
from gui.UtilsWidg... |
0131f5a7aa5d56068c92615941b7fc21f581e6d230b7e0d577f258d90b8bb811 | Python | 18,773 | 519 | #!/usr/bin/env python3
"""
Hi-C normalization preprocessing for Hi-Compass training data preparation.
Step 1: Contrast stretching normalization of cool files
This step prepares Hi-C contact maps for model training by applying
contrast stretching to standardize signal intensity.
"""
import cooler
import numpy as np
im... |
c2d0dd09d8bfd4602a83aefed6117e4f18b83a69f10d3ff50d043bbd7efa824e | Python | 18,805 | 469 | """
Data generators for medical image registration.
"""
# Core library imports
import os
import glob
# Third-party imports
import numpy as np
# Local imports
import voxelmorph as vxm
def volgen(
vol_names,
batch_size=1,
segs=None,
np_var='vol',
pad_shape=None,
resize_factor=1,
add_feat_... |
7ca66ddb5f0d7825d3711bab50e1b1bfb23e04d5357956bb079ed12cb4db38b7 | Python | 18,806 | 483 | #!/usr/bin/env python
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from builtins import zip
from builtins import range
import os, sys, re
import numpy as np
from .molecule import Molecule, Elements
from .nifty import isint, isfloat
np.set_printoptions(pr... |
819bb6f832b249cec432e28b69662704ae4cc5a392d95514388eee5a80541d57 | Python | 18,828 | 458 | """Functions for creating model backbones"""
import copy
from tensorflow.keras import backend as K
from tensorflow.keras import applications
from tensorflow.keras.backend import is_keras_tensor
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input, Conv2D, Conv3D, BatchNormalization
fro... |
d89e8e3a3852920257a593b5ccf75bb6ca42ece2bbfd7518758231d60776cd3d | Python | 18,857 | 550 | """
Comparison plotting functions for Ethopy analysis.
These functions create visualizations comparing data across animals,
protocols, conditions, or other experimental factors.
"""
# ToDo: Implement comparison plots for animals, protocols, and difficulty levels
# import matplotlib.pyplot as plt
# import pandas as pd
... |
870bcbd72ba26f84671756e05ca4afbc8b6f4694ca9779450dbb326b538d8cc5 | Python | 18,860 | 417 | """Tests for transform_utils"""
import numpy as np
from skimage.measure import label
from tensorflow.python.platform import test
from tensorflow.keras import backend as K
from deepcell.utils import transform_utils
def _get_image(img_h=300, img_w=300):
bias = np.random.rand(img_w, img_h) * 64
variance = np.r... |
7fa080c2ae35a666efef01103a59c8923ebf554a74e420ecd21168ff5e820dcf | Python | 18,874 | 415 | import argparse
import warnings
import numpy as np
from PIL import Image
from nilearn import datasets, plotting
import matplotlib.pyplot as plt
import os
import pickle
from tqdm import tqdm
from analyses.cluster_analysis import calc_significance_cutoff
from analyses.decoding.searchlight.searchlight import searchligh... |
28360eff920b87fc7676982180ac2f6666686a64a6c161edb3a87209f08f457e | Python | 18,939 | 496 | import itertools
import pathlib
import pytest
import shutil
import torch
import numpy as np
import pytorch_lightning as pl
from openff.nagl.config.data import DatasetConfig, DataConfig
from openff.nagl.config.optimizer import OptimizerConfig
from openff.nagl.config.training import TrainingConfig
from openff.nagl.conf... |
a73263ce8611945536211c4eb6a6d53ce35da73f9deac5fa810db305f479f547 | Python | 18,954 | 500 | """
meta/modular_recommender.py — Modular Pipeline Assembly Recommender
===================================================================
Two-layer method recommendation:
Layer 1: fingerprint → {xgb_family, e2e_family}
Layer 2a (if xgb): fingerprint → best imputer
Layer 2b (if e2e): fingerprint → best E2E archi... |
a96f6f252cb7e5b92eaacda9886503dec2a01afaeb0944cf3226e27ec1dfb402 | Python | 18,954 | 382 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch_geometric.nn import GCNConv
from timer_guard import TimerGuard
import pdb
class FeedForwardNetwork(nn.Module):
def __init__(self, hidden_size, ffn_size, dropout_rate):
super(FeedForwardNetwork, self).__init__()... |
c5647e5aa8f3214f0248a75fc6207b7926dd4b31db0d62b20d49f485c8326990 | Python | 18,960 | 518 | """
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import glob
import os
import pickle
import numpy as np
from natsort import natsorted
from qtpy.QtWidgets import QFileDialog, QMessageBox
from facemap import roi, utils
from . import guiparts
def open_file(parent, ... |
b3e009dd12b1ea534b466f70be7255e21417a36b2a536d867ffd33ee3781a7c3 | Python | 18,963 | 485 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Step-1 module (callable):
- LIF loading (Leica Image File Format)
- series listing + selection
- voxel size extraction (µm/pixel)
- channel mapping (soma=blue, ion=orange)
- channel preview: single Z-slice OR MIP (Maximum Intensity Projection)
- optional preprocessing... |
78938d229709ba75aa2baa00021fa34b3ef69a82e2f4a61497d91760448a5690 | Python | 19,017 | 681 | """
:mod:`alchemiscale.cli` --- command line interface
==================================================
"""
import click
import yaml
import json
import signal
from .security.models import (
CredentialedEntity,
CredentialedUserIdentity,
CredentialedComputeIdentity,
)
def envvar_dictify(ctx, param, val... |
c71cadc36230eec275884d5858aa96ec84f211aff9bd75e7a1cd0872d764a380 | Python | 19,022 | 545 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
import copy
import logging
import os
import pathlib
import shutil
import gufe
import numpy as np
import openmm
import pytest
from gufe.protocols.errors import ProtocolUnitExecutionError
fro... |
4a85e3f822ace2b97d030c7faff11af4e5ee633e0afc569be05ab8779ab17a5b | Python | 19,048 | 469 | #!/usr/bin/env python3
"""
Supplementary Analyses Script
===============================
Reproduces supplementary analyses in Yasuda et al. (iScience, 2026)
Analyses performed:
1. Non-canonical RBP analysis
- Count non-canonical RBPs per species (RBPWorld)
- Spearman correlation vs neurons
- Com... |
718c200eab2389b2cf8d196a4e8b36403d5babd4f21baf2f05253dbda0eff36f | Python | 19,053 | 514 | """Data preprocessing for colorectal cancer dataset (浙二).
Implements cleaning logic based on R scripts (zhe.R, data_cleaningV0.R, data_cleaningV1.R)
and field definitions from 浙二数据说明.txt.
Two preprocessing methods available:
- 'unified' (default): UnifiedPreprocessor with QuantileTransformer + BayesianGMM analysis.
... |
cded70c093bb981a4d946bd07a276d053ad125c2a607f85131b83fc6781779f5 | Python | 19,107 | 427 | import logging
import os
import re
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import bargraph, table
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule):
"""
Currently supported Longranger pipelines:
- `wgs`
- `targeted`
- `al... |
28a30a3d9ad19204992a1d9e506d550b1d298d09e9df1e06baec3c920bc545c8 | Python | 19,114 | 520 | import sys
import numpy as np
import pytest
import shapely
from shapely import (
Geometry,
LineString,
MultiPolygon,
Point,
Polygon,
)
from shapely.errors import UnsupportedGEOSVersionError
from shapely.testing import assert_geometries_equal
from shapely.tests.common import (
all_types,
al... |
8215fcc9bcbe230dfe0f19b27a1fd395d84670da74f480dc1227001223c3df09 | Python | 19,131 | 547 | """Functions using the RDKit toolkit"""
import copy
import functools
from typing import Tuple, TYPE_CHECKING, List, Union
import numpy as np
from openff.units import unit
from openff.nagl.toolkits._base import NAGLToolkitWrapperBase
from openff.toolkit.utils.rdkit_wrapper import RDKitToolkitWrapper
from openff.na... |
f177e2de3d401d5ca8f94363ec881fe40c656f72682585384986bda4ef382eff | Python | 19,216 | 386 | #!/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 r... |
7df9c794bb1479d85803b813be716d95b394abb2c752889ab8b9a5d42e5d1766 | Python | 19,226 | 486 | """
Running EM transmission through Numbers with Misaligned Model with aggressive numbers filter
"""
from loguru import logger
from sqlalchemy import select
from sqlalchemy.dialects.postgresql import insert
import yaml
from truesight import pd_utils, plot_utils, stats_utils
from truesight.dataset import (
services... |
223cdb2ab354d1d806958a97f5d863d1da7d74ea71db2baea7c74ae03a7e5853 | Python | 19,264 | 485 | """
HDF5 Storage Utilities for Nested Experiments
Provides incremental saving and loading of nested experimental results
to avoid memory issues with large experiments.
"""
import h5py
import numpy as np
import torch
from pathlib import Path
from typing import Dict, List, Optional, Any
import logging
from collections... |
5a9700e035d3690b0f8852c8a81f9365360fad7bd2fa25176c481d374d687824 | Python | 19,264 | 481 | """Functions for making training data"""
import numpy as np
from sklearn.model_selection import train_test_split
from tensorflow.keras import backend as K
from keras.utils import conv_utils
from deepcell.utils.tracking_utils import load_trks
def get_data(file_name, mode='sample', test_size=.2, seed=0):
"""Load... |
bd168e88349e7acebe4a1c6e15bbf9e4fb8763fe21b8090778b8af5c65e94ef5 | Python | 19,321 | 549 | #!/usr/bin/env python
"""
Copyright (C) 2025, 2026 Sotiris Lamprinidis, Abraham George Smith
This program is free software and all terms of the GNU General Public License
version 3 as published by the Free Software Foundation apply. See the LICENSE
file in the root directory of the project or <https://www.gnu.org/lic... |
c7fc82c84404823c77e398947980678af6459225d1363749b285c3bfa393d493 | Python | 19,324 | 571 | """Core interface module for EthoPy.
This module provides the base interface for hardware interaction and configuration of
hardware based on setup index.
"""
import logging
from dataclasses import dataclass, fields
from dataclasses import field as datafield
from importlib import import_module
from typing import Any, ... |
4e6b3d3bbee6f5b5a4ed0806fb9786dd471a100b6cafdc74d04eafc5256afb40 | Python | 19,325 | 412 | """
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import cv2
import matplotlib
import matplotlib.pyplot as plt
from fig_utils import *
from scipy.stats import wilcoxon
from facemap import keypoints
def panel_percentile_error(ax, data_path):
errors = np.load(f'{... |
ea6968e591ac7a37b07740547c5524a12f572e4b4d9f907ddbe9b57e03fbb62f | Python | 19,335 | 472 | import logging
from multiqc.base_module import BaseMultiqcModule
from multiqc.plots import table
from .utils import Metric, exist_and_number, make_headers
# Initialise the logger
log = logging.getLogger(__name__)
NAMESPACE = "Variant calling"
class DragenVCMetrics(BaseMultiqcModule):
def add_vc_metrics(self)... |
7f65d51a419c4855e17639e690667aee901b3b03ef760a147bc8d97093b2680d | Python | 19,347 | 339 | import argparse
import os
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.linear_model import RidgeClassifier
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
N_CLASSES = 70
N_TRAIN_SAMPLES_PER_CLASS = 100
N_TEST_SAMP... |
a32bb5ccb4b921a2119bc8890ce9fd3684013ddfe80002203f0c2f3af96b33af | Python | 19,350 | 473 | #!/usr/bin/env python3
"""
Statistical Validation Script
==============================
Reproduces all statistical validation results in Yasuda et al. (iScience, 2026)
Analyses performed:
1. Bootstrap resampling (n=1,000) → 95% CI, median rho, % negative
2. Leave-one-out (LOO) validation → rho per excluded speci... |
80a0a7342a01b6efc4963f154959774167d0b6ec7eb10f4290cff89906ec0f17 | Python | 19,359 | 517 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
"""
Reusable utilities for assigning partial charges to ChemicalComponents.
"""
import copy
from typing import Union, Optional, Literal, Callable
import sys
import warnings
import numpy as np... |
96e74f28799517ababe4a8c33c9b3d8a1ba56993a8b096cc6d4ab29c5ba8dd57 | Python | 19,359 | 610 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
import logging
import pytest
from openff.units import unit as offunit
import openfe
from openfe.protocols import openmm_rfe
@pytest.fixture()
def vac_settings():
settings = openmm_rfe... |
e647c0800d2a9606a9b0ad8c3c15423cae943d20b3eb9f4f2c865a776da9785a | Python | 19,368 | 467 | # coding=gbk
import os
import re
import h5py
import shutil
import numpy as np
import pandas as pd
from scipy import io
import nibabel as nib
from tqdm import tqdm
import scipy.stats as stats
from nilearn import plotting
import matplotlib.pyplot as plt
from scipy.stats import pearsonr
def plot_weight(s... |
2d39eafb21b000485b39e57f2c3fa8fbfdfb0ee164691317b1fa9b4b1cda94b2 | Python | 19,378 | 684 | """
:mod:`alchemiscale.cli` --- command line interface
==================================================
"""
import click
import yaml
import json
from .security.models import (
CredentialedEntity,
CredentialedUserIdentity,
CredentialedComputeIdentity,
)
def envvar_dictify(ctx, param, value):
"""Ca... |
587343dcb416b1aed63ce871b4bbe2d89c92465c0fac0e97a754ee563f45d642 | Python | 19,397 | 370 | import numpy as np
import sys
sys.path.append("/home3/ebrahim2/beyond-brainscore/analyze_results/figures_code")
from trained_untrained_results_funcs import load_perf, select_columns_with_lower_error, calculate_omega, array_with_highest_mean
from plotting_functions import plot_across_subjects
from matplotlib import pypl... |
f3a4153039d87e7c318298952016fb5bb364916b711df68beb8fff0cf73ba23d | Python | 19,445 | 327 | # This script plots the spike sorting results: single-unit psths, waveform and tuning to different task parameters
import argparse
import os
import numpy as np
import math
import matplotlib.pyplot as plt
import pickle as pkl
from datetime import datetime
'''
Example cmd:
For t15,
python single_unit_psth_tuning.py ... |
d7353eaf4eda27294bb7fed4c37dc3c6ae6c5e006e2df2ae1aa8c3cd0cba9a62 | Python | 19,451 | 544 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
from importlib import resources
from math import sqrt
from unittest import mock
import gufe
import mdtraj as mdt
import numpy as np
import openfe
import pytest
from numpy.testing import asse... |
857528344bebf85f33a0d5ec1ba31208c7b867f06f466c55ecadefb1bffe8cd1 | Python | 19,469 | 657 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
PLOTS FOR ENCODING ANALYSIS
This script creates plots for the encoding analyses.
@author: Alexander Lenders, Agnessa Karapetian
"""
# -----------------------------------------------------------------------------
# STEP 1: Initialize variables & import modules
# -----... |
0c3c07b69d81e795d4edcce02bfeeade45e96ee16506350c96d725bf0f5a5198 | Python | 19,473 | 552 | # 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,... |
e35b4bab778b4ab0446c455542954616af4aee8d659fd6f51e9635974842510a | Python | 19,474 | 310 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Metadata about languages used by our model training code for our
SingleByteCharSetProbers. Could be used for other things in the future.
This code is based on the language metadata from the uchardet project.
"""
from __future__ import absolute_import, print_function
... |
0d9ea7b95f3e95566e64f8f0dadfcd86e2df0ea912377d5de563b07ed62d3a48 | Python | 19,491 | 503 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
import copy
import logging
import os
import pathlib
import shutil
import gufe
import numpy as np
import openmm
import pooch
import pytest
from gufe.protocols import execute_DAG
from gufe.pro... |
fe27324b9f459362edd4d7ce169f9e0681ea1c4a2dd441456f3e5a4dfdf97700 | Python | 19,512 | 519 | """
todo -- simplify the total energy read in, the kinetic energy read-in, temperature read-in
"""
# =========================================================
# IMPORTS
# =========================================================
from optparse import OptionParser
from pathlib import Path
import numpy as np
import py... |
809043960358daab7642c96b05ac501cfc7d65248925fd5527387b50fe68d8fd | Python | 19,522 | 532 | #!/usr/bin/env python3
import os, sys, re
import logging
import argparse
import subprocess
import gzip
import multiprocessing
import time
import numpy as np
## Set up the logging
logging.basicConfig(format='\n %(levelname)s : %(message)s', level=logging.DEBUG)
logger = logging.getLogger(__name__)
def processVCFHe... |
dd2f0ff8bd69bfe80e72c93f05afa5ff98b068a5810fbbb09511a1145fa907f7 | Python | 19,531 | 539 | import gzip
import warnings
import numpy as np
import pytest
from numpy.testing import assert_allclose
from openff.toolkit.topology import Molecule
from openff.toolkit import Molecule, RDKitToolkitWrapper, AmberToolsToolkitWrapper, OpenEyeToolkitWrapper
from openff.nagl.toolkits.rdkit import NAGLRDKitToolkitWrapper
fr... |
8dc446d48864f864dc3a1900bf15be6da007ea5af98e1e1075cbb6ec6bd106ae | Python | 19,536 | 545 | """Test MBAR by performing statistical tests on a set of model systems
for which the true free energy differences can be computed analytically.
"""
import numpy as np
import pytest
from pymbar import MBAR
from pymbar.testsystems import harmonic_oscillators, exponential_distributions
from pymbar.utils_for_testing impor... |
9164fb95cadbf37075c0f0924cd06657631e57e5532f342aefa29638069c52ac | Python | 19,567 | 474 | import json
import os
import torch
import anndata
import scanpy as sc
import numpy as np
import pandas as pd
from scipy import sparse
from scipy.sparse import csr_matrix
from torch.distributions import Multinomial
from torch.utils.data import Dataset, DataLoader, random_split, WeightedRandomSampler
from ... |
1fffd248df2488026967960647abb98c10000d0da9357e07b8cb92976ab1563d | Python | 19,586 | 479 | import ast
import logging
from typing import Dict
from multiqc import config
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import bargraph, heatmap, linegraph
from multiqc.plots.table_object import ColumnDict
log = logging.getLogger(__name__)
class MultiqcModule(BaseMult... |
a719e7f5a443a672360328200d2e16722b9b0bbdedd8f819baec5590f878f61c | Python | 19,594 | 489 | import logging
from typing import Dict, List, Optional, Tuple
import numpy as np
from multiqc import config
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import linegraph
from multiqc.plots.linegraph import LinePlotConfig, Series, Marker
from multiqc.plots.plot import PCon... |
f24064504e0c3cc0b5ea539846b8530eb4df109178a6cd4dd6f0a4e21ae19970 | Python | 19,600 | 574 | import itertools
from typing import Union, Optional
import matplotlib.pylab as plt
import numpy as np
import networkx as nx
from adjustText import adjust_text
from . import plotlying, stats
def _master_plot(
x: np.ndarray,
y: np.ndarray,
title: str = "",
xerr: Optional[np.ndarray] = None,
yerr: Op... |
5f77e95ba4ec1514102ec7e79b906f71d7fa16276e94355b5e5495c743482f79 | Python | 19,642 | 619 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
import itertools
import os
from importlib import resources
import MDAnalysis as mda
import numpy as np
import pytest
from openff.units import unit
from rdkit import Chem
from openfe.data._... |
70dbc68a792fd1882480e7f6666650ef95de8c70b32590f708b46aa5887827ed | Python | 19,650 | 456 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
from typing import Any, Dict, List, Optional, Tuple, Union
import dask.array as da
import numpy as np
import xarray as xr
from .. import constants, exceptions
from ..dimensions import (
DEFAULT_DIMENSION_ORDER,
DEFAULT_DIMENSION_ORDER_WITH_SAMPLES,... |
8e526bb1319254a4c139f0d66c4f6eb3eebe9f07d32ec651a4c034a2b18358bc | Python | 19,683 | 781 | """
Atomic datatypes for the topology such as Atom, Bond, Angle, Dihedral, etc.
The order of the fields comes from the gromacs topology file format.
See [gromacs manual](https://manual.gromacs.org/current/reference-manual/topologies/topology-file-formats.html#topology-file)
"""
import logging
from dataclasses import d... |
9d6ff3af954a1d63d36a2fcc1e4684623a0532f692f5d920b213dfae70d97ef9 | Python | 19,694 | 450 | import os
import statistics
from scipy.signal import butter, filtfilt
import subprocess
import argparse
import pandas as pd
import numpy as np
from nilearn.datasets import load_mni152_brain_mask
from nilearn.maskers import NiftiSpheresMasker
from nilearn.maskers import NiftiMasker
import scipy.stats as stats
from scipy... |
cac969f1c9773b66af2bb69e33b84ccd1d5eee87d825dd714ed1e3cfae424277 | Python | 19,697 | 488 | # -*- coding: utf-8 -*-
"""
Created on Thu Jul 27 14:15:17 2017
@author: david
"""
from . import parallel_task_manager
import os
import glob
import numpy as np
import itertools
import argparse
import multiprocessing as mp
try:
import queue
except ImportError:
import Queue as queue
from . import tree as tr... |
55549480cda7abfee1dbe2383b3d34ed81463742c96f5abce978d24520ce69d7 | Python | 19,717 | 450 | import os
import statistics
from scipy.signal import butter, filtfilt
import subprocess
import argparse
import pandas as pd
import numpy as np
from nilearn.datasets import load_mni152_brain_mask
from nilearn.maskers import NiftiSpheresMasker
from nilearn.maskers import NiftiMasker
import scipy.stats as stats
from scipy... |
01b0bfb4a8b2e680bd8947023677da90ff30443abb5a7c31fb79764f74782de0 | Python | 19,728 | 420 | import pdb
import json
import random
import time
import pickle
import datetime
import numpy as np
import matplotlib.pyplot as plt
from sklearn.metrics import roc_auc_score, accuracy_score
from sklearn.preprocessing import label_binarize
import torch
import torch.distributed as dist
from torch.nn.parallel import Distri... |
c21ce55fa51312038330e0b2d190cc50e351042cf9c3220cf19f68a57018f8b9 | Python | 19,763 | 536 | from __future__ import absolute_import
import collections
import functools
import logging
from ._collections import RecentlyUsedContainer
from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, port_by_scheme
from .exceptions import (
LocationValueError,
MaxRetryError,
ProxySchemeUnknown,
... |
e5d6e76140dba1aca49d0501ac6ed89740d20e94e2b13d39bf41c8794c8b70b0 | Python | 19,767 | 493 | import logging
import re
from multiqc import config
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import table
log = logging.getLogger(__name__)
VERSION_REGEX = r"# Version: v([\d\.]+)"
class MultiqcModule(BaseMultiqcModule):
"""
This module parses the output fr... |
3b78746868a6375f826178c344a192809b44f25b58c0a1365fd537157f3de308 | Python | 19,775 | 487 | # src/data/loader.py
"""
Data loader: download and prepare datasets
"""
import os
import numpy as np
from PIL import Image
from pathlib import Path
def check_dataset_exists(data_dir, n_people=40, imgs_per_person=10):
"""
Check if dataset already exists and is valid.
Parameters:
data_dir: pa... |
625d8e3b76147502b8297c250ea1bb5941c4af0fa98891828b680c759b6b5bb0 | Python | 19,817 | 499 | """
Read and validate kimmdy.yml configuration files
and package into a parsed format for internal use.
"""
from __future__ import annotations
import logging
import logging.config
import os
import shutil
from pathlib import Path
from pprint import pformat
from typing import Any
import yaml
from kimmdy.plugins impor... |
00691751a3a459efd003a480ea25be3302b275ee664a9ab2f5dc9a2e9ce27cd1 | Python | 19,828 | 562 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
import logging
import numpy as np
import numpy.typing as npt
from openff.interchange.components._packmol import (
RHOMBIC_DODECAHEDRON,
UNIT_CUBE,
_check_add_positive_mass,
_... |
f0c43a16918b97b3f34beadfb0bb80fc65179278881a9d52aa4801f6f1bcce97 | Python | 19,846 | 562 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
import logging
import numpy as np
import numpy.typing as npt
from openff.interchange.components._packmol import (
RHOMBIC_DODECAHEDRON,
UNIT_CUBE,
_check_add_positive_mass,
_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.