sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
cb28e2e2293cd635020dcd0f7293ee7f4b58e00e52bdd51d89bec87ac9115ada | Python | 17,820 | 391 | import numpy as np
from spinnaker2.neuron_models.application import BaseApplication
from spinnaker2.mapper import SynapseWordSize, SynapseWordSpec
from spinnaker2.configuration import PEConfig, MemoryRegion
from spinnaker2.neuron_models.common import (add_log_memory_region,
N_WORDS_MPT_ENTRY, collect_routing_t... |
9e5376ea8ae03fa7771eaad1042f0a107a1023fed065e50adb590bd9558ef828 | Python | 17,832 | 495 | import json
import scanpy as sc
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import os
import networkx as nx
import seaborn as sns
from scipy.stats import pearsonr, gaussian_kde
from sklearn.neighbors import KNeighborsRegressor
def get_z_umap(qz_m):
import umap
fit = umap.UMAP(n_n... |
3be68fa309cf0b15aeb62eba81c48b69672611bce75351ea2434f7c0badde470 | Python | 17,836 | 474 | import numpy as np
import os
import struct
import gzip
import pickle
from sklearn.cluster import KMeans
from sklearn.mixture import GaussianMixture
import scipy.io
def format_float(num):
return np.format_float_positional(num, trim='-')
def download():
'''
From https://www.cs.toronto.edu/~kriz/cifar.html
... |
a7b585fbb1d28464785c98acf265e77c4eee351dc7326598047561060efa87ad | Python | 17,839 | 555 | """
A Variational Autoencoder (VAE) for spectrogram data.
VAE References
--------------
.. [1] Kingma, Diederik P., and Max Welling. "Auto-encoding variational bayes."
arXiv preprint arXiv:1312.6114 (2013).
`<https://arxiv.org/abs/1312.6114>`_
.. [2] Rezende, Danilo Jimenez, Shakir Mohamed, and Daan Wierstra. "St... |
a29a3eab11954ae20023d8c13f57238a4a27ddff7f0585d2cdbb435f418438db | Python | 17,845 | 476 |
# 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:
#
... |
666a8ed303a1194839f5510c94d508c3c5c3c95e69891f7caf7f99387d3f0312 | Python | 17,856 | 407 | ####################################################################################################
# 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... |
db5b5357635da491543f95b279aba37bccd4c4694718aba851cfc1b577b45f08 | Python | 17,858 | 541 | import time
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from config import args
from dataloader import DataLoaderAE, DataLoaderMasking, DataLoaderSubstructContext3D
from models import GNN, AutoEncoder, Discriminator, SchNet, VariationalAutoEncoder
from pretrain_AM import do_AttrMa... |
621a1eddfe12fcdcba5daffc20ac75b0badb9e50e536c9490e5089f1159de656 | Python | 17,869 | 438 | #!/usr/bin/env python3
from __future__ import print_function
import argparse
import glob
import sys
import matplotlib.pyplot as plt
import pysam
import collections
import numpy as np
import os
plt.style.use('ggplot')
text_fontsize = 8
# plt.rcParams['ytick.labelsize']=text_fontsize+4
plt.rcParams.update({'font.size': ... |
d64332a7bcd6b884f61fb6cd77d1bc8206033fb616e9bff9517ec0f482b274c8 | Python | 17,881 | 375 | ####################################################################################################
# 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... |
8bcdc500b00bded72153bcde5d0d8338daf88bd8eac371f0f82e16bbc1736b96 | Python | 17,895 | 400 | r"""The gating strategy — a tree of gates that belongs to the ANALYSIS, not to
any one sample.
THIS IS THE WHOLE POINT OF THE MODULE. A gate on its own is a predicate; what a
cytometrist actually has is a *strategy*: time gate, then debris, then singlets,
then live, then lineage — each step evaluated only on the event... |
a8e68fa14f7310c114ce1db3823de45cf0afc7a76dc4d9d667ed767a82808fd4 | Python | 17,896 | 433 | import importlib
import inspect
import re
from dataclasses import dataclass
from enum import Enum
from typing import Dict, List, Optional, Set, Tuple
_SPHINX_AUTOSUMMARY_HEADER = ".. autosummary::"
_SPHINX_AUTOCLASS_HEADER = ".. autoclass::"
# This is a special character used in autosummary to render only the api shor... |
255ce37241117cc2170ce9a4d603698f0548671bedb33f368973e13139e65e4d | Python | 17,913 | 445 | from __future__ import annotations
import bisect
import logging
from collections import defaultdict, deque
from dataclasses import dataclass, field
from typing import Deque, Dict, List, Optional, Tuple
from ray.data._internal.datasource_v2.interfaces.file_indexer import FileInfo
from ray.data._internal.datasource_v2.... |
fdc35de86fffc92fe2289c9ecb2331e6dab30705dadc646cb21c3e0b416f9493 | Python | 17,917 | 580 | """
DataStateValidator - Pre-execution validation with auto-correction.
This module provides validation of generated code before execution, with
automatic correction for simple prerequisite issues.
Main Components:
DataStateValidator: Pre-execution validator with auto-correction
ValidationFeedback: Structured... |
056626971989444abaa1ae051654eb4348a74ca5b644b003300762f4b8e8cc0a | Python | 17,924 | 408 | r"""
This module contains classes that assist with construction of complicated arrangements of plots.
A typical example is a class that helps with creating a line of plots with a common y axis.
"""
import os
import pylab
import param
from param.parameterized import Parameterized
from mozaik.storage.queries import part... |
b2607d4f552e43b641bd966f76d441af50b45ba06cb1f78590d03ee1cf9c5d16 | Python | 17,929 | 600 | # encoding: utf-8
"""
This module provides utility methods for dealing with path-specs.
"""
import os
import os.path
import posixpath
import stat
from .compat import Collection, Iterable, string_types, unicode
NORMALIZE_PATH_SEPS = [sep for sep in [os.sep, os.altsep] if sep and sep != posixpath.sep]
"""
*NORMALIZE_P... |
04277ce1bcf0e3461c10aeab5316aaf34be6fc2516ab1094cade4a1f82d6d359 | Python | 17,932 | 482 | """Reactome pathway data collector."""
import logging
from typing import Any, Dict, List, Optional
from src.api.reactome import ReactomeClient
from src.models.pathway import Pathway
from src.models.genomic import Gene
from src.models.protein import Protein
from .base import BaseCollector
from config.config import set... |
9a21f7da6c8d4baf6033fbfa4377ae42a106f3d8b00485e833f136aa36c78ca9 | Python | 17,947 | 366 | # -*- coding: utf-8 -*-
#from __future__ import print_function
"""
Created on Mon Apr 4 15:00:02 2016
@author: fwinkler
"""
import numpy as np
import re
import os
from functools import reduce
class MsaPrm(object):
"""
Msa object that can be used to load, modify and save a msa parameter file for the Dr. Pr... |
e1b5478ac733a434631a15446a4b6cec191ab47a51409215612e1bed5ec4a6fb | Python | 17,955 | 395 |
import numpy
import os
import time
import yaml
import platform
import copy
import datetime
import matplotlib
import h5py
import random
import multiprocessing
import matplotlib
# matplotlib.use("tkagg")
from copy import deepcopy
from matplotlib import pyplot
from shutil import copyfile
from functools import partial
f... |
3ee53fdff2f0a6462a354f12dc4b5b4a885f259b03691317acec5a89269d3098 | Python | 17,957 | 515 | """Adversarial autoencoders (AAE) for metagenomics binning, this files contains the implementation of the AAE"""
import numpy as np
from math import log, isfinite
import time
from torch.autograd import Variable
from torch.distributions.relaxed_categorical import RelaxedOneHotCategorical
import torch.nn as nn
import t... |
cd5b4d52d2965b6a16e795ab5867c7fb6da923559ef70aaf16f888ce201e6858 | Python | 17,973 | 482 | import os
import os.path
from typing import Tuple
from numpy import ndarray
from numpy import loadtxt
from numpy import fromstring
from numpy import zeros
from numpy import arange
from numpy import array
import numpy as np
import struct
import numpy as np
import pandas as pd
def readNHS(file, ftype="ecg"):
# ftyp... |
3f02c98b4ebb1591c036ad6f31c7ae64d0bfbe0d113b659db310faef7b211da4 | Python | 17,979 | 598 | import os
import numpy as np
import pytest
import torch
from torch import nn
import pfrl
import pfrl.nn as pnn
from pfrl import agents, explorers, replay_buffers
from pfrl.initializers import init_chainer_default
from pfrl.utils import download_model
@pytest.mark.parametrize("pretrained_type", ["final", "best"])
cl... |
85aaecff012c4f99044c14f9b78be36de24b0b0c64600e4ce66d55bd0d2792b6 | Python | 17,979 | 395 |
import numpy
import os
import time
import yaml
import platform
import copy
import datetime
import matplotlib
import h5py
import random
import multiprocessing
import matplotlib
# matplotlib.use("tkagg")
from copy import deepcopy
from matplotlib import pyplot
from shutil import copyfile
from functools import partial
f... |
4285109b2f1849a86073b9335ac6ea7fb1d35dad0b8f2178dd61438885e4b772 | Python | 17,992 | 565 | """
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 os
import random
from functools import partial
import numpy as np
import pytest
import torch
fr... |
0f7186ed8ce1b50c58d6f0c7f14b5c637684448e25e6b39cd688646a5d1cff13 | Python | 17,998 | 272 | import numpy as np
import numpy.random as npr
import pytest
from abc import ABC
from lgca import get_lgca
def calc_init_particles(ve, density, restchannels, K=None, b=None):
if ve:
return min(int(density * K) + 1, K) if restchannels % 2 else int(density * K)
else:
return int(density * (restcha... |
d0dcbf743d651cd30afab86b7f3a4bcf4c921e0f440bb534d36b037267083e83 | Python | 18,001 | 537 | # 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, ... |
8fd8e107a097f80ff859fe45ae4cd68a3c005f0d574ce32ecb7705325366b64a | Python | 18,005 | 495 | ####################################################################################################
# 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... |
4f403a812b3081ec7a1a7dfa636b746c9b18296866d3e27da1ad3bb333ab6ddb | Python | 18,006 | 430 |
"""This module contains classes that implement several objectives to optimize.
It is highly inspired from the `bandit-optimization` library.
.. reference:
[banditopt] https://github.com/FLClab/bandit-optimization
"""
from abc import ABC, abstractmethod
import numpy
import itertools
import warnings
from scipy.... |
8369bc72fc20b2615e8b92a7e0c141f5cfd18c6bf78529b57b85ff6c471fb850 | Python | 18,021 | 465 | ####################################################################################################
# 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... |
6f2834864d3452d4f2adf0a5db47127fba713cd68b873d201cd3719c403a9ebd | Python | 18,023 | 544 | """
This script automates the process of launching and verifying a Ray cluster using a given
cluster configuration file. It also handles cluster cleanup before and after the
verification process. The script requires one command-line argument: the path to the
cluster configuration file.
Usage:
python launch_and_ver... |
9ed0363c2001a6b57e99d65a2cd5039f4a571715f1a853f1ab87f36567b0e2af | Python | 18,043 | 566 | from typing import List, Tuple, Union
import pandas as pd
from data_profiling.config import Settings
from data_profiling.report.formatters import (
fmt,
fmt_bytesize,
fmt_number,
fmt_numeric,
fmt_percent,
help,
)
from data_profiling.report.presentation.core import (
HTML,
Container,
... |
4872028bf83866466d952819fb94bde596398ade06884c1c653ab1812587c770 | Python | 18,044 | 428 | import torch
from torch import nn
from torch.utils.data import DataLoader
from torch.nn.functional import mse_loss
import torch.nn.functional as F
from tqdm import tqdm
from .data import StreamingUMAPDataset, MatchDataset
from .modules import get_umap_graph, get_umap_graph_gpu, umap_loss, umap_loss_global_neg
from .mo... |
e2a818f8432557c58a01a80a12141c58c4940318df18e689dd1b901ca508ecf7 | Python | 18,049 | 495 | # -*- coding: utf-8 -*-
"""Run full pipeline of regression model for estimating regulatory programmes of cell types and other covariates
which accounting for the effects of experimental batch and technology."""
import gc
import os
import pickle
# +
import time
from os import mkdir
from re import sub
import matplotli... |
4e653cb812ec0dec90443e0e4e74ba909aa9cde851857d3cb006326fc2fae969 | Python | 18,059 | 440 | '''
The double pole balancing problem.
This is a modified version of the example in the book
"Hands-On Neuroevolution with Python" published by Packt.
Original code:
https://github.com/PacktPublishing/Hands-on-Neuroevolution-with-Python/blob/master/Chapter4/cart_two_pole.py
MIT License
Copyright (c) 2019 Packt
https... |
509ead99affffa8d8bef857bfceb87c22e29371f72d7f3ed212318e60fc58e8a | Python | 18,068 | 493 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Function for implementing parallel scalable segmentation of two photon imaging data
..image::docs/img/cnmf1.png
@author: agiovann
"""
#\package caiman/dource_ectraction/cnmf
#\version 1.0
#\copyright GNU General Public License v2.0
#\date Created on Wed Feb 17 14:... |
73b0681f3d2bc924c993f4d68c7662ffcfa8b0ac7ca1ee6b843f6021ec5eef03 | Python | 18,070 | 483 | ####################################################################################################
# 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... |
cd359b4e6b22cfc63f6c2a643cc549539ea599509bfb51eb65ce1a5dd3838d26 | Python | 18,077 | 365 | # Copyright 2021 Division of Medical Image Computing, German Cancer Research Center (DKFZ)
# and Applied Computer Vision Lab, Helmholtz Imaging Platform
#
# 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 L... |
54c431b5e32350f2e55bfd92c87e4c9757c3bb23c60c1335758a233bec5bae84 | Python | 18,085 | 532 | # 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, ... |
3cfd973636ec8e2d696ca0d4433f18a1be0653139116cc41f1eae4a9f9fa0b83 | Python | 18,087 | 481 | from functools import partial
from warnings import warn
from typing import List, Optional, Union
import numpy as np
import pandas as pd
import scipy.linalg
from scipy import stats
from scipy.sparse import coo_matrix, issparse
import scipy.sparse.linalg
from sklearn.utils.extmath import randomized_svd
from omicverse.e... |
6c9ee59f97bf3772579ea0452cdbb258c8d87b7cc3ba5cee6e7ea738a8169db1 | Python | 18,091 | 386 | from __future__ import annotations
import json
import logging
import os
import warnings
import anndata
import joblib
import numpy as np
import pandas as pd
import scanpy as sc
import scipy.sparse as scp
import torch
from pynndescent import NNDescent
from scanpy._utils import check_nonnegative_integers
from . import ... |
a0d5e25a647f5b741f8c5110a8c02288d79b3af843f99ea9e31e799878318d6c | Python | 18,098 | 408 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 6 16:08:47 2021
@author: sam
"""
import math
import numpy as np
import h5py
import matplotlib.pyplot as plt
import scipy
import tensorflow as tf
from tensorflow.python.framework import ops
import pickle
import keras
from keras import layers
from ke... |
cfdf940fd453c750c77f04a1cb36e3cd60c9377c3d81e24e7004c2171ba904f2 | Python | 18,098 | 368 | import torch
import torch.nn as nn
from torch.optim import Optimizer, AdamW
from torch.optim.lr_scheduler import LambdaLR
import numpy as np
from tqdm import tqdm
import os
import platform
from sklearn.model_selection import KFold
from splam_utils import *
from splam_dataset_Chromsome import *
from SPLAM import *
impo... |
3cca59774dedcd1de3398553ac05843e039a9beb40b4fd0325f546c85de106e6 | Python | 18,110 | 463 | ''' Get event-related avergaes per stimulus duration '''
import os
import glob
import nibabel as nb
import numpy as np
import subprocess
import pandas as pd
import re
import matplotlib.pyplot as plt
from scipy import interpolate
import sys
sys.path.append('./code/misc')
from findTr import *
ROOT = '/Users/sebastian... |
5394a9b83db83f1c3dcc7b98737f43a2a0984dbf59fae7e76a593bea4a123d55 | Python | 18,115 | 505 | import numpy as np
from scipy.stats import spearmanr, pearsonr
import os
from loguru import logger
from sklearn.metrics import average_precision_score
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.colors import Normalize
from scipy.interpolate import interpn
from torch.utils.data im... |
53f04d39177500317a2a0d81674776c44f7988bca5c903b108b077041f887219 | Python | 18,124 | 490 | """
Module for the autosections GUI, allowing the user to select
options for an automated run of SASSI.
***
built as part of the Russell Ray Lab Breathing And Physiology Analysis Pipeline
***
Breathe Easy - an automated waveform analysis pipeline
Copyright (C) 2022
Savannah Lusk, Andersen Chang,
Avery Twitchell-Hey... |
9646504f536ab0eb7684d66644c8a3b40679ffa135cfe7daedc7cdd5983088bf | Python | 18,133 | 412 | import torch.nn as nn
import torch
from tqdm import tqdm
import os
from src.dataset.batchdataloader import BatchDataloader
from src.dataset.utils import unpack_batch
from torch.nn import functional as F
from sklearn import metrics
from src.utils.metrics import *
import pandas as pd
import numpy as np
class Trainer(n... |
3a8ea4c501c752e0bd6d7645ba2bc321147abb0b66a81ee886f106ce03d18d0d | Python | 18,135 | 561 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" A set of pre-processing operations in the input dataset:
1. Interpolation of missing data
2. Indentification of saturated pixels
3. Estimation of noise level for each imaged voxel
4. Estimation of global time constants
@authors: agiovann epnev
@image docs/img/greedyr... |
3c146348eaf92a50e2ef5f902459af336c17f14b601524471525ab05bc11fbfd | Python | 18,137 | 534 | # 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... |
3594e1a8d1b6f16b53c5ae0628c3edb99d21f6e2fec50d4e96a56b6475d40cc4 | Python | 18,140 | 448 | import torch
import torch.optim as optim
from torch.utils.data import Dataset, DataLoader, SubsetRandomSampler, random_split
import pandas as pd
import numpy as np
import os
import random
from collections import defaultdict, Counter
from itertools import combinations
import json
import torch.nn as nn
import torch.nn.fu... |
047f2a8445f570d4cc5b7f665e54bb7ae32e0162e9838cecb0fc35bb10e06973 | Python | 18,142 | 476 | import logging
import sys
from collections import OrderedDict
from pathlib import Path
from typing import Dict, List, Optional, Union
import yaml
from ray._common.runtime_env_package import (
PY_MODULES,
WORKING_DIR,
validate_package_extension,
)
from ray._private.path_utils import is_path
from ray._priva... |
f08ff4340305d44e8c79077f92648ca619859f6893f0fd344410ad9a30deae2e | Python | 18,143 | 411 | r"""CRISPR guide-RNA design & genome editing.
Design and score guide RNAs, screen off-targets, and plan edits:
* :func:`design_grnas` — scan a target for PAM sites, extract protospacers,
score on-target efficiency, flag poly-T terminators, rank.
* :func:`offtarget_search` — find near-matches in a background sequenc... |
20b924190858f5b232f4901ddae791053665c03aab08ccd19e20d01e6143dade | Python | 18,150 | 490 | """
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 os
from itertools import product
from random import choice
from typing import TYPE_CHECKING
imp... |
78ae585773b5094d971c46ec5b2085b9bdeb03a6047fe03e9a885e3d1da3d03d | Python | 18,196 | 482 | """gnomAD data collector."""
import logging
from typing import Any, Dict, List, Optional
from src.api.gnomad import GnomADClient
from src.models.genomic import Gene, Variant
from .base import BaseCollector
from config.config import settings
logger = logging.getLogger(__name__)
class GnomADCollector(BaseCollector)... |
118716e6d68181d5b9f92527d6de8d8e0d33d7128ed8a23c6428554f01b72b9b | Python | 18,204 | 459 | """
Main DataStateInspector class for runtime prerequisite validation.
This module provides the primary interface for validating prerequisites
before function execution in OmicVerse workflows.
"""
from typing import Dict, List, Optional, Any
from datetime import datetime
from anndata import AnnData
from .validators ... |
8dd136830b080d12f76a1d265064ef20da02f462babf29e6694d293ecc602c0e | Python | 18,210 | 377 | """FastCCC pipeline: permutation-free CCC p-values (``fastccc.core`` port).
Mirrors ``statistical_analysis_method`` and
``Cauchy_combination_of_statistical_analysis_methods`` of FastCCC 1.0.1
(MIT, Hou, Ma & Zhou, Nat Commun 2025), working on an in-memory matrix and
without scanpy or result files.
Stages (per scoring... |
9890b00e5d2e46f1b4506e54fd12d918779ca38ec597baa8720909d09f15de5e | Python | 18,211 | 519 | # 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, sof... |
686e1e2baffe7754f714bfcf060e99eeeca286c15d570861b9f91e6e006a10e1 | Python | 18,214 | 432 | # 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, sof... |
fb0dc69b943fb9a0c39e07ffee14fae75aa96347b3578105952c611a152b766c | Python | 18,214 | 569 | # flake8: noqa
# isort: skip_file
# __pytorch_save_start__
import os
import tempfile
import numpy as np
import torch
import torch.nn as nn
from torch.optim import Adam
import ray.train.torch
from ray import train
from ray.train import Checkpoint, ScalingConfig
from ray.train.torch import TorchTrainer
def train_fun... |
a2eba1d6faa1b93c29d095c56dcf0beb1ca932efa863eeef5d12df19b34e726b | Python | 18,218 | 434 | import argparse
import pickle
from typing import Dict, List, Tuple, Callable, Union
import torch.multiprocessing as mp
from collections import namedtuple
from enum import Enum
import numpy as np
import torch
import tqdm
import visionloader as vl
from whitenoise import RandomNoiseFrameGenerator
from basis_functions.... |
20167d157720527071bfeb5bac9fb8919174bd2cce7f3edf232e35c9b9585fd7 | Python | 18,221 | 460 | # Ultralytics YOLO 🚀, GPL-3.0 license
import numpy as np
import scipy.linalg
# Table for the 0.95 quantile of the chi-square distribution with N degrees of freedom (contains values for N=1, ..., 9)
# Taken from MATLAB/Octave's chi2inv function and used as Mahalanobis gating threshold.
chi2inv95 = {1: 3.8415, 2: 5.99... |
d05af1025b3257616fd52761b315525d6f8474873cb0ff6bbc0cef3445539193 | Python | 18,230 | 603 | # -*- coding: utf-8 -*-
"""
Created on Mon May 9 21:11:52 2022
@author: gagan
"""
from config import ROOTDIR
import cmlreaders as cml
from glob import glob
import os
from scipy import signal
import numpy as np
import pickle as pkl
from tqdm import tqdm
from sklearn.model_selection import KFold
def get_exp_sess(sub)... |
4fe5dfedd93e9b71acf1d4d978c58a4838744b285dec0da839afedb557277443 | Python | 18,232 | 557 | import json
import os
import sys
from unittest.mock import AsyncMock, MagicMock
import pytest
import ray
from ray._common.test_utils import wait_for_condition
from ray._private.test_utils import (
format_web_url,
request_with_auth_token,
wait_until_server_available,
)
from ray.dashboard.runtime_env_redact... |
915399230fb830001d667719187fd52b9c880c751a01f7ca3056fe143bbd5743 | Python | 18,241 | 536 | import argparse
import asyncio
import json
import logging
import os
import signal
import sys
import ray
import ray._private.ray_constants as ray_constants
import ray.dashboard.consts as dashboard_consts
import ray.dashboard.utils as dashboard_utils
from ray._common.network_utils import (
build_address,
get_all... |
9fe76222c6ecea4b2a7cf0cdec99d012b4959a692f682b8ace2304782c4ad281 | Python | 18,256 | 464 | # Load in libraries
import numpy as np
import pandas as pd
import os
import glob
import re
import datetime as dt
import dateutil
from collections import defaultdict
import warnings
warnings.filterwarnings("ignore")
# load in directories
from language.constants import DATA_DIR
class Task:
def __init__(self):
... |
0d43a5f9654f3a531eaee735357fe99ae82fda9107ca8a52f41a8f13edeee493 | Python | 18,258 | 397 | # -*- coding: utf-8 -*-
"""Implementation of neural space-time model for 2D/3D+time dynamic scene representations.
"""
import functools
import numpy as np
from flax import linen as nn
import jax.numpy as jnp
import jax
from typing import Callable, Any, Tuple, Union, Dict, List
import calcil as cc
from flax.struct imp... |
d49ddda50228f58eb20ca366eb64a8b8af0991b4a66a1e10516e3084bfc6a775 | Python | 18,268 | 536 | """Contains history class and helper functions."""
import json
import pickle
from skorch.utils import open_file_like
# pylint: disable=invalid-name
class _none:
"""Special placeholder since ``None`` is a valid value."""
def _not_none(items):
"""Whether the item is a placeholder or contains a placeholder."... |
94994709664d03dcebec19361156d81389a2639af1564f88fae543a72a4d56a3 | Python | 18,272 | 434 | # Modified from https://github.com/open-mmlab/mmsegmentation/tree/1.x
import torch.nn as nn
import torch.utils.checkpoint as cp
from mmcv.cnn import ConvModule, build_activation_layer, build_norm_layer
from mmengine.model import BaseModule
from mmengine.utils.dl_utils.parrots_wrapper import _BatchNorm
from lqit.edit.m... |
145b4e2461bf8cd7a31c06f044565911154f4af95c6213319999d07a74304508 | Python | 18,275 | 511 | """Nanostring SMI reader for OmicVerse spatial I/O."""
from __future__ import annotations
import ast
import os
import re
import warnings
from pathlib import Path
from typing import Optional, Union
import numpy as np
import pandas as pd
from anndata import AnnData
from PIL import Image
from scipy.sparse import csr_ma... |
9546a8d33b94487258aecb137eeafeced89df578908b2f6ae2af24fca47d36ec | Python | 18,281 | 398 | import argparse
import pickle
from typing import Dict, List
import numpy as np
import torch
import tqdm
import visionloader as vl
from whitenoise import RandomNoiseFrameGenerator
import lib.data_utils.data_util as du
import lib.data_utils.dynamic_data_util as ddu
import lib.dataset_config_parser.dataset_config_parser... |
550f67d634ce27a0b035bf507369fd24e7dbac3e504fdc787481099d902dd790 | Python | 18,284 | 473 | """Pure-torch GPU Leiden — no torch_sparse / torch_scatter dependency.
Replaces the previous ``_leiden_test`` implementation with one that:
* Uses only vanilla ``torch.scatter_*`` ops on raw ``(row, col, val)``
tensors (no ``SparseTensor`` wrapper, no ``torch_scatter.scatter_max``).
* Drops the per-batch Python loo... |
47a3aff66f65d9d61199a0f1a5b16112c1ae6cb8848b1877d7591226f5b16d75 | Python | 18,285 | 458 | import seaborn as sns
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
def integration_metrics(models, model_names, x = 'score', hue='Model', edgecolor='#474747ff', height=5, aspect=1.):
batch_correction = pd.DataFrame(pd.concat([pd.DataFrame(m).T for m in models], axis=0))
model_nam... |
63ccb0859808d6e61b7b5fac107a5862aaa0f705cfb86166f515ae3628f89b6f | Python | 18,294 | 463 | import sys, os
import math
import time
import numpy as np
from pathlib import Path
ROOT_DIR = Path(__file__).parent
import tensorflow as tf
from apnet.keras_atom_model import KerasAtomModel
from apnet import constants
class AtomDataLoader:
""" todo """
def __init__(self, molecules, multipoles, r_cut):
... |
ed5782151c7c15839764c4e642f8d4b1f84e50b216e7030e84ae055c25bb44f4 | Python | 18,303 | 538 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# pylint: disable=broad-except
# pylint: disable=invalid-name
# pylint: disable=line-too-long
# pylint: disable=multiple-statements
# pylint: disable=too-many-lines
#-------------------------------------------------------------------------------
'''
This source define th... |
ff148037d1024a4b405e82a66d04ef0373b3bc5be72825d23ea6f3e4a5c5188f | Python | 18,312 | 444 | import argparse
import itertools
import pickle
from collections import namedtuple
from typing import List, Tuple, Callable
import numpy as np
import torch
import tqdm
import visionloader as vl
from whitenoise import RandomNoiseFrameGenerator
import lib.data_utils.data_util as du
import lib.data_utils.dynamic_data_uti... |
dd6e634d16b625ceff5647581aa9e4ceaf63931988a579494070190224d1f6af | Python | 18,317 | 520 | import argparse
import os
import shutil
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import pdb
import random
from PIL import Image
from scipy.io import loadmat
from torch.autograd import Variable
from torchvision import transforms
from torchvision.models.segmentation import segmen... |
94d8d9c74a3463f44f6594799a7cc6d86eea59d4f43a724d6a2cafc216d40906 | Python | 18,323 | 527 | import pandas as pd
import numpy as np
import yaml
import sys
import logging
import click
import pickle
import itertools
import re
from plotnine import *
import copy
from pathlib import Path
from statsmodels.stats.multitest import fdrcorrection
from deeprvat.utils import pval_correction
logging.basicConfig(
form... |
db417ca7a84a15693be4acdfab97ee09ba1e4e83d99404ce98c5e51e84133b38 | Python | 18,328 | 405 |
import gym
import numpy
import random
import os
import queue
import pysted.base
from gym import error, spaces, utils
from gym.utils import seeding
from matplotlib import pyplot
from collections import OrderedDict
import gym_sted
from gym_sted import rewards, defaults
from gym_sted.utils import SynapseGenerator, Micr... |
0dc9f3b126dfb2255af02fefec6e9bce72d2b88dfd12ded534511afa21ceebe7 | Python | 18,387 | 491 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Functions to call in the PCA analysis of worm shapes
"""
import numpy as np
from sklearn import decomposition
from sklearn.decomposition import pca
from sklearn.preprocessing import StandardScaler
from sklearn import preprocessing
import matplotlib.pyplot as plt
from... |
2659b91afd1f7af4d11bd45650b239697b26e9360b5f74d3b74a6fb9a0bf8382 | Python | 18,410 | 644 | """
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.
Fused wigner<->SO2-conv edgewise ops (lmax=mmax=2).
Two tightly-coupled ops that keep the M-major [E,9,2C]/[E,9,C] x_message
intermediates out... |
028a94359bde80f6d2265c950f1eca292c2d32353cf6491f3f1a3fd4aaf7263f | Python | 18,421 | 432 | import argparse
import itertools
import pickle
from typing import Dict, List, Tuple, Callable
import numpy as np
import torch
import tqdm
import lib.data_utils.data_util as du
import lib.data_utils.dynamic_data_util as ddu
import lib.dataset_config_parser.dataset_config_parser as dcp
from basis_functions.spatial_basi... |
6593d19631db4dfbd85a85b952c85dc831a62f80b2e68f4f3d630012085cf5aa | Python | 18,431 | 499 | ####################################################################################################
# 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 library is fre... |
7d02dc5a7a93f7729b4716d10fda08fec0ad41a4dfa547725857749d52884cb8 | Python | 18,466 | 470 | #!/usr/bin/python
import os
import numpy as np
import pandas as pd
from scipy.stats import binom
from statsmodels.sandbox.stats.multicomp import multipletests
from clusterdiffex.cluster import cluster_mask_generator
from clusterdiffex.visualize import _import_plotlibs, get_cluster_cmap
class PopulationStats:
""... |
d35b548594334989640e1a6af213a2778f7f8a64baaf0e4e817fdba2ce996def | Python | 18,466 | 377 | import pandas as pd
from scipy.stats import shapiro
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import os
import argparse
from scipy import stats
from matplotlib import gridspec
CUSTOM_PALETTE = sns.color_palette("tab10", 7)
CUSTOM_PALETTE[6] = "#f14cc1"
def get_parser():
"""
Fun... |
f51a6bb7531f21410f5978ea95f76454f813048c3762c00a603a69de95b306a6 | Python | 18,470 | 532 | # 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, ... |
07883061651eb78eed243f11301efb763f9c588c5cedc919c07944fcafb2e1f6 | Python | 18,472 | 469 | #!/usr/bin/env python3
r"""Soft-wrap (unwrap) prose in Markdown / MyST files.
Joins each hard-wrapped paragraph and list item into a single logical line so the
editor and renderer handle line wrapping. The change is whitespace-only: it only
ever collapses the newlines *inside* a paragraph or list item to single spaces... |
34236b0bad6570ce5c5195751cfb2c19d978e9c00fc901738cbf3225a233b916 | Python | 18,479 | 458 | import logging
import re
import networkx as nx
import matplotlib.pyplot as plt
# import pandas as pd
import nltk
from nltk.stem import WordNetLemmatizer
from tqdm import tqdm
from agent.data.sql.sql_mgmt import select_fields_where, get_connection
from agent.nlp.metamap_mgmt import match_extraction_with_spo2, DEFAULT... |
9401cdd2acac9abdafe072ab1f1f3c7d1dab6e7e10c7839bd7cc0c3a35ed6eec | Python | 18,480 | 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... |
6118b4183d8a10d455bf191d9f70c3d6f78b81d910bd7cfa94fe3891dba5b568 | Python | 18,489 | 440 | r"""Single-cell copy-number variation inference (CopyKAT / inferCNV).
Wraps `pycopykat <https://github.com/omicverse/py-CopyKAT>`_ and
`pyinfercnv <https://github.com/omicverse/py-inferCNV>`_ behind a single
:class:`CNV` class with ``method='copykat' | 'infercnv'`` dispatch.
Both backends share a unified output schem... |
bb485314912e3962c2859b7ca734560d7bd28e4487dcaa336093e70c81503933 | Python | 18,490 | 499 | # -*- coding: utf-8 -*-
# (C) Copyright 2026 IBM. All Rights Reserved.
#
# Licensed under the MIT license. See LICENSE file in the project root for details.
"""Wrapper for the RPUCuda C++ tiles."""
from typing import Optional, Union, Dict, Tuple, Any
from torch import Tensor, zeros, tensor
from torch import device ... |
7e35fda5ac605337c92a610af13165a10a12c0aa9e9d51895cc1c8153d986629 | Python | 18,492 | 546 | import asyncio
import concurrent.futures
import logging
import os
import pprint
import time
import traceback
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor
from copy import deepcopy
from dataclasses import dataclass, field
from typing import Callable, Dict, List, Optional, Tuple, ... |
2729dbdee0643e93b829c5b079272e3334760d6ef6e056aa3dc58301f49bba46 | Python | 18,498 | 501 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 23 17:10:40 2020
For this version I am going to NOT use MONAI
I will load image datasets, flatten them, and then use my older 1D code
@author: bolan
"""
from matplotlib import pyplot as plt
import numpy as np
from monai.utils import first, set_det... |
749c6f6601d6d0e83303e24fc317b992ddb6260e4907f8f0bcfa722cea15d872 | Python | 18,508 | 468 | # --------------------------------------------------------
# Swin Transformer
# Copyright (c) 2021 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ze Liu
# --------------------------------------------------------
import torch
import torch.nn as nn
import torch.nn.functional as F
impor... |
d1bed51541f8f24d77e6f1678003a07a273198e2ef5dc559f4e24c7706fff684 | Python | 18,513 | 391 |
import numpy
import os
import time
import yaml
import platform
import skimage.io as skio
import copy
import datetime
import matplotlib
import h5py
import random
matplotlib.use("tkagg")
from copy import deepcopy
from matplotlib import pyplot
from shutil import copyfile
from collections import defaultdict
import abber... |
12313976b29491586de88b38453133dac0be22aa9b35c43fb140d91a0479fb37 | Python | 18,517 | 595 | #!/usr/bin/env python
"""Fit a mixture model to a list of peak height T-values.
The model is introduced in the HBM poster.
http://www2.warwick.ac.uk/fac/sci/statistics/staff/academic-research/nichols/presentations/ohbm2015/Durnez-PeakPower-OHBM2015.pdf
"""
import matplotlib.pyplot as plt
import nibabel as nib
import... |
2a95fe699cfc807f2aa4572eaadeb098e406cb98b846089497089050a00dfb0d | Python | 18,517 | 514 | #!/usr/bin/env python2.7
# qc_metrics.py v1 Creates a json string of qc_metrics for a given applet.
# Write request to stdout and verbose info to stderr. This allows easy use in dx app scripts.
# imports needed for Settings class:
import os, sys, string, argparse, json
# For a given metric name, exp... |
9609cb71e1f73c379e3b1ff384fee1cb781a6e5d81f8cc137467d0e413cdc8ff | Python | 18,535 | 391 |
import numpy
import os
import time
import yaml
import platform
import skimage.io as skio
import copy
import datetime
import matplotlib
import h5py
import random
matplotlib.use("tkagg")
from copy import deepcopy
from matplotlib import pyplot
from shutil import copyfile
from collections import defaultdict
import abber... |
8fa98237e3155124bab0801fdf0fd9e760093cefa865ae3af582b8b33e9948f6 | Python | 18,536 | 491 | from imports import *
import common
from ngs_mapper.rename_sample import RenameException
import gzip
from ngs_mapper import compat
class Base( common.BaseClass ):
modulepath = 'ngs_mapper.rename_sample'
# All possible base paths that might be seen
basepaths = (
'/some/path/NGSData/ReadData',
... |
5b8508b4a181e0214fff1c2acefc894f71fddb85ed39bbc276fe9f43d02e8dd6 | Python | 18,539 | 448 | r"""Part registries, and picking a backbone to put the design in.
``read_sbol`` / ``write_sbol`` could exchange designs but could not *find* one.
Every construct starts from parts somebody already characterised, and the
registries where they live — the iGEM Registry, SynBioHub, Addgene — were
reachable only through a ... |
816d9b581d5e91e6d36cac54e254657b6be019ffa176e8e5e227f33148d3aad6 | Python | 18,562 | 554 | from collections import defaultdict
from typing import Union, Dict, List, Tuple, Sequence
from copy import deepcopy
from prdc import compute_prdc
import numpy as np
import torch
import xmltodict
from monai.data.dataloader import DataLoader
from monai.data.dataset import Dataset
from monai.transforms import (
LoadI... |
8c1c2aeff042f137023138303aad056c907a826c9f3e2a9c1842f9de1692ea32 | Python | 18,568 | 396 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Complete pipeline for online processing using OnACID.
@author: Andrea Giovannucci @agiovann and Eftychios Pnevmatikakis @epnev
Special thanks to Andreas Tolias and his lab at Baylor College of Medicine
for sharing their data used in this demo.
"""
from copy import dee... |
c3ff46f8322e5f536fa02682ec199a8052cbb64e4454736a1ffedc79d9225d5a | Python | 18,571 | 481 | # coding=utf-8
# Copyright 2023 HuggingFace 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.