sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
197e8a735f7c42e93ff27d163ecb7a2847bb0539e9238238b203a1aa7216d6ba
Python
37,762
826
r"""Can it actually be made? — the missing dimension of layer B. ``predict_structure`` / ``inverse_design`` / ``variant_effect`` / ``enzyme_kcat`` form a complete *design* loop: they answer whether a protein folds, what to mutate, and how fast it turns over. None of them answers the question that kills most industrial...
b097f56047216cf3833effa9a4b996e9987e36fa3ed83f3ec4da816a1bf76539
Python
37,775
866
from typing import List, Tuple, Dict, Callable import numpy as np import torch from torch.nn import functional as F from lib.data_utils import dynamic_data_util as ddu from lib.data_utils.dynamic_data_util import LoadedBrownianMovieBlock, interpolate_frame_transition_times2 from lib.data_utils.matched_cells_struct im...
f3f2842b355d2d3c1918de6b56a691587dbe04af4f9534148026cf81cb3ef7f4
Python
37,856
878
from copy import deepcopy from pprint import pformat from typing import Callable, Dict, Iterable, List, Optional, Set, Tuple, Type, Union import nirtorch import torch import torch.nn as nn from sinabs import layers as sl from sinabs.utils import get_new_index from .connectivity_specs import ( LAYER_TYPES_WITH_MU...
07ca96d82c43c8e228c2798aeb2e86dbe7678b231bc9e3190aaf73aead6b2acb
Python
37,892
1,034
from itertools import cycle, islice import numpy as np import operator import random import scipy from scipy.sparse import csc_matrix, csr_matrix, vstack from sklearn.manifold import TSNE from sklearn.metrics.pairwise import rbf_kernel, euclidean_distances from sklearn.neighbors import NearestNeighbors from sklearn.pr...
17f3457c4fd0ce627919278f24387323f6b8aa22ec10db4c3564a337e743dfef
Python
37,910
702
import inspect from itertools import repeat from typing import Callable, List, Optional, Union import torch from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer from ...models import AutoencoderKL, UNet2DConditionModel from ...pipeline_utils import DiffusionPipeline from ...pipelines.stable_diffu...
8bbbb9b1f1f377323fa06ad302c06121bdffbb920e4ab9cf5948e20985ae9d80
Python
37,964
892
import torch from torch import nn from . import Module from contextlib import ExitStack from .esmfold_openfold.tri_self_attn_block import TriangularSelfAttentionBlock from .utils_train_valid import return_predcadist_plddt class RelativePosition(nn.Module): def __init__(self, bins, pairwise_state_dim): sup...
b3b39038bd8ec14b2e2e3a3d271b8ac945e9d7c643c46677f739da5142b75b06
Python
38,006
846
#!/usr/bin/env python3.7 """Defines Simulation class. The copyrights of this software are owned by Duke University. Please refer to the LICENSE and README.md files for licensing instructions. The source code can be found on the following GitHub repository: https://github.com/wmglab-duke/ascent """ import copy import...
bddfd56a77d200f70b27a7c7e6c9217cfb3f28809a4eb36b2c3f0d63b3d677c7
Python
38,059
1,307
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Feb 14 02:44:59 2016 @author: leyangx """ import numpy as np import os import pickle as pk import random import networkx as nx import itertools as itert import matplotlib.pyplot as plt def load(filename): ''' This function can load some data ...
ca58fe14eff12048652625ca123c6ed22977be217740f8c07ec3cd08545d38f3
Python
38,087
1,101
""" 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: Ray Serve inference server in three modes: 1. Ray remote tasks (typical usage — submit as Ray tasks). 2. External clien...
fb22af8c8c1f3f2df096763f10401d02562444e879f7deb90d709cbd847bfa7c
Python
38,100
856
from __future__ import print_function, division import pandas as pd import torch import torch.nn as nn import torch.optim as optim from torch.optim import lr_scheduler import torch.backends.cudnn as cudnn import numpy as np from torch.utils.data.sampler import SubsetRandomSampler from timm.data.constants import IMAGENE...
ba424f02378db80514296c4f329434cbe8b0d1d75328c594b08f3ef1934f853d
Python
38,151
783
# import gpytorch # from gpytorch.constraints import Positive, GreaterThan # from gpytorch.lazy import DiagLazyTensor,BlockDiagLazyTensor,MatmulLazyTensor, InterpolatedLazyTensor, PsdSumLazyTensor, RootLazyTensor, KroneckerProductLazyTensor, lazify # from gpytorch.utils.broadcasting import _mul_broadcast_shape # from g...
e7cadc53a1d80379fe3826726c8a686c26e4a184c2a54504f5a57381374491e1
Python
38,169
1,028
# Copyright 2024 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, ...
a1b75c55deb7fa466d9d599e5d92c96013f3b7d78cde828e07dc873b02371e67
Python
38,187
730
import matplotlib import matplotlib.pyplot as plt import networkx as nx import seaborn as sns import scanpy as sc import numpy as np import pandas as pd from typing import Union, Sequence, List, Tuple, Optional, Iterable from matplotlib.axes import Axes palette_network = list(sns.color_palette("tab20") \ ...
0b58ca0d5507455df31d602d5fe2d06787fe49ca07811d082247ce53a10c13e1
Python
38,203
824
# -------------------------------------------------------- # Swin Transformer MoE # Copyright (c) 2022 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 i...
5e2d05af8042e860848bbafd6d11d5ac2cec272e03dcf5e9ac69d4879ef500fe
Python
38,241
1,050
""" Interactive setup wizard for Jarvis. """ from __future__ import annotations import getpass import os import shutil import sys from typing import Any, Dict, List, Optional, Sequence, Tuple from .config import load_auth, save_auth from .model_registry import ( discover_provider_models, model_description, ...
b0a2126f2eeb14cfe6abe6d1df3b8bde46bf834e569863eabb987f317c5bdf73
Python
38,243
869
from typing import Optional, Union import sys import anndata import numpy as np import pandas as pd import scanpy as sc import networkx as nx from matplotlib import cm import matplotlib.pyplot as plt import plotly from scipy import sparse from scipy.spatial import distance_matrix from scipy.stats import spearmanr, pear...
b03c8bee80d2a03ce5e449a8d8e553e6290b5026966588ffee6ea24188843fbc
Python
38,282
892
""" Assorted utility functions used throughout """ import scanpy as sc import scvelo as scv import numpy as np import scipy as scp import torch as th import anndata as ad import gc from .velocity_genes import compute_velocity_genes from ...pp import highly_variable_genes, umap, pca, neighbors, scale from ...pp._norma...
410d987e3ce870ac7e6e06409a4a5567dafdc876640ca7708a2a93f925b0e59a
Python
38,294
749
# Copyright 2023 The InstructPix2Pix Authors and The HuggingFace Team. All rights reserved. # # 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 ...
7c74d682abf8bb139b0eca9c87ab87e6183faf6e4d7a11e53d2cf98a27fa14cc
Python
38,420
734
# Copyright 2023 The HuggingFace Team. All rights reserved. # # 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 applicabl...
d7dde579766d6acd202ed34b7348e2eac22928053b5bcfd1bfa2ecdc418a78ff
Python
38,434
1,060
"""Provides helper class SkorchDoctor that assists understanding and debugging the neural net training """ from collections.abc import Mapping from functools import partial import numpy as np from sklearn.base import BaseEstimator from sklearn.exceptions import NotFittedError from sklearn.utils.validation import che...
f2c8982d361009022c8b82a703afa81c42465643c0c8802a0e72a20e1660839a
Python
38,461
945
import copy import logging import os import pickle import sys from typing import Any, Dict, List, Optional, Set, Tuple, Union import dask.dataframe as dd import h5py import numpy as np import pandas as pd import torch import zarr from torch.utils.data import Dataset import deeprvat.data.rare as rare_embedders from de...
3005dcd6f7f585a4e679280895217b4c64e3f7ce2496ff8134e646169020dc88
Python
38,464
1,083
#!/usr/bin/env python # -*- coding: utf-8 -*- """Extract neural activity from a fluorescence trace using a constrained deconvolution approach Created on Tue Sep 1 16:11:25 2015 @author: Eftychios A. Pnevmatikakis, based on an implementation by T. Machado, Andrea Giovannucci & Ben Deverett """ from builtins import ...
6e3d900976ee0a88578edf6670adaa149c9e223c523c9a394aeea06766160f49
Python
38,464
713
# Copyright 2023 The HuggingFace Team. All rights reserved. # # 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 applicabl...
47fe289f9e36349b8587b61a84191594cbefd46e3a67ad913afe5d8ac1109fcb
Python
38,556
742
# Copyright 2023 The HuggingFace Team. All rights reserved. # # 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 applicabl...
189a443c22ea7dc25bb2d0b16ceeebf69fa2a7c1afb145603cf88430fc1330cd
Python
38,678
706
from copy import deepcopy import logging import time from urllib import parse from utils.TasksManager import Queue, Task from utils.Typing import CompressFrameworkOpt, ReproducOpt, SingleTaskOpt import shutil import sys from typing import Any, Dict, List, Tuple, Union from tqdm import tqdm from utils.misc import alloc_...
79fa5cdb26865d64552a853106d73468d436b906dbb7d685b812d89ed2844e99
Python
38,682
539
""" Context-belief- and/or history-based agent by Aditya Gilra, Sep-Oct-Nov 2021 """ import gym import numpy as np import gym_tasks import matplotlib as mpl import matplotlib.pyplot as plt import scipy.io as scipyio import sys from BeliefHistoryTabularRL import BeliefHistoryTabularRL from plot_simulation_data import...
44e06493eedd5591e86fa761b3c777f5292c5596cea067cefbdc9557b62d9b69
Python
38,693
753
import math import sys import numpy as np # for linux env. sys.path.insert(0, '..') import time from dataset import * import pickle import argparse from torch.utils.data.sampler import SubsetRandomSampler from evaluation import * import torch.nn.functional as F import os from utils import save_model, l...
ac3a543cba587b040a0808f9b8b1aa1e6e1561035926421fc3835ea4d18daf7d
Python
38,694
820
# Copyright 2023 The HuggingFace Team. All rights reserved. # # 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 applicabl...
c223d5f5ad1b1673d02e0a2f2308e0198ae8c3b93c60219e6fde18de00754329
Python
38,702
779
# Copyright 2023 Susung Hong and The HuggingFace Team. All rights reserved. # # 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 requi...
8a2b25ccbae3c6dafb850b14d1b6ed4b3e131da9301588472687aa0f4c31f0e0
Python
38,744
1,059
import base64 import collections import copy import hashlib import json import logging import os import sys import threading from dataclasses import dataclass from datetime import datetime from io import StringIO from numbers import Number, Real from typing import Any, Dict, List, Optional, Tuple, Union import ray imp...
abf6bfe2fe36c9ebf820404a0006418cac1c93405422813725ff61a805316887
Python
38,760
818
# -*- coding: utf-8 -*- """ LeicaCamWater - is a script for using the built in overhead microtome microscope camera to watch the cutting of serial sections and monitor the water level. """ # based on PyAGTUM_210216.py # Import Packages import pyqtgraph as pg from pyqtgraph.Qt import QtCore, QtGui, QtW...
be8feb55adf6ce5526caef5805aaf6fa1a57848496f0ed99da1c85c24d19dc54
Python
38,868
941
#!/usr/bin/env python # coding=utf-8 # Copyright 2023 The HuggingFace Inc. team. All rights reserved. # # 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/LI...
3befee9839f601c30d4eb0dd406f24f96e327f4ca5d87c6184688b564b00b3e3
Python
38,880
787
# Copyright 2023 TIME Authors and The HuggingFace Team. All rights reserved." # 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 requi...
320788a9e8cf3915c1cd6e6c9d8b2ca614bfbb8f7e6dee8d5934192782a78919
Python
38,973
1,095
from collections import Counter, defaultdict from copy import deepcopy from datetime import datetime from enum import Enum from itertools import chain from typing import Any, Dict, List, Optional, Tuple import ray from ray._common.utils import binary_to_hex from ray._raylet import GcsClient from ray.autoscaler._privat...
7f2757d7cdc187e9a274d36863b400ac827dfa397eeaf21ec447f4633f574f49
Python
39,010
874
import scanpy as sc import os import torch import numpy as np from scipy.sparse import issparse, csr_matrix import matplotlib.pyplot as plt from tqdm import tqdm from .._settings import add_reference from .._registry import register_function def _get_gaston_modules(): from ..external.gaston import cluster_plottin...
2d3511b7d8518188d5ea3b8c470efb308ad0220fb52f2074dfe14a0c8aa0eda4
Python
39,098
927
import math import os from argparse import Namespace from omegaconf import OmegaConf from typing import Optional from time import time from pathlib import Path import numpy as np import torch import torch.nn.functional as F from torch.utils.data import DataLoader import pytorch_lightning as pl import wandb from torch_...
5c31e5c52f3be338c40a495bf11d38c52429b7e5bf239e9fa35c6417b1d647e8
Python
39,110
1,045
import gc import math from typing import Dict, Mapping, Optional, Tuple, Any, Union import torch import numpy as np from torch import nn, Tensor import torch.distributed as dist import torch.nn.functional as F from torch.nn import TransformerEncoder, TransformerEncoderLayer from torch.distributions import Bernoulli fr...
529564845516786f22ad33b36cf7e8f755a6cf55356dc9f2e27eacbccb7dab05
Python
39,165
27
chrs_refseq = {'NC_000001.11': 248956422, 'NC_000002.12': 242193529, 'NC_000003.12': 198295559, 'NC_000004.12': 190214555, 'NC_000005.10': 181538259, 'NC_000006.12': 170805979, 'NC_000007.14': 159345973, 'NC_000008.11': 145138636, 'NC_000009.12': 138394717, 'NC_000010.11': 133797422, 'NC_000011.10': 135086622, 'NC_0000...
3d2fa6a11811e79d8a0b6aa788995f7b297a8a1f84ca05635c89da2884d35d16
Python
39,168
1,125
"""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. End-to-end conformer generation for FastCSP """ from __future__ import annotations import argparse import json import math import shutil impor...
90c96d4eea3d45ed61bcf8a6cb69f7513b8d4ab0c1f1d9810db686e7170c1077
Python
39,212
1,031
""" 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. """ import math import pytest import torch import torch.nn as nn from src.fairchem.core.models.uma.nn.layer_norm import ( get_l_to_all_m_e...
0fc02c78ef201a766480f5f3e634fa8f046b5b84c59f931d3589cc13e9fa261f
Python
39,339
975
from __future__ import annotations from pathlib import Path from typing import Sequence, Mapping, Literal, Union, Optional, Tuple, Dict import numpy as np import pandas as pd import marsilea as ma import marsilea.plotter as mp import inspect import warnings from matplotlib.colors import Normalize, Colormap from matplo...
ee861e7df4fd63044298e147c28d70cc9661e8ca5cf1bf47221e94b952bcb3f5
Python
39,354
851
# masking validation # coding: utf-8 import argparse import time import math import os import copy import sys import torch import torch.onnx import torch.nn as nn import torch.optim as optim import torchvision import torchvision.transforms as transforms import torch.nn.functional as F import numpy as np import logging ...
6938ef7080b7efca6a3311b5c34f1756214b6076a631f60e78fb5cc34b1b970d
Python
39,418
1,170
"""Tests for scoring""" import re from functools import partial from unittest.mock import Mock from unittest.mock import patch import numpy as np from sklearn.metrics import accuracy_score, make_scorer import pytest from skorch.utils import to_numpy class TestEpochScoring: @pytest.fixture(params=[{'use_caching...
a480888b4297da6c399162b3a47c65e97fbd28b5d09825c64e432256be21c710
Python
39,431
823
import os from decimal import Decimal import utility import torch.nn.utils as utils import imageio from utility import savecolorim from div2k import normalize, PercentileNormalizer, np, torch from tifffile import imsave from tqdm import tqdm class Trainer(): def __init__(self, args, loader_train, loader_test, dat...
05d5e378ed55e3ddee4bd0a1dedcd6b1e4c8b786e6d1e0792af476842047412c
Python
39,494
990
"""Marker gene identification and retrieval utilities. Native re-implementation of the scanpy rank_genes_groups pipeline (t-test, Wilcoxon, logreg) — no scanpy dependency required. Ported from: github.com/scverse/scanpy/blob/af57cffc6eb7fa77618b2ab026231f72cd029c12 /src/scanpy/tools/_rank_genes_groups.py """ from ...
2f418fbf96c3919152a7fd3ee735abac8ed51c62cdc748e19e8daf602255838c
Python
39,530
1,340
#!/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 defines t...
bbac7dd1ca2cdb69bdd67f177e6a7c16a02e6665a0c86ede0fbaf306ac9263cb
Python
39,567
925
import numpy as np from .gradient_conversions import ( g_from_b, q_from_b, b_from_q, g_from_q, b_from_g, q_from_g) from ..utils import utils from ..utils.spherical_convolution import real_sym_rh_basis from dipy.reconst.shm import real_sym_sh_mrtrix from scipy.cluster.hierarchy import fcluster, linkage from dipy.cor...
b92b2228a7bdf6307d68df0e15204526378160a2432f634a100aa89394a3e1a8
Python
39,593
797
#!/usr/bin/env python """ Example script to train a VoxelMorph model. You will likely have to customize this script slightly to accommodate your own data. All images should be appropriately cropped and scaled to values between 0 and 1. If an atlas file is provided with the --atlas flag, then scan-to-atlas training i...
6b7c75e5eee0cc505a163e3bd9980719d9ae36036a64da346d151ae5c3524238
Python
39,594
1,141
#!/usr/bin/env python """Classify Ray Sphinx/MyST doc-build warnings against a rules table. Read-only diagnostic. Reads a Sphinx warning stream (a file, stdin, or pasted text -- either the `/rtd-build-logs warnings` output or a raw `sphinx-build` log / `-w` warnings file), parses each warning into a record, classifies...
21b85e00c778ef41f1bb060e3a784c195e5b394d2e15b9e6ff441c237cf837c7
Python
39,610
979
#################################################################################################### # 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...
e68abf6502fcdfc99f0afd11ca1b7fadb3ad980dad4b4a78895d9d071be23ce5
Python
39,638
1,000
# 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...
247a737ef31e574e4447196d255ac0ecedb8e9b5dc7927fcbe31e8f1644e35d1
Python
39,714
1,024
# -*- coding: utf-8 -*- # (C) Copyright 2026 IBM. All Rights Reserved. # # Licensed under the MIT license. See LICENSE file in the project root for details. """High level analog tiles (base).""" # pylint: disable=too-few-public-methods, abstract-method, too-many-instance-attributes from collections import OrderedDic...
c9e90e478aaf90dafce7423f4d85127d1dd9f9582726744d1ad66f063b8b8022
Python
39,737
1,030
#################################################################################################### # 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...
36db55a02c5812c4608662547260869ab138822885629547b62115cd5c6140bc
Python
39,791
999
# built-in dependencies from typing import List, Union, Optional, Dict, Any, Set, IO, cast, Callable, TYPE_CHECKING import io import time # 3rd party dependencies import numpy as np from numpy.typing import NDArray from tqdm import tqdm # project dependencies from deepface.commons import image_utils, package_utils fr...
a39d74abe98b7d069005fd241cb21565dfa525d4c3a648ccd7818e78345bc498
Python
39,828
515
"""Training data from the .cc files of mapped projects: each run's model inputs as CandyCrunch builds them (pooled spectra of MS1-refined precursors, one per candidate composition), labelled from the project's map with pipeline_labels.label_run, one file per run, merged into a training and a pretraining table. Usage (...
bc1f141c2c71a259b5feb0e42e259648da21a73886af2a1f93864c2d0758aef7
Python
39,889
1,151
"""Semisupervised multimodal VAEs for metagenomics binning, this files contains the implementation of the VAEVAE for MMSEQ predictions""" __cmd_doc__ = """Encode depths and TNF using a VAE to latent representation""" import numpy as _np from functools import partial from math import log as _log from typing import Op...
e72ec8f097e2e93c7a3b4478e631b0cab93bf3794a4e47b2145406eecd4244c8
Python
39,906
1,185
# 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, ...
ade7aac83dedb4820970266cf8061874928c465fee248659cd12d7fd1abded0d
Python
39,907
1,202
"""Tests for callbacks/logging.py""" from functools import partial import os import tempfile import unittest.mock from unittest.mock import Mock from unittest.mock import call, patch import numpy as np import pytest import torch from torch import nn from skorch.tests.conftest import neptune_installed from skorch.tes...
2163ae34e39a5bb4f2dc23542b5da6aac32f1dda3ade783ad0bd11e0e0a63155
Python
40,019
1,124
# 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 agreed to in writing, software # distributed under th...
abbdbc4e99724102545db3438f01ad7146cd4b4c090158182db7864fea7938fe
Python
40,069
644
# -*- coding: utf-8 -*- """ # SCRIPT: CREATE EVENT.TSV FILES FROM THE BEHAVIORAL DATA FOR BIDS AND ANALYZE THE BEHAVIORAL DATA # PROJECT: FMRIREPLAY # WRITTEN BY QI HUANG, 2022-2023 # CONTACT: STATE KEY LABORATORY OF COGNITIVE NEUROSCIENCE AND LEARNING, BEIJING NORMAL UNIVERSITY """ # In[1]: load packages, fun...
c22720190dc045713d6ba08ebed7489c0dbc8df030efe2d21e5d7acb3b59982e
Python
40,082
977
r""" Monocle2-style trajectory analysis for AnnData. Pure-Python re-implementation of Monocle 2 (Qiu et al. 2017), exposed as a single `Monocle` class for convenient use within omicverse. Examples -------- >>> import omicverse as ov >>> mono = ov.single.Monocle(adata) >>> mono.preprocess() >>> mono.select_ordering_ge...
e8e7bb52e503492ea994ed3002c490595097ab8f932b85a953ed22a62d2b7137
Python
40,098
929
#!/usr/bin/env python3.7 """Defines FiberSet class. The copyrights of this software are owned by Duke University. Please refer to the LICENSE and README.md files for licensing instructions. The source code can be found on the following GitHub repository: https://github.com/wmglab-duke/ascent """ import csv import os...
543d9d4f2616852ddda970a0553f3241d5cbbc467ed676b1023186b0119547a8
Python
40,128
776
# Copyright 2023 The HuggingFace Team. All rights reserved. # # 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 applicabl...
541ccc94196ea2b436c8fbb26349b631a5a354743e6f1f17663a5c503380e28f
Python
40,129
1,072
""" QC of surface topology and mesh quality. The hippocampal (and dentate) surface should be a compact, orientable 2-manifold with boundary, homeomorphic to a closed disk: one connected component, genus g = 0 and b = 1 boundary loop, so the Euler characteristic chi = V - E + F = 2c - 2g - b = 1 (c = number of c...
9e53d7da1dbec5420881f40c694849592c3cbd3a2d6fbe0f050abd95c341b107
Python
40,185
949
"""Module for integrating spatial transcriptomics data across different conditions. This module implements STAligner, a method for integrating spatial transcriptomics data across different experimental conditions, technologies, and developmental stages. The integration preserves both gene expression patterns and spati...
1037eb82af321948295a48ee7961a77836e23bf8b36537d6e3ab9b8091ed03d5
Python
40,277
997
r"""Time-to-event plots: Kaplan-Meier curves and competing-risk incidence. Both estimators are implemented here directly on top of NumPy/SciPy rather than pulled from ``lifelines``, so survival plotting works in a bare ``omicverse`` install. The implementations follow the standard references and are checked against ``...
662ad78b72289019fbbfc15bee196e4555b719794496be0ffd18e606644cc7d3
Python
40,325
1,157
import logging import warnings from typing import Callable, Dict, List, Optional, Tuple import keras import numpy as np import tensorflow as tf from keras import layers, ops from sklearn.metrics import ( accuracy_score, average_precision_score, r2_score, roc_auc_score, ) from ml4h.models.Block import ...
82fccd782baeb8d3415a2e9fd72fa7dea795109555bb9bf207942c49d1989f30
Python
40,330
1,118
r""" AnnData Rust backend compatibility patches. """ from __future__ import annotations import os from types import MethodType from typing import Iterable import numpy as np from .._settings import Colors def _ov_debug_enabled() -> bool: try: val = os.environ.get("OV_DEBUG") or os.environ.get("OMICVER...
e480171a6ab37a81c16961a6f072f341623116fed314447bf62c20fed42a5e37
Python
40,398
1,072
"""Data-prep helpers for ``ov.genetics`` — genetics-specific wrangling. The post-GWAS pipeline strings together several methods that each want their inputs shaped a particular way: genotype PCA needs a scaled matrix, locus definition needs LD clumping, colocalization wants a summary-statistics dict, TWAS wants a predi...
806b45e3325c9716da3377fd99a27056553484657913ff58a49e4f04eae3e677
Python
40,431
1,058
from mozaik.experiments.vision import VisualExperiment from parameters import ParameterSet import mozaik.stimuli.vision.topographica_based as topo import numpy import numpy as np import mozaik class MapSimpleGabor(VisualExperiment): r""" Map RF with a Gabor patch stimuli. This experiment presents a serie...
036d452ea4f42a6121d005174dcb97a708c9a9af6455f00b1e85e047625b5121
Python
40,482
893
import visionloader as vl import numpy as np from typing import List, Dict, Tuple, Sequence, Union, Optional, Any from collections import namedtuple import itertools import statsmodels.robust as robust from scipy import interpolate from scipy import ndimage import shapely.affinity as affinity from shapely.geometry ...
cb3a01e4071677e88b78ddec31a8fec519ba08a4c84ba61cc19dcec805c9d4b1
Python
40,495
1,193
#!/usr/bin/env python # -*- coding: utf-8 -*- """ A set of utilities, mostly for post-processing and visualization We put arrays on disk as raw bytes, extending along the first dimension. Alongside each array x we ensure the value x.dtype which stores the string description of the array's dtype. See Also: ----------...
0c0e5986be719b5b607974bdae983939c213cb4ef04966d9fe298fa4d1ed6d7f
Python
40,535
1,212
# + import warnings import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np from matplotlib.colors import ListedColormap from matplotlib.gridspec import GridSpec from .._registry import register_function from ._plotdata import get_values def to_rgb_grayscale(img, p_low: float = 1.0, p_high: float ...
8597e7b01d9506b61bc6c7c257f506df09c9b9a064ba756a993dfbd1c5cb5a50
Python
40,561
1,126
# coding=utf-8 # ============================================================================= # Copyright (c) 2001-2021 FLIR Systems, Inc. All Rights Reserved. # # This software is the confidential and proprietary information of FLIR # Integrated Imaging Solutions, Inc. ("Confidential Information"). You # shall not di...
087bcb88860f68d127fcccbceead163b4134096e17e3bbf09e1d5eb94af7a101
Python
40,568
1,051
import pdb import time import copy import logging import numpy as np import scipy.sparse import scipy.integrate from scipy.optimize import minimize from tqdm.auto import tqdm, trange import progressbar from numba import jit, njit, prange from connectivity import Connectivity, SparseConnectivity, BilinearPlasticityRule,...
5ac2ebb01cb5afbd1b32c805eb594afebb234e3f60f2b41ccc6b30d504ea5a70
Python
40,568
1,115
#!/usr/bin/env python3 import argparse import os import sys import re import math import warnings import time import struct from collections import defaultdict import pandas as pd import numpy as np import hicstraw import cooler from scipy.stats import expon from scipy.ndimage import gaussian_filter from scipy.ndimag...
eac5600547f7bb6e522bf99cb9ca3c03ada9eef74a9f81babd16fcaccddaa3aa
Python
40,622
1,134
""" 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 for Wigner D matrix computation. Tests verify: 1. Mathematical correctness (orthogonality, determinant, edge -> +Y) 2. Agreement between...
cd0ac689ebf234be9f176ae200566e6f2b51a604c60239b723aaa23a7119e498
Python
40,783
829
import CLEAR_settings import csv import os import cv2 import numpy as np import matplotlib.pyplot as plt from tqdm.auto import tqdm import copy import pandas as pd import CLEAR_regression import torch import torch.nn.functional as F import torchvision from PIL import Image from skimage import measure fro...
552aeed3351432b69bf9d235e9456ecf2e598540ee79e94bb9956de782f2d2a0
Python
40,813
1,072
########################################################################################### # Implementation of Geometric-Complete Perceptron layers # # Papers: # (1) Geometry-Complete Perceptron Networks for 3D Molecular Graphs, # by A Morehead, J Cheng # (2) Geometry-Complete Diffusion for 3D Molecule Generation,...
f24ba02d47b90d7aec2bb0dfcbfaf4ef3415fab88554d605be1aa6abcbe4c72e
Python
40,917
1,149
""" Callbacks for printing, logging and log information.""" import sys import time import tempfile from contextlib import suppress from numbers import Number from itertools import cycle from pathlib import Path import numpy as np import tqdm from tabulate import tabulate from skorch.utils import Ansi from skorch.dat...
648e261c914dd59e5d6ddeb870ec6605f1983d933dc6337abc7bf133edd803be
Python
41,005
975
r"""Measure-then-place panel layout: the axes box is the size you asked for. :func:`~omicverse.pl.multipanel` is a gridspec. A gridspec divides the canvas into cells and the *axes box* is whatever survives after matplotlib has fitted the decorations into the cell — so a column shares one width, a row shares one height...
17c0b24e627eb29af6ab3ca01a473ad7709c1cf4c4890ae8e257ff5278ff343d
Python
41,059
919
# 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...
eb6bd0a381fe1a07153b58d41b1cd489d696f6f4f698dfbf2669a5d5e2f39511
Python
41,077
975
import json import logging import os import pathlib import re import sys from datetime import datetime from dataclasses import is_dataclass from typing import Any, Dict import sphinx from docutils import nodes from sphinx.util.matching import compile_matchers logger = logging.getLogger(__name__) sys.path.insert(0, o...
a447c6517c21432edc9e6a1f2b9302ba549516a3010cf451a1054ce4c4dfdd09
Python
41,085
1,024
""" Implements the pre-processing of edges into blocks of nodes (modules) for future creation of DynapcnnLayer objects. """ from typing import Deque, Dict, List, Optional, Set, Tuple, Type, Union from torch import Size, nn from sinabs.layers import SumPool2d from .connectivity_specs import VALID_SINABS_EDGE_TYPES f...
cf1b5478b49421524c7f7b6821ffa10d9b2ca25976c9da79c6ec6908bbd5169f
Python
41,085
1,055
"""Paired microbe ↔ metabolite integration. Three analysis layers that all consume a pair of AnnDatas sharing ``obs_names`` (i.e. the same samples measured on both platforms): - :func:`paired_spearman` — Spearman rank correlation between each CLR-transformed microbe and each log1p-transformed metabolite, FDR-corr...
850581ce234402e89c341e21f629c78b4889b6361337153f426e8ba4829687a5
Python
41,097
876
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Jan 1 16:14:53 2022 @author: joern """ # https://coderzcolumn.com/tutorials/machine-learning/scikit-learn-sklearn-feature-selection # %% imports import os os.chdir("/home/joern/Aktuell/PaclitaxelPainLipidomics/08AnalyseProgramme/PaclitaxelNeuropathyPr...
0472ea7f665d2b5aa7d1285c99bfd5aaa855d992164db11988a3877982522ac4
Python
41,101
876
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Jan 1 16:14:53 2022 @author: joern """ # https://coderzcolumn.com/tutorials/machine-learning/scikit-learn-sklearn-feature-selection # %% imports import os os.chdir("/home/joern/Aktuell/PaclitaxelPainLipidomics/08AnalyseProgramme/PaclitaxelNeuropathyPr...
0f4e59bf32ec7a67fa800367f17b7d4b8f48c4f2b30210f910207e0a2bff5c27
Python
41,201
1,022
"""Implements multi-node-type autoscaling. This file implements an autoscaling algorithm that is aware of multiple node types (e.g., example-multi-node-type.yaml). The Ray autoscaler will pass in a vector of resource shape demands, and the resource demand scheduler will return a list of node types that can satisfy the...
1d2afed323fdbc68e94017e5c1b4b91f3d19b6ef6cd6c47b096b0403601612e9
Python
41,212
1,238
from __future__ import print_function import numpy as np import pandas as pd import os import random #os.environ['CUDA_LAUNCH_BLOCKING'] = "1" import torch import torch.nn as nn import torch.nn.functional as F from torch.distributions import constraints, Distribution, Normal, Gamma, Poisson, Dirichlet from torch.dis...
0c2af3aa9146c424157861b41a2210fc6bdcfb9480d44678d7aece8c41be7b8a
Python
41,257
752
""" Functions for CLEAR to create local regressions Outstanding work - perform_regression() accuracy & decision boundaries for multi-class """ from datetime import datetime import numpy as np import pandas as pd import statsmodels.api as sm import copy from sklearn.preprocessing import PolynomialFeat...
03ba6722394e3b7456e1b0f678913dacf8697e36cb3f234378557e4f67856c19
Python
41,273
860
import torch.autograd.functional as F from modnn.Dataset import DataCook import pickle import os import time from mpl_toolkits.axes_grid1.inset_locator import inset_axes import numpy as np import torch import matplotlib.dates as dates import matplotlib.pyplot as plt from modnn.Models import ModNN_phy, BaseNN, ModNN_dat...
a13bd96a24caecbc72c9e671e5e81a7d10b083d19fb4ff1341f74036d7b5c2c8
Python
41,297
843
# -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals, absolute_import, division import warnings from .config import Config from .base_model import BaseModel, suppress_without_basedir from ..utils import _raise, axes_check_and_normalize, axes_dict from ..utils.six import Path from ..utils.t...
7d753212f20cce9a456df55f10ff30ce38eacc6f7e0785afd5cc477bd1bbb0bf
Python
41,300
1,175
"""Utils for plotting whole network graph.""" import collections import itertools from numbers import Number from typing import Dict, List, Optional, Tuple, Union import matplotlib import matplotlib.pyplot as plt import networkx as nx import numpy as np from toolz import valfilter from . import plt_utils class Who...
008765dc5ab6bbc043b13e63640a90cacde6eab3dd5eef844f5df71d8d4d6af7
Python
41,432
1,158
# coding=utf-8 # ============================================================================= # Copyright (c) 2001-2021 FLIR Systems, Inc. All Rights Reserved. # # This software is the confidential and proprietary information of FLIR # Integrated Imaging Solutions, Inc. ("Confidential Information"). You # shall not di...
83dc677db76aedcfe6594eee708a3a979b73dc47d22abc668b6e3f623ebcd3eb
Python
41,471
999
__all__ = ['ADRDModel'] import wandb import torch from torch.utils.data import DataLoader import numpy as np import tqdm import multiprocessing from sklearn.base import BaseEstimator from sklearn.utils.validation import check_is_fitted from sklearn.model_selection import train_test_split from scipy.special import expi...
33a9ab7a291981b4f6bee1f8f18939eddfb859cfdb967b461379c0f3316ab0ac
Python
41,532
1,052
# encoding: utf-8 r""" This file contains the API for direct stimulation of neurons. By direct stimulation here we mean a artificial stimulation that would happen during electrophisiological experiment - such a injection of spikes/currents etc into cells. In mozaik this happens at population level - i.e. each direct ...
d52f2db8f65a8fd0bfccc41386166d8ff2926ba1993f0d52b3b847ae2dd84aba
Python
41,677
885
# Ultralytics YOLO 🚀, GPL-3.0 license """ Export a YOLOv8 PyTorch model to other formats. TensorFlow exports authored by https://github.com/zldrobit Format | `format=argument` | Model --- | --- | --- PyTorch | - ...
33202ebf0498e4a08a5bd25d6721fdc8f0976efc54f52d5f210c49d2d9c14ddf
Python
41,687
1,159
import argparse import tempfile import torch from accelerate import load_checkpoint_and_dispatch from transformers import CLIPTextModelWithProjection, CLIPTokenizer from diffusers import UnCLIPPipeline, UNet2DConditionModel, UNet2DModel from diffusers.models.prior_transformer import PriorTransformer from diffusers.pi...
c1f73955db7fbf0cdd9b2f06f9c304a77167d7ae12c5b92bcda9d68ce7f4aae8
Python
41,715
833
""" SV de novo filtering script """ import argparse import yaml import numpy as np import pandas as pd import pybedtools import collections import time from subprocess import Popen, PIPE pd.options.mode.chained_assignment = None # default='warn' def verbose_print(msg, verbose): if verbose == "True": p...
6125017ffa29749de342950464b1e4bdac3c260fe67ebb60f501d241e1f8ee30
Python
41,770
890
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Jan 1 16:14:53 2022 @author: joern """ # https://coderzcolumn.com/tutorials/machine-learning/scikit-learn-sklearn-feature-selection # %% imports import os os.chdir("/home/joern/Aktuell/PaclitaxelPainLipidomics/08AnalyseProgramme/PaclitaxelNeuropathyPr...