sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
e8bf5f15b20ba6a784a3e27237cf8853455129c375a5a1312b4e98ba7f2cf6dc | Python | 17,243 | 459 | from __future__ import annotations
import re
from enum import Enum, unique
@unique
class RegionsOrGenesType(Enum):
"""Enum describing all possible regions or genes types."""
REGIONS = "regions"
GENES = "genes"
@classmethod
def from_str(cls, regions_or_genes_type: str) -> RegionsOrGenesType:
... |
163d5a54eef95c9bb2f9dcc313abec170594dec33634bd6488b9ef5e8e1bee47 | Python | 17,248 | 386 | r"""Sequence homology search — DIAMOND and NCBI BLAST+ behind one API.
Why this module exists
----------------------
The fast path was already in the codebase, but it was trapped: SAMap's
``build_blast_maps`` (``omicverse/external/samap/_run.py``) drove DIAMOND with
an ``auto``-detect and a concurrent two-direction ru... |
26428343285d0d16d58f89c9866dffac3512491eb3768a7ca0f5c2300213a510 | Python | 17,253 | 340 | """SecAct secreted-protein communication backend for ``ov.single.run_ccc``.
SecAct (Ru et al., Nat Methods 2026) does not score ligand-receptor
co-expression. A sender -> receiver edge for secreted protein *P* means
1. *P* is up-regulated in the **sender** (Wilcoxon, BH ``< padj``, logFC,
mean and detection cut-of... |
18a3c9d0042485a71443c01f4487c5281b0b65c2be76d05beb7bc6d31ff5514c | Python | 17,258 | 484 | """
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
from __future__ import annotations
import logging
from functools import partial
from typing import TYPE_CHECKING
import numpy as np
impor... |
f908f1287ce4a33b3354e587348ce4bc056d4333083c4615743df190e58cb456 | Python | 17,259 | 427 | # Copyright 2025 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, ... |
90245beb7739696121d892a0505656a8f6ddc566687af3d81b765c166358ec69 | Python | 17,263 | 441 | ####################################################################################################
# Copyright (c) 2020, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis>
#
# This program is free softw... |
459ac8006242f62096dfb1fcf877a5ed15667be3edd532a203bd84b4acca3ca5 | Python | 17,270 | 423 | from typing import List, Tuple, Optional
import networkx as nx
from scipy.sparse import issparse
import numpy as np
import random as rm
from causaldag import unknown_target_igsp, gsp
from causaldag import partial_correlation_suffstat, partial_correlation_test, MemoizedCI_Tester
from causaldag import gauss_invariance_su... |
50a114fa126908a2a5b9108dfb4dd41f40700112480051c9b7c38c1fe4506bd8 | Python | 17,272 | 405 | from typing import Any, Callable, Dict, List, Optional, Union
import torch
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer
from diffusers import (
AutoencoderKL,
DDIMScheduler,
DiffusionPipeline,
LMSDiscreteScheduler,
PNDMScheduler,
StableDiffusionPipeline,
UNet2D... |
1fcae55e634ee64e146b629bf85962f2327e4d43410c3b465e726248100d447a | Python | 17,279 | 373 | ################################################################################
# -- Simulating Exc-Inh spiking networks in response to inhibitory perturbation
################################################################################
import time, os, sys, pickle
from imp import reload
import defaultParams; rel... |
584927d644c50dd91cc1b0241275fe7e477ca2e76b3e7c6b3dbdc86b154eb70e | Python | 17,279 | 373 | ################################################################################
# -- Simulating Exc-Inh spiking networks in response to inhibitory perturbation
################################################################################
import time, os, sys, pickle
from imp import reload
import defaultParams; rel... |
2911285f15943cc0e2381c7d4a08ee0d09980c69f12ce5d826b217276ba89241 | Python | 17,299 | 491 | """Shared channel-core abstractions for Jarvis channel implementations.
Centralizes session-resolution helpers, request-building logic, result
processing, web-bridge interaction, and text utilities that were previously
duplicated across every channel file.
Channel-specific transport behaviour (how messages are *sent*... |
919531039211ad9a8660087ab7eed1828b44ad824c26789f150d4ca0c649ae4c | Python | 17,308 | 600 | import datetime
from dataclasses import asdict
import numpy as np
import pandas as pd
import pytest
from data_profiling.config import Settings
from data_profiling.model.describe import describe
from data_profiling.model.summary import describe_1d
from data_profiling.model.typeset import ProfilingTypeSet
check_is_NaN... |
1bb993f285e32555968c168d54d1721b78b45ba1951e76249c5ac72af00a5be5 | Python | 17,332 | 499 | # Copyright 2023 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, ... |
1afbe8dac1a8805316975b7d9fd439c4eb5415511ed8f6acd3c73b05069fd893 | Python | 17,336 | 425 | # Please see LICENSE.md for the full license document:
# https://github.com/AdaptiveMotorControlLab/CEBRA/blob/main/LICENSE.md
#
# 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.a... |
7c33ea0d7b3dd1969fc7b4c102d9f6cfa42706fcca88ba99ae464f7b8962eadd | Python | 17,361 | 473 | # -*- coding: utf-8 -*-
# (C) Copyright 2026 IBM. All Rights Reserved.
#
# Licensed under the MIT license. See LICENSE file in the project root for details.
"""Tests for RNN layers."""
from torch import randn, ones, no_grad
from torch.nn import MSELoss
from numpy.testing import assert_array_almost_equal, assert_raise... |
2015e0b4df4fea8c5e55a9803c753ab0a37699af53442c895921b3da0efd6f5e | Python | 17,362 | 458 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------------
# Created By : Kangjoo Lee (kangjoo.lee@yale.edu)
# Last Updated: 08/06/2024
# -------------------------------------------------------------------------
# =========================================... |
20811da5d06bb5b0fb7ab0d37bd5e27c3ecb504e4ae407639ff1da1c5b50c1ab | Python | 17,368 | 399 | import pandas as pd
import torch
import numpy as np
import anndata
import matplotlib.pyplot as plt
from ._utils import load_data, data_process,bulk2single_data_prepare
from ._vae import train_vae, generate_vae, load_vae
from ._map_utils import create_data, DFRunner, joint_analysis, knn,create_data_pyomic
import os
impo... |
dbbd114209d7659986bdaa07158307b6328f558b655ce39b2026e7caf1571049 | Python | 17,368 | 398 | import torch
from torch import nn
from torch import distributions
from torch.nn.parameter import Parameter
from sklearn.linear_model import LinearRegression
import numpy as np
use_cuda = torch.cuda.is_available()
device = torch.device('cuda:0') if use_cuda else torch.device('cpu')
from torch import nn
from torch impor... |
96bf30dd1bb1f3fead433b314cfd4b5cc35b431f5c1f9cedb6e849784108af74 | Python | 17,375 | 437 | # Copyright 2021 AlQuraishi Laboratory
# 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
#
# U... |
120b2e068b81fbe0f71b7ff7cb958602a744232b52773386e6ef033ff50726b7 | Python | 17,376 | 503 | import os.path as op
import warnings
from numpy import unique
from fsub_extractor.utils.anat_utils import *
from fsub_extractor.utils.system_utils import *
from fsub_extractor.utils.froi_utils import *
from fsub_extractor.utils.streamline_utils import *
def extractor(
subject,
tract,
generate,
tract_n... |
f43db118f5bceb14b6aa90f28e05a94c71ab4e0a59804b368a6346947455d57b | Python | 17,379 | 440 | ####################################################################################################
# Copyright (c) 2016 - 2024, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis>
#
# This program is fre... |
93ea5f5e5422737eb7cf2b292c264eb0026462e09aaeab8935c125209bf7d304 | Python | 17,381 | 578 | """
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
from __future__ import annotations
import pytest
import torch
import torch.nn as nn
from torch import distributed as dist
from fairchem.c... |
e5dd0166ad202e5ca17da7d4fcdb467259ae05f9b172ef6a367d2b4918f1b3bd | Python | 17,382 | 476 | import duckdb
import os
import pandas as pd
import numpy as np
import datetime
from joblib import Parallel, delayed
from python.utils import (
custom_logger,
read_format_query,
to_parquet_per_case
)
from config import (
TARGETS,
EXTREME_VALUE_LIMITS,
MIN_OBS_REQUIRED,
MAX_HOURS,
DATE_... |
b5823dad81f9dec7c26a693ce4cafc9022b61511501d61be2f448ce9ba928804 | Python | 17,386 | 301 | import os
from skimage.measure import regionprops
from skimage import morphology
from scipy import ndimage
from sklearn.cluster import KMeans
import numpy as np
import pyvips
import math
import pickle
import time
import cv2
import pandas as pd
import utils_segmentation
############
# Set this option t... |
309d96fa7bd8b62bec1a4ac695a55f00644e4a437584b70de4ab9b0d9f8cfdff | Python | 17,387 | 376 | ####################################################################################################
# Copyright (c) 2016 - 2024, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis>
#
# This program is fre... |
1f9a5124fac108048a9a866593ab5129500a2a1ab7193d9ce7f4bb37cbe5771f | Python | 17,388 | 464 | ###############################################################################
'''This code has functions which process the information in the .h5 files
datafile_{}_{}.h5 and convert them into a format usable by Keras.'''
###############################################################################
import torch
fro... |
354949cef1c579087b48524507b24b1b3379a89487e5d3b8feec7087bb263ee9 | Python | 17,395 | 443 | r"""Forest plots — effect sizes with confidence intervals, and meta-analysis.
A forest plot is the natural display for any list of "effect ± CI" rows:
odds/hazard ratios per cohort, per-gene coefficients from a regression, Cox
results across subgroups, or the studies of a meta-analysis. ``ov.pl`` had one
only inside t... |
45ca47b78dc635955d92172a9d7af98a296a7f19a30610649d822a2d6fb94deb | Python | 17,401 | 400 |
"""This module contains classes that implement several objectives to optimize.
One can define a new objective by inheriting abstract class :class:`Objective`.
***
This implementation is for the objectives of the 2nd version of the 2nd gym setting, in which datamaps evolve over time.
Some details, such as bleaching com... |
47f55943e703ce5b73e8c01e4ceb2fe58ddf33cfb19b81777eb371b088445ac7 | Python | 17,410 | 442 | """Provide the analysis functions."""
import os
from dataclasses import dataclass, fields
from typing import Tuple, Union
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import mdtraj as md
import numpy as np
import seaborn as sns
from matplotlib.ticker import FormatStrFormatter
from pymbar import ba... |
14f8e8aeb9a5027160e1cdbb688eb7d1614da0fe0fd550a72e616983a488b4a6 | Python | 17,411 | 367 | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 18 17:23:00 2020
@author: ju-bar
Binning functions
Note: These are test functions. It turns out that they are too slow
from Python to be of good use. However, they work like a charm and
are fast enough when implemented in C++ language.
This code is part of the 'emilys' ... |
c9e8e5bbdf8036909824d6f8ff3be08333aa693a6ff2ceea98b3833a9fede0d0 | Python | 17,412 | 532 | """Helper functions and classes for users.
They are intended to be used by end users but should not be depended upon for
skorch-internal usage.
"""
from collections.abc import Sequence
from functools import partial
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.base import TransformerMixin
im... |
400c7a4aed9949aee46c6dc4b6f4aea906b01d6459d9ad683287f7e4881d6a2e | Python | 17,416 | 534 | """Neurovascular Coupling with VASO experiment stimulation."""
import pandas as pd
import contextlib
from psychopy import core, prefs, logging, event, visual, gui, monitors
from psychopy.hardware import keyboard
import numpy as np
import os
import time
# Load a keyboard to enable abortion.
defaultKeyboard = keyboard.... |
f51308f4c422adb31f966a751396cefb600bc927a395cc12dcccd2876484c78e | Python | 17,416 | 544 | """
Run the reclassification workflow for a previous tedana run
"""
import argparse
import datetime
import logging
import os
import os.path as op
from glob import glob
import numpy as np
import pandas as pd
import tedana.gscontrol as gsc
from tedana import __version__, io, reporting, selection, utils
from tedana.bibt... |
3865ed6c7dcaf932ad4d0d6945e63a2496e295cd67b8ef0a164c7b904a1ab795 | Python | 17,417 | 441 | # -*- coding: utf-8 -*-
"""
"""
#%%
# libraries:
from tensorflow.keras.layers import concatenate as concat
from sklearn.model_selection import train_test_split
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input
from tensorflow.keras.layers import Dense
from tensorflow.keras.... |
b1b055d9274084b90fb5a0e00a71df1cec5f7e3f952fe96772d444725a245921 | Python | 17,418 | 424 | # -*- coding: utf-8 -*-
"""TIBDA (Numenta Anomaly Benchmark (NAB) dataset Analysis).ipynb
Automatically generated by Colab.
Original file is located at
https://colab.research.google.com/drive/1wUezSCARGsUhO2etx1KOWZTY3r2N1rUB
"""
import matplotlib.pyplot as plt
import numpy as np
# Adjusted response times for e... |
12120e8715048089fad54124eb4c0fd447065433154a8b03da1e8acff39cdff4 | Python | 17,427 | 625 | from dataclasses import dataclass, field
from enum import Enum
from typing import Any, Dict, List, Optional
from ray.util.annotations import DeveloperAPI
@DeveloperAPI
@dataclass
class GridPos:
x: int
y: int
w: int
h: int
# Inside a Kubernetes pod, the reporter agent returns placeholder disk values... |
441bed55d2fe6a5b131b814367fdebbdb202e7821d4676453b170d757b861976 | Python | 17,440 | 505 | """I/O for ``ov.genetics`` — GWAS summary statistics, PLINK and VCF.
Flexible readers (and writers) for the heterogeneous file formats of
statistical genetics: :func:`read_sumstats` parses a GWAS
summary-statistics table with column-name auto-detection,
:func:`read_plink` loads a PLINK ``.bed`` / ``.bim`` / ``.fam`` t... |
30cdfed26156861d6922a085b06a18deada66e34d2de6d6cd57384e3bf89a7e5 | Python | 17,443 | 634 | # Copyright (C) CVAT.ai Corporation
#
# SPDX-License-Identifier: MIT
import json
import operator
from collections import defaultdict
from collections.abc import Generator, Iterable
from copy import deepcopy
from pathlib import Path
import pytest
from shared.utils.config import ASSETS_DIR, SHARE_DIR
class Container... |
e46ca7d74514e7352ec38bf59b4406ae87b99a4b88cb66522ff06f362582faa8 | Python | 17,446 | 306 | import os
import pyvips
import sklearn
import torch
import numpy as np
import datetime
import cv2
import sklearn.metrics
from timeit import default_timer as timer
import json
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
import glob
from torchsummary import summary
impo... |
f43b06511d9fee8df9547b73e1a9d878bdfeded950c46c23bfdb1410368d0c88 | Python | 17,462 | 405 | import numpy as np
import numpy.linalg as linalg
import sys
from .basic_distributions import Distribution
from ..utils import *
# from mofapy2.core import gpu_utils
# TODO: Enable GPU support
class MultivariateGaussian(Distribution):
"""
Class to define multivariate Gaussian distribution.
This class can... |
a5ec5fa2d6a718980fd2f287bda144b8d7f7a78990b5ff2654467a7394696359 | Python | 17,465 | 304 | import itertools
import os
import unittest
from tempfile import TemporaryDirectory
import numpy as np
import SimpleITK as sitk
from nnunetv2.evaluation.evaluate_predictions import compute_confusion_matrix, \
compute_tp_fp_fn_tn_for_labels_or_regions, compute_tp_fp_fn_tn, region_or_label_to_mask, compute_metrics, ... |
c2b924afe29810ce851cdca6571f405a58a9e7870fa5d3c0c729f4ec7804ab19 | Python | 17,465 | 338 | """
The files "data_preparation.py" and "thresholding.py" need to be executed before this script!
This script will create a mask for the image, in which both markers (ch2 and ch3, i.e. CHCHD2 and TOM20) are present.
This will be used as the intersection mask for further analyzations.
The mean intensity per cell line an... |
1c9bff2dcf529d3968acc363e4ca15a490123f4062b06884c75895b22355d3b5 | Python | 17,466 | 516 | import pickle
import math
import sys
import os
import numpy as np
import itertools
import logging
import pandas as pd
import subprocess
from pathlib import Path
from statsmodels.stats.multitest import fdrcorrection
import yaml
logging.basicConfig(
format="[%(asctime)s] %(levelname)s:%(name)s: %(message)s",
lev... |
4ede927aed581773e61ed2457f038aa75c14690055258f4dc80797959c7becc0 | Python | 17,466 | 390 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import train_test_split
import tensorflow as tf
from imblearn.over_sampling import SMOTE
from imblearn.under_sampling import Ran... |
2715fdb809217bec604f1bb676f206bbdc8e2f07eaa513416aa621fd849d882c | Python | 17,476 | 523 | import nibabel as nib
import numpy as np
import os
from os import path
from nilearn.input_data import NiftiMasker
from scipy.io import loadmat
from samri.report.utilities import roi_df, pattern_df
from joblib import Parallel, delayed
import statsmodels.formula.api as smf
import multiprocessing as mp
import pandas as ... |
7fe8b973e438c1ad4f0c3441a5390c1fa308639e2d196ca46bdae9e8d43848ac | Python | 17,476 | 349 | import multiprocessing
import os
from copy import deepcopy
from typing import Tuple, List, Union
import numpy as np
from batchgenerators.utilities.file_and_folder_operations import subfiles, join, save_json, load_json, \
isfile
from nnunetv2.configuration import default_num_processes
from nnunetv2.imageio.base_rea... |
174a1b7fc5a916a42205b4d4acc91385f76f3f71706294438665634c310bc1c4 | Python | 17,490 | 374 | ################################################################################
# -- Simulating Exc-Inh spiking networks in response to inhibitory perturbation
################################################################################
import numpy as np; import pylab as pl; import time, os, sys, pickle
from sci... |
961ac4cc7729e82ea7fb31c14c5c1003f52dca3cbc10beb0cf5f18c7eee464ea | Python | 17,505 | 395 | from __future__ import print_function
# Usage python train_with_labels_three_fold.py number_of_data_parts_divided NEPDF_pathway number_of_category
# command line in developer's linux machine :
# module load cuda-8.0 using GPU
#srun -p gpu --gres=gpu:1 -c 2 --mem=20Gb python train_with_labels_three_foldx.py 9 /home... |
14bca399a2f26cc03e63d94b2d4e00d58898ce3d02bd2c2a0a5e0e0743fed9e3 | Python | 17,527 | 471 | import numpy as np
from lib5c.algorithms.correlation import \
make_pairwise_correlation_matrix_from_counts_matrix
from lib5c.plotters.correlation import plot_correlation_matrix
from hic3defdr.plotting.distance_dependence import plot_dd_curves
from hic3defdr.plotting.histograms import plot_pvalue_histogram
from hi... |
e908f3ebe070c45ec42c479e48229b67a912a60a13fc94ff163437d7ec155a1d | Python | 17,531 | 329 | import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from exp_data_analysis import get_exp_reward_around_transition, \
mouse_behaviour_data,mouse_behaviour_data_newest,mouse_neural_data,mouse_behaviour_for_neural_data
from BeliefHistoryTabularRLSimulate import get_env_agent
from utils import ... |
51e0bfa6de02c9f8b221b8fe670e79342ab9908ab5a0de800f09aed5d80c148e | Python | 17,537 | 492 | ####################################################################################################
# Copyright (c) 2020, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis>
#
# This program is free softw... |
999bbe7ef7b0a4ddb2ab8d6fb3ede0e713b62d6c359ae17eb7318550c37ce6e2 | Python | 17,546 | 342 | ####################################################################################################
# Copyright (c) 2016 - 2024, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis>
#
# This program is fre... |
1b26f690c90db2eea008cf2fb785557e83ac11307b7b771e4efd5c8457812357 | Python | 17,557 | 444 | #!/usr/bin/env python3
# Lucas Seninge (lseninge)
# Group members: Lucas Seninge
# Last updated: 04-6-2022
# File: scorect_api.py
# Purpose: Automated scoring of cell types in scRNA-seq.
# Author: Lucas Seninge (lseninge@ucsc.edu)
# Credits for help to: Duncan McColl
# Import packages
import pandas as pd
import nump... |
17492c5378fa4fe90a17232ca4b49042407bf7c90d41d4bd0b1716d260c9f6db | Python | 17,562 | 548 | import cv2
import gzip
import pickle
import numpy as np
from PIL import Image
from gimpformats.gimpXcfDocument import GimpDocument
from scipy.ndimage import binary_dilation
from skimage.morphology import skeletonize
from matplotlib.image import imread
import torch
"""
Image reading functions
"""
def color_codes():... |
b4329e45caf45558a74c35aa0be0467a5878e8cc75952cbaffba5f4a1b88f61b | Python | 17,568 | 576 | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from .modules import Transformer, PairwiseTransformer
class EmbeddingTransformer(nn.Module):
def __init__(
self, n_feats, n_layers, n_heads, d_model, d_ff, pos_enc=True, activation=F.relu
):
super(EmbeddingT... |
cb43be9323f1c163d80b1c55878596fe2c068fc4a4f78829937f5e1f535c117a | Python | 17,577 | 359 | import argparse
import math
import os
import random
import shutil
import time
import warnings
import numpy as np
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
from torch.nn.utils import clip... |
c8676a748137288b6f516f37d0905755f37facf2cab2a0691d88ede1ec5de1ff | Python | 17,581 | 412 | r"""Golden Gate overhang fidelity, and orthogonal overhang set design.
``golden_gate`` orders fragments by complementary overhangs and reports whether
they close a circle. That is the right answer to "does this assembly have a
valid order" and no answer at all to "will it actually work". Ligase does not
only join perf... |
94c6a299d4c7125d4616894efce6f0b78df2127530a95423ee927280320c1a39 | Python | 17,589 | 558 | #!/usr/bin/env python3
# /// script
# requires-python = ">=3.9"
# dependencies = []
# ///
"""
Build Ray Docker images locally using raymake.
"""
from __future__ import annotations
import argparse
import json
import os
import shutil
import subprocess
import sys
from dataclasses import dataclass
from pathlib import Path... |
91952200c17e4d850147c9aa7eeff60d4cc687dcfceb444f08ceeecd1ac5e4bc | Python | 17,595 | 428 | ####################################################################################################
# Copyright (c) 2016 - 2024, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis>
#
# This program is fre... |
d61f1a3aa7486dc27bdca1e9f8ebe9baeda4139cd4deff6630499d832e74ebde | Python | 17,596 | 496 | """
PrerequisiteChecker - Detects executed functions from AnnData state.
This module provides the PrerequisiteChecker class which examines AnnData
objects to detect which preprocessing/analysis functions have been executed.
It uses multiple detection strategies with confidence scoring.
"""
from typing import Dict, Li... |
81b20f83595b1695262ff2528b9a56da869517f6ad6fde0b6c878636a2c4b59f | Python | 17,600 | 549 | import os
import numpy as np
import pandas as pd
import scanpy as sc
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.metrics import r2_score
from scipy.stats import pearsonr, gaussian_kde
# Module import
from .post_analysis import get_z_umap
from .utils import extract_feature
def plot_integrate... |
abed1326b81988e862f8b8e436417101e39963556507e6f756bbd6fa1b379868 | Python | 17,600 | 411 | #!/usr/bin/env python
from __future__ import print_function
import argparse
import glob
import gzip
import sys
import numpy as np
import os
import matplotlib.pyplot as plt
import pickle
import time
import math
VCF_1 = 1
VCF_2 = 2
VCF_LINE = "l"
VCF_POS = "p"
VCF_CHR = "c"
CHR_IDX = 0
POS_IDX = 1
ID_IDX = 2
REF_IDX =... |
409b1e90be16630579bf71739f48eeb5d8c0bd775f67cbfde1ee61ccc1411dca | Python | 17,610 | 493 | from Bio import SeqIO
import os
import numpy as np
from collections import OrderedDict
import argparse
import networkx as nx
import vamb
import json
from collections.abc import Sequence
from typing import cast
def main(
contig_names: Sequence[str],
contig_lengths: Sequence[int],
cluster_contigs: dict[str... |
fff0899e4ea1a0cc5dd9e1fc426ba5e67ef2a51c6ee3a22045d7a934347411be | Python | 17,623 | 540 | """
Manifest generation from the OmicVerse function registry.
The manifest is the single internal representation consumed by the MCP server,
schema generator, executor, and adapters. It is built entirely from
``_global_registry`` — no hand-maintained parallel tool list.
"""
from __future__ import annotations
import... |
4cc5ce25509c080d0b1a230e2c1fbc240e08320a31ca01387988117a9d99217d | Python | 17,642 | 428 | import numpy as np
import pandas as pd
from .gibbs import GibbsSampler
from .joint_post import JointPost
#from pybayesprism import process_input
from .process_input import validate_input, filter_bulk_outlier, collapse, norm_to_one
#import pybayesprism.references as rf
from .references import RefPhi, RefTumor
from .opti... |
c5c6184506440f814cd4f886b4963c68e61fc1daf148651bb776a4fee35a8c37 | Python | 17,648 | 434 | """PRIDE proteomics data collector."""
import logging
from typing import Any, Dict, List, Optional
from src.api.pride import PRIDEClient
from src.models.protein import Protein
from .base import BaseCollector
from config.config import settings
logger = logging.getLogger(__name__)
class PRIDECollector(BaseCollector... |
af7be15bbf0bc70640d659cf2d660336dc2f3573f0a85a1df2de74d29c7a4ad2 | Python | 17,651 | 496 | from __future__ import annotations
from dataclasses import dataclass
import logging
from pathlib import Path
from ._style import Colors, EMOJI
logger = logging.getLogger(__name__)
@dataclass
class FindLatentRepresentationsConfig:
"""Configuration for the vendored gsMap latent-representation step."""
workd... |
4de363a80dfd84a53a60cafa5d47ea3ec15dbc6b763a3d15221ae49504a029fc | Python | 17,654 | 432 | # MIT License
#
# Copyright (c) 2023 Advanced Micro Devices, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy... |
1391577c9ce6d6363bc73c78ee2597a3382c2862f671287e07c1f0d6ce1e6d7d | Python | 17,657 | 382 | ####################################################################################################
# Copyright (c) 2016 - 2024, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis>
#
# This program is fre... |
1cbc6c62919960eba578e1619cb96945dfccd78c22bb170a7939cd2d236b74ff | Python | 17,666 | 410 | r"""Transcripts meet segmentation: assignment, counting, transcript-based methods.
Imaging platforms (Xenium, CosMx, MERFISH/MERSCOPE, STARmap) and Stereo-seq
GEM files give one row per detected molecule. A label image turns them into
cells with :func:`assign_transcripts`; :func:`segment_transcripts` instead
segments ... |
fcbea0ac123cc9f400e4c60c9ce5374e475e71572cbdf0cdd7492141f84219c4 | Python | 17,668 | 530 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 12 09:05:00 2022
Averaging over a slice may hide important biases.
I want to see accuracy (B/P) as a function of T2 and SNR
Do this by gather a structure of all pixel data
Bin them, by T2 and SNR groups
Plot with mean and std, for bias/precision
Ma... |
8ee2e8e1f9ca104c12fcd829f8154bd365491da9cec2af9524f74abae512bc4e | Python | 17,670 | 443 | import torch
import pytorch_lightning as pl
import torch.nn.functional as F
from contextlib import contextmanager
from taming.modules.vqvae.quantize import VectorQuantizer2 as VectorQuantizer
from stable_diffusion.ldm.modules.diffusionmodules.model import Encoder, Decoder
from stable_diffusion.ldm.modules.distributio... |
f92a1dfee48e561a904e597787652defe1dbcea4e46db44289a120991598781e | Python | 17,675 | 520 | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 16 22:13:00 2019
@author: ju-bar
Image convolution kernel routines
This code is part of the 'emilys' repository
https://github.com/ju-bar/emilys
published under the GNU General Publishing License, version 3
"""
from numba import njit # include compilation support
import... |
71c41d0b6997ea2877cf683315e2cc3bdbbf3ad703456a9f38b1d61706e050ab | Python | 17,677 | 276 | import logging
from datetime import datetime
from agent.classifiers.utils.device_mgmt import get_gradient_accumulation_steps
from agent.classifiers.transformer_classifier import transformer_classifier
from agent.classifiers.ffnn_classifier import ffnn
from agent.classifiers.tr_ffnn_ensemble_classifier import tr_ffnn
... |
69a773843c1fb106e52beb6e295819f56581e6089a065e39e4751daf76c34674 | Python | 17,680 | 503 | """
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
Tests: Stress-tensor prediction parity between the legacy and the
new (declared-output) GradRegressConfig code paths, on both
... |
11e63deba6ea2c6824fdddd50c5c87a7928c2196d2572cba9aaf3bc3eea9c077 | Python | 17,682 | 452 | from pathlib import Path
from time import time
import argparse
import shutil
import random
import matplotlib.pyplot as plt
import seaborn as sns
from tqdm import tqdm
import numpy as np
from Bio.PDB import PDBParser
from Bio.PDB.Polypeptide import three_to_one, is_aa
from rdkit import Chem
from scipy.ndimage import... |
d8132308aa8a5d8e5b89778dcb57b70b226c6916b20f547bb226320dff414b10 | Python | 17,682 | 435 | import logging
import re
from dataclasses import dataclass
from enum import IntEnum
from typing import (
Any,
Dict,
Iterable,
Optional,
)
import pyarrow
import pyarrow as pa
import pyarrow.types as pat
from ray.data._internal.arrow_ops.transform_pyarrow import (
reorder_columns_by_schema,
)
from r... |
04f0ec3f1f78bc1b01ce45f8aaa4f98759f78bab30a36d2815504a63efcfd4fd | Python | 17,684 | 441 | import os
try:
print('SlURM_JOB_ID',os.environ["SLURM_JOB_ID"])
except:
print("no slurm id")
import matplotlib
matplotlib.use('agg')
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import tensorflow as tf
import tensorflow.keras as K
import tables
import gc
import argparse
import scipy
i... |
0cd2294fed89b79665008c200602718b68124bf1669bb497245b180ff81acec3 | Python | 17,689 | 483 | from __future__ import annotations
import gzip
import re
from collections.abc import Iterable
from collections.abc import Mapping as ABCMapping
from itertools import chain, repeat
from pathlib import Path
from typing import Mapping
import functools
import attr
import yaml
def convert(genes) -> Mapping[str, float]:... |
df93ece39b7c939a4fa9d1ad5b4306ea903893c28da85ceed422140209f73614 | Python | 17,690 | 705 | # This file is autogenerated by the command `make fix-copies`, do not edit.
from ..utils import DummyObject, requires_backends
class AutoencoderKL(metaclass=DummyObject):
_backends = ["torch"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["torch"])
@classmethod
def from_confi... |
2806a8e48c02ca254a506949ef790bff20d80b709ee17282df56789fb6cc21a3 | Python | 17,702 | 459 | ####################################################################################################
# Copyright (c) 2016 - 2024, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis>
#
# This program is fre... |
94acaabadef2c3c8bac32164b6ffe0b8b34c95a3e7d25cce20e383530d8491e8 | Python | 17,703 | 364 | import math
import inspect
from dataclasses import dataclass
import torch
import torch.nn as nn
from torch.nn import functional as F
class LayerNorm(nn.Module):
def __init__(self, ndim, bias):
super().__init__()
self.weight = nn.Parameter(torch.ones(ndim))
self.bias = nn.Parameter(torch.ze... |
4b58a29c2918663983b4fca7b52cf5c4cc3edff4b529f882ab6563ec9ca6fa00 | Python | 17,724 | 381 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import train_test_split
import tensorflow as tf
from imblearn.over_sampling import SMOTE
from imblearn.under_sampling import Ran... |
0397078488db9d686e031bdc39388b6817e1d608b304c748695bc8fdbdd6b409 | Python | 17,726 | 381 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import train_test_split
import tensorflow as tf
from imblearn.over_sampling import SMOTE
from imblearn.under_sampling import Ran... |
36474d5f9ed2b19bd40229aa359dd3ac8859da9eb0199a1ccb53c42bb5069808 | Python | 17,729 | 500 | import json
import math
from typing import Optional
import torch
from .decoder import (
CachedTransformerDecoder,
CachedTransformerDecoderLayer,
select_kv_cache,
)
from .sparse_backBone import GATBase
from utils.mask_utils import generate_square_subsequent_mask
REQUIRED_MODEL_ARCH_KEYS = (
'dim',
... |
cd6aeab1204a0b79e7e7f2a8bc39838ada14a67e9c948b92a132e728bc6d01de | Python | 17,730 | 381 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import train_test_split
import tensorflow as tf
from imblearn.over_sampling import SMOTE
from imblearn.under_sampling import Ran... |
dfc62283369dcab69a4aeaa3ec2a59bedc2d56019451c7224414364c5860c9d8 | Python | 17,730 | 381 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import train_test_split
import tensorflow as tf
from imblearn.over_sampling import SMOTE
from imblearn.under_sampling import Ran... |
e654535fd3256aaa0c2a47ad6047b65408155ec3f1686d2fbf925738c4682cbc | Python | 17,730 | 381 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import train_test_split
import tensorflow as tf
from imblearn.over_sampling import SMOTE
from imblearn.under_sampling import Ran... |
752265314cba594d5ddf6c015d66b89288407c8ec8eabc6f283934c36ff3c5f5 | Python | 17,745 | 527 | #from subprocess import Popen, PIPE
from math import *
#import random
import random as pr
import numpy as np
from copy import deepcopy
##from types import ListType, TupleType, StringTypes
#import itertools
import time
#import math
import argparse
#import subprocess
#from rdkit.Chem.QED import qed
from load_model impor... |
72d814f23830027fb486f158882495d1081086849b1a133827d6ce1e924502a9 | Python | 17,747 | 421 | from typing import List, Tuple, Dict, Callable, Union
import numpy as np
import torch
import tqdm
import visionloader as vl
from movie_upsampling import movie_sparse_upsample_transpose_cuda
import lib.data_utils.dynamic_data_util as ddu
from glm_precompute.ct_glm_precompute import multidata_precompute_spat_basis_mul_... |
51d5dc5dcfc1dca2afb5636084e9db97bfe365419914328c2124c37266a5e2ac | Python | 17,754 | 499 |
import numpy as np
import pandas as pd
import scanpy as sc
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
import sys
# Module import
from ._starfysh import LOGGER
from .dataloader import IntegrativeDataset, IntegrativePoEDataset
from ._starfysh import AVAE, A... |
9a6b266ba07be8eca198449030a5ca200da88c0b1d1046a613b61bfdc81122e5 | Python | 17,766 | 327 | # EXAMPLE 4: UCI dataset classifier/clustering combinations
import csv
import re
import numpy as np
import os
from collections import namedtuple
from sklearn.datasets import load_digits
def build_ucidatasets():
"""
Function that loads 18 different benchmark dataset for clustering/classification
from the U... |
6c5c9bf42a690cd0191413a9d8fed69e8344be27778a00ef864c4ef4d4f1af0e | Python | 17,769 | 449 | import logging
from dataclasses import dataclass
from typing import (
TYPE_CHECKING,
AbstractSet,
Callable,
Iterable,
List,
Optional,
Tuple,
Union,
)
import numpy as np
from pyarrow.fs import FileSystem
from typing_extensions import override
from ray._common.utils import env_integer
fr... |
6d8c2d0eadfb2d2cbf7e3afc82510f347fde0f1051071355bbfe477beabbbfc0 | Python | 17,771 | 359 |
from lisa.core.lisa_core import LISA_Core
from lisa.core.data_interface import PACKAGE_PATH, REQURED_DATASET_VERSION
from lisa.core.lisa_core import CONFIG_PATH as base_config_path
import numpy as np
from scipy import sparse
from lisa.core import genome_tools
import os
import configparser
from collections.abc import I... |
f65e30b3b7a5f5c4c5a7469dc37c8fdbe1bbdac0bec77426e7c04803cb9bd976 | Python | 17,772 | 473 |
# ML4H is released under the following BSD 3-Clause License:
#
# Copyright (c) 2020, Broad Institute, Inc. and The General Hospital Corporation.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
... |
18ed97ee45fe76a47c82d026234480f07b2aca3b9f5821bdfa6b88f347982111 | Python | 17,793 | 409 | # built-in dependencies
from typing import List, Union
# 3rd party dependencies
import tensorflow as tf
# project dependencies
from deepface.commons import package_utils, weight_utils
from deepface.models.FacialRecognition import FacialRecognition
from deepface.commons.logger import Logger
logger = Logger()
tf_vers... |
e03f739c216f3568267fe3568ee19fc0dfe85fa01bbf5221801156d9e423a2ed | Python | 17,794 | 482 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------------
# Created By : Kangjoo Lee (kangjoo.lee@yale.edu)
# Last Updated: 08/06/2024
# -------------------------------------------------------------------------
# =========================================... |
73d27d824ef2ba3651c40e75c4f2badf905464b9818d86b00f0a6f9f12168e41 | Python | 17,795 | 326 | import logging
import tensorflow as tf
from tensorflow.keras.layers import Conv2D, Input, Dense, MaxPool2D, Flatten, Dropout, BatchNormalization
from tensorflow.keras.models import Model
from utils import *
tf.keras.backend.set_floatx('float64')
class SpikingDense(tf.keras.layers.Layer):
def __init__(self, units,... |
abecf8af222f10b530a61247e63341e720df3a0aa6e3606ad41809a992761721 | Python | 17,811 | 483 | """ExecutionRepairLoop — structured self-healing for code execution failures.
Replaces the former regex-first recovery path with a normalized failure
envelope and bounded retry loop. Domain-specific regex transforms
(``ProactiveCodeTransformer``, ``apply_execution_error_fix``) are still
applied as *optional early gua... |
6db254b3a41e85f2a18fe4daf89c09753be6c621f62ded9f1c3b2965b393430c | Python | 17,812 | 415 | import collections.abc
import numpy
from typing import Union, Iterable, Tuple, List, Set, Dict, Text, Iterator, Optional, Sequence, Collection
from enum import Enum
from sv_utils import common
class TrioIndices(collections.abc.Iterable, collections.abc.Hashable):
"""
Simple class for holding sample indices p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.