sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
794a9a52d8270962d324e23adf8311f13bd64e6adb60b1abf5ae9cffe8df523f | Python | 28,332 | 781 |
import numpy as np
import pandas as pd
from scipy.sparse import save_npz
from tqdm import tqdm
try:
from . import build_graph
except ImportError:
import build_graph
class SEACellsGPU:
"""GPU Implementation of SEACells algorithm.
The implementation uses fast kernel archetypal analysis to find SEAC... |
c919ff8af686f4e4b13ac213987f6e1523f792ba3abda9252e83129f38bde439 | Python | 28,335 | 783 | """
Discord channel for OmicVerse Jarvis.
Behavior mirrors OpenClaw's default Discord mode:
- direct messages are handled directly
- guild messages require @bot mention
- analysis replies are streamed back as text and file attachments
Migrated to shared MessageRuntime / MessagePresenter abstractions so that
task mana... |
3f14ea35d9cd36ecb8d9e2462cefb4434cddceded29959e9e027df7695f68e37 | Python | 28,337 | 649 | r"""Lower-envelope panel decontamination -- ``method='envelope'``.
A native estimator for the case the packaged backends are not built for:
**several preparations whose soup profiles differ**, only a handful of
low-depth empty droplets per preparation, and *no population-private gene* --
every soup-carrying gene is al... |
189c836c9967caafea9b9a23096f69a71706f2da25f8fd10180590bc1f504d66 | Python | 28,355 | 614 | import argparse
from utils.utils import load_data, define_logger, tokenize_gen, evaluate_gpt2, gpt2_evaluate, compute_ppl
import random
import numpy as np
import torch
from model.generatively_model import gpt2_generate, bart_generate
from transformers import AdamW, GPT2LMHeadModel, GPT2Tokenizer
import sys
import torch... |
bcc04be9ba7ddff34ed760a694aabfc5cf466b3b9f7a4b4ed77dd1677adb671d | Python | 28,391 | 764 | #!/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 file contains th... |
ea217cad3f859186f2f34e84ee0517a4824d3acb93353cc04d666880b32e6123 | Python | 28,394 | 717 | import copy
import logging
import sys
import threading
import time
from collections import OrderedDict, defaultdict
from typing import Any, Dict, List
import botocore
from boto3.resources.base import ServiceResource
import ray
import ray._private.ray_constants as ray_constants
from ray.autoscaler._private.aws.cloudwa... |
1987b1dcec9bafac873120dc08910f79dcc22f4ffbe296a05cb1b04f28aa61c0 | Python | 28,418 | 726 | """
run_models_.py
Purpose: Predict gene expression given graph structure and node features
Usage: python ./run_model_.py [-c <str>] [-rf <int>] [-me <int>] [-lr <float>]
[-cn <int] [-gs <int>] [-ln <int>] [-ls <int>]
Arguments:
'-c', '--cell_line', default='E116', type=str
'-rf', '--regression_flag', d... |
0a5cce9e3a4ba9c8528775e6807d46f3b3c8b5aad928874a29d1fbb6dad6f9e2 | Python | 28,447 | 549 | # -*- coding: utf-8 -*-
"""
# # SCRIPT: FMRI-DECODING IN RESTING
# # PROJECT: FMRIREPLAY
# # WRITTEN BY QI HUANG 2022
# # REFERENCED TO LENNART WITTKUHN, SCHUCK NICOLAS, 2021
# # CONTACT: STATE KEY LABORATORY OF COGNITIVE NEUROSCIENCE AND LEARNING, BEIJING NORMAL UNIVERSITY
"""
# In[1]: import relevant packages... |
8e323fb2e8a9f75d4a7834a5ca9ed314c9719d12b9a6dd68f8503d8a6b619888 | Python | 28,448 | 817 | """Branch-aware pseudotime ribbon plots."""
from __future__ import annotations
from pathlib import Path
from typing import Any, Mapping, Sequence
import matplotlib.patheffects as pe
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from matplotlib.axes import Axes
from matplotlib.colors import t... |
5b6ebf60c346c2755be4b65f6780c6bf9ef4a7b62302cb6d11252f3586f179a2 | Python | 28,490 | 659 | #!/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 program calculat... |
acc5ce25d668deb2984bfcc32d57d1e0cfcadd828a7c44731e47c1433e7f3ac2 | Python | 28,494 | 766 | import copy
import numpy as np
import pandas as pd
from scipy.sparse import csr_matrix, save_npz
from scipy.sparse.linalg import norm
from sklearn.preprocessing import normalize
from tqdm import tqdm
try:
from . import build_graph
except ImportError:
import build_graph
class SEACellsCPU:
"""CPU Impleme... |
d19db357917107632eabae502b32da913977072138b9bd275b8764f3e0eff268 | Python | 28,514 | 645 | #!/usr/bin/env python3
from __future__ import print_function
import argparse
import glob
import sys
import numpy as np
import pysam
import math
# read keys
R_ID = "id"
R_START_POS = "start_pos"
R_END_POS = "end_pos"
R_LENGTH = "length"
R_SECONDARY = "secondary_alignment"
R_SUPPLEMENTARY = "supplementary_alignment"
R_M... |
1d8e34ecee47445c9497ae5941f58d0a20baf0f8defe80acb72f4f7141719853 | Python | 28,535 | 735 | import logging
from pprint import pprint
import sys
from typing import Optional, Tuple
import click
import pandas as pd
import yaml
from deeprvat.deeprvat.evaluate import pval_correction
from pathlib import Path
from copy import deepcopy
REPO_DIR = (Path(__file__).parent / "../..").resolve()
logging.basicConfig(
... |
c420d5d4873340efbc5faa92445fbbad8166bd8d710c399c9176172abbb56e53 | Python | 28,546 | 940 | """
Analysis of responses to moving edges or bars.
Info:
Relies on xarray dataset format defined in `flyvis.analysis.stimulus_responses`.
"""
from __future__ import annotations
from typing import Callable, Iterable, List, Tuple, Union
import matplotlib.pyplot as plt
import numpy as np
import xarray as xr
from s... |
40e1db26f33c0766ed6c89f3574af79d725c2c417e3e446270b5b7ad8961aa2a | Python | 28,555 | 654 | import warnings
from typing import Tuple, Union
import numpy as np
import torch
import torch.nn.functional as F
class SSIM(torch.nn.Module):
"""
Args:
spatial_dims (int): Number of spatial dimensions, could be 2, or 3.
in_channels (int): Number of input channels.
data_... |
0864cc6ab0955fe639b1a792c180d384646626c32bc283e2d9aa61c19dba3ab1 | Python | 28,559 | 660 | #!/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 program calculat... |
9e42634f4c51ccf0d463ae2c4e0429a801dd9ae3d191d5d0e4eab6151abc8662 | Python | 28,607 | 608 | import numpy as np
import networkx as nx
import os.path
import matplotlib.pyplot as plt
import time
import math
import gc
gc.collect()
import warnings
warnings.filterwarnings("ignore")
import os
os.system('cls' if os.name == 'nt' else 'clear')
plt.rc('font',size=15)
start = time.time()
"""SDE: double w... |
8cd1b1bf3c36190a81d932bdbe5ce9e654fad9574a27a247b612f173a7c2e493 | Python | 28,634 | 692 | import argparse
import inspect
import logging
import math
import os
from pathlib import Path
from typing import Optional
import accelerate
import datasets
import torch
import torch.nn.functional as F
from accelerate import Accelerator
from accelerate.logging import get_logger
from accelerate.utils import ProjectConfig... |
a7d61896e81082338ceaf84b55ec09b663d5a7f608c17a0d04cdeb6f54ca0855 | Python | 28,635 | 663 | 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 ..bulk import data_drop_duplicates_index, deseq2_normalize
#from .map_utils import create_data... |
7b33a7795ad642652264b2a86ce782deb274a04bb1d3a44c7fed55f3c688bf1d | Python | 28,647 | 585 | # 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... |
3a3228043702114edb01f9a2d81d57976831280cea784bc8df0e0896a7e40a59 | Python | 28,652 | 501 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
"""
Compute allele frequencies for sex & population combinations given an SV VCF
"""
import sys
import argparse
import pysam
from svtk import utils as svu
from collections import Counter
import pybedtools as pbt
def create_pop_dict(popfile):
"""
Makes diction... |
99c483e0e60ba1d0668ad092671265373eb5b7eafa1c2ab21db8b7a895577b58 | Python | 28,653 | 610 | import numpy as np
import networkx as nx
import os.path
import matplotlib.pyplot as plt
import time
import math
import gc
gc.collect()
import warnings
warnings.filterwarnings("ignore")
import os
os.system('cls' if os.name == 'nt' else 'clear')
plt.rc('font',size=15)
start = time.time()
"""SDE: double w... |
9b5f29a852140c5985428aefea44bb305183c11663bdee8bbb1ed86556f9363d | Python | 28,729 | 661 | # All rights reserved.
from math import ceil, sqrt
from collections import OrderedDict
import torch
import torch.nn as nn
from functools import partial
from timm.models.vision_transformer import _cfg
from timm.models.layers import trunc_normal_, DropPath, to_2tuple
from timm.models.registry import register_mode... |
e5e0059b2c8f4709cf245a6abdb3c5252a4327ff2cdd9cf051c2e3e37aa649da | Python | 28,778 | 594 | import h5py
import numpy as np
from datetime import datetime
import logging
from typing import List, Tuple
from ml4h.normalizer import Standardize, ZeroMeanStd1
from ml4h.tensormap.general import tensor_path
from ml4h.TensorMap import TensorMap, Interpretation, str2date, make_range_validator
from ml4h.defines import S... |
e4d24ba6801278870cbae5ff60c56a248ba4e454f40ebe667808a8f17c4ed0ae | Python | 28,790 | 770 | """Response to Reviewer 2 - compare first to last trials of 24s stimulation across runs"""
import os
import glob
import datetime
import calendar
import time
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import subprocess
import glob
import os
import nibabel as nb
import n... |
4cec813c2c6e1a60f01f6179e678cd0e67d1f67c2d15b78419f1e64294bb863c | Python | 28,801 | 711 | ####################################################################################################
# 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>
#
# The code in this fi... |
18b0bce3f488c6755445ea9611d968f49f5c773c6f4dd64e1e2dc9f36d7d6e80 | Python | 28,812 | 798 | # arrow_serialization.py must resides outside of ray.data, otherwise
# it causes circular dependency issues for AsyncActors due to
# ray.data's lazy import.
# see https://github.com/ray-project/ray/issues/30498 for more context.
import logging
import os
import sys
from dataclasses import dataclass
from typing import TY... |
140e2a8cfbf0a4aba48d8a4ea60635c0a6d6f117e6b805a3b7fc80517b8d039d | Python | 28,814 | 695 | # 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... |
2467e68a824de5ef25e76dd803a023724a534ce9665c56f24586df435e611674 | Python | 28,831 | 775 | from typing import Dict, List
import re
import csv
import json
from datetime import datetime
import torch
import requests
from sklearn import metrics
from django.contrib import messages
from django.shortcuts import render, redirect
from django.http import JsonResponse, StreamingHttpResponse
from django.core.cache imp... |
b69f6914321ee129191c99a5028c2d4ac08009e4563072ce0a8dc1302f694134 | Python | 28,865 | 591 | #!/usr/bin/env python
from __future__ import print_function
import argparse
import glob
import gzip
import math
import numpy as np
import os
import matplotlib.pyplot as plt
from matplotlib import rcParams
rcParams.update({'figure.autolayout': True})
# bed detail indices
START_POS = "start"
END_POS = "end"
CENTER_POS... |
1dab824ef6d02aa13868fd6d0f08aca884869f654b77bc82507fd24d358dbb96 | Python | 28,866 | 847 | import pandas as pd
import numpy as np
import os
import random
import numba
import torch
import scanpy as sc
from sklearn.neighbors import kneighbors_graph
from sklearn import metrics
import scipy.sparse as sp
import scipy.stats as stats
from scipy.optimize import least_squares
from scipy.ndimage import gaussian_filter... |
802a8df61103e1ff58526155981817e1041a598c6347f37a444dfd762f6e8b33 | Python | 28,866 | 585 | #!/usr/bin/env python
import sys
import os
import pybedtools
import pysam
import numpy
import scipy.sparse
import argparse
from typing import List, Text, Optional, Iterable, Iterator, Tuple, Set, Dict, Mapping
from types import MappingProxyType
import multiprocessing
class Keys: # static class with re-used strings ... |
6059a93c8461fd388d319377806bfc5e2d0fd1f215cd9cb322f97ff7422d0f77 | Python | 28,874 | 609 | # Copyright 2023 TSAIL Team 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 requir... |
e97862e5e7e6351a3de62e3dfa0bea6ba4580ff4343297e85246ac0f2e76529e | Python | 28,883 | 829 | # 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, ... |
8d65bf9f510e3eb036cabdf59d45bcbca07fb6ddc810533513f76b51b02fdfcb | Python | 28,901 | 691 | r"""Seurat-style RPCA (reciprocal PCA) integration — a faithful Python port.
This module reproduces Seurat v5's
``IntegrateLayers(method = RPCAIntegration, ...)`` /
``FindIntegrationAnchors(reduction = "rpca")`` + ``IntegrateEmbeddings``
pipeline in pure Python (numpy / scipy / scikit-learn), so users can run RPCA
bat... |
5ba670f46604894af9920a5e1d60e0e15c0fee599b710dbbe942e704e87a0ec9 | Python | 28,911 | 642 | # coding=utf-8
# Copyright 2023 The HuggingFace Inc. team.
# Copyright (c) 2022, NVIDIA CORPORATION. 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.a... |
e636ce4a794b0b21c741aa3a8ecf15fd3a276e0ea1f668ddce2e3757cf8f409e | Python | 28,913 | 603 | import numpy as np
import networkx as nx
import os.path
import matplotlib.pyplot as plt
import time
import math
import gc
gc.collect()
import warnings
warnings.filterwarnings("ignore")
import os
os.system('cls' if os.name == 'nt' else 'clear')
plt.rc('font',size=15)
UseDoubleWell=1
RCType=0# Different R... |
8cba3703008dffff50b02e9fbf599790a293820cac18fcf593028ab8bc8dc729 | Python | 28,955 | 828 | #!/usr/bin/env python
# HiC-Pro
# Copyleft 2015 Institut Curie
# Author(s): Nicolas Servant, Eric Viara
# Contact: nicolas.servant@curie.fr
# This software is distributed without any guarantee under the terms of the
# GNU General
# Public License, either Version 2, June 1991 or Version 3, June 2007.
"""
Script to kee... |
0e655981cf393d0ee1f341b85bf0786f99e80d712557e81ead1b4ea371859829 | Python | 28,966 | 690 | #prototype dlib v3
import csv
import datetime
import math
import os
import sys
import time
import cv2
import dlib
import matplotlib.pyplot as plt
from multiprocessing import Process, Queue
from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QHBoxLayout,QCheckBox, QDesktopWidget, QPushButton
import numpy as... |
10c69c912c28fa063d90052b41fd36ccffac5dd3867ef78d79dc3400257382e1 | Python | 28,979 | 621 | ################################################################################
# -- Preprocessing and analysis of the simulation results
################################################################################
import pickle
from imp import reload
import defaultParams;
reload(defaultParams);
from defaultPara... |
644e38349fd98bf6a47cb31cd73d82a2ffc36aa18910ff5fed4f597d532ca7f7 | Python | 28,979 | 1,051 | import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import settings
import os
import pickle
from mpl_toolkits.axes_grid1 import make_axes_locatable
from utils.utils import (
grid_meanfr,
grid_2d,
get_hexsym,
get_pathsym,
convert_to_rhombus,
adap_euler,
ax_pos
)
from utils.gr... |
626134061fb0d803acfde673e7958affd278a68c3f6a3ca729de881282d8d8c7 | Python | 28,980 | 601 | # 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... |
30e3764dbe05f28a275e1e30b8048cbafa077897e357b0346c45064bc711c32b | Python | 29,010 | 458 | 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
... |
fd20e1347c47a1e74eefd421e2053986684c952e361202621d29694ac70fa7e4 | Python | 29,019 | 433 |
dataset_dict={}
dataset='7_Cryo_aw_f'
dataset_dict[dataset]={}
dataset_dict[dataset]['rabies_out']='/scratch/m/mchakrav/desgab/data_preprocess/multicenter/rabies_7_Cryo_aw_f_20221024'
dataset_dict[dataset]['FD_threshold']=0.05
dataset_dict[dataset]['min_timepoint']=260
dataset_dict[dataset]['tDOF_matching']=False
dat... |
564b0b3ddd1c6b1caab6b267c22dfee1bd734f7d5d4b7152fc95a9832dad9359 | Python | 29,035 | 894 | # -*- coding: utf-8 -*-
"""
This module contains classes with tests for mozaik/stimuli/vision/topographica_based.py
"""
from mozaik.stimuli.vision.visual_stimulus import VisualStimulus
import imagen
import imagen.random
from imagen.transferfn import TransferFn
import param
from imagen.image import BoundingBox
import p... |
163f539c0c2fdb7dfd6e3e4b9937a03a19a17c351f2837289c4627f561ee78e4 | Python | 29,040 | 674 | import numpy as np
from typing import List, Union, Tuple, Dict
import sys
from abc import ABC
from lib.dataset_config_parser.dataset_config_parser import LookupKey
from lib.dataset_specific_ttl_corrections.block_structure_ttl_corrections import WithinBlockMatchedFrameBins, \
WithinBlockMatching, _make_timebin_bou... |
4b5c771feb3a6273d1d9a563e17a5febc0cdc5ae588c3ff4fd8bbe9e5f0900ab | Python | 29,045 | 686 | r"""Distribution plots: histograms, densities, ridgelines and Q-Q plots.
``ov.pl`` could draw a violin of an ``AnnData`` column but had no general
histogram, no density plot, no ridgeline, and a Q-Q plot only inside the GWAS
code. These are the container-free versions — a table and column names, bare
arrays, or an ``A... |
a9c90553ab60a7bde7f1bdc13b53a1325894e93bc2f03449b1ee94e1fb6eb67b | Python | 29,050 | 768 |
import numpy
import random
import warnings
import os
import json
from skimage import filters
from scipy import optimize
from pysted import base, utils
from pysted import exp_data_gen as dg
from . import defaults
def get_foreground(img):
"""Return a background mask of the given image using the OTSU method to th... |
1efde4b63e7a0246e71d1db12c85d5a466cc1af1a6a174c13ead2abb9f85deba | Python | 29,065 | 916 | """
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 asyncio
import logging
from contextlib import AsyncExitStack, asynccontextmanager, suppress
from ... |
e2355b04b1c19384899a4da18b83b66f2d7a837a52d08716a7124c724ede20bd | Python | 29,131 | 732 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 20 12:12:34 2016
@author: agiovann
"""
# %%
from builtins import range
from past.utils import old_div
import cv2
import itertools
import logging
import numpy as np
import os
import tensorflow as tf
import scipy
from scipy.sparse import csc_matrix
f... |
e7cfc7f40a40e5fbb2d820b97b958200f85535bd5058dbc68ae3cd5663bcfbfd | Python | 29,133 | 807 | import matplotlib
matplotlib.use("Agg")
from mozaik.connectors import vision
from mozaik.connectors.vision import V1CorrelationBasedConnectivity as V1CBC
from mozaik.tools.distribution_parametrization import (
MozaikExtendedParameterSet,
load_parameters,
)
import mozaik
import numpy as np
import numpy.linalg
f... |
649775f9a7ad3d3b01c15ea28f8ae34c97388362aa8f6664a37dd4e9ac0c5800 | Python | 29,148 | 694 | # 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... |
0fe6e44ec11d5a77e267e9facfc78e1f5105810ff360ce0ff94703bf82e6ca09 | Python | 29,163 | 708 | """
Surface plotting functions.
"""
# Author: Oualid Benkarim <oualid.benkarim@mcgill.ca>
# License: BSD 3 clause
import os
import warnings
from itertools import product as iter_prod
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.colors import Colormap
from .base import Plotter
from .colormaps ... |
e9aa86916e2c0f480d7ee87edc9f0b07b128064b7a3d4e59a2a35eae344b1e91 | Python | 29,178 | 786 | """Tests for skorch._doctor.py"""
import itertools
from unittest import mock
import numpy as np
import pytest
import torch
from torch import nn
class TestSkorchDoctorSimple: # pylint: disable=too-many-public-methods
"""Test functionality of SkorchDoctor using a simple model"""
@pytest.fixture(scope='module... |
bbe92791cc950663df8469822cc3b122e19aaf07105aee663a4f8490fa886909 | Python | 29,180 | 626 | import numpy as np
import pytest
import copy
from lgca import get_lgca
from tests.common_test import T_LGCA_Common
from tests.classical_test import Test_LGCA_classical as T_LGCA_classical # rename to avoid duplicate execution of these tests
com = T_LGCA_Common
@pytest.fixture
def nodes_1d_rbound():
# fixtures ... |
f15414823adb88ef38472b92332b17bdfc4efb1606f524fd5bc5104ccd0fa1a3 | Python | 29,201 | 625 | __version__ = "0.0.1"
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/api/wavelets.ipynb.
# %% auto 0
__all__ = ['define_frequencies', 'define_wavelets', 'compute_spectral_features_array', 'compute_spectral_features',
'spectrum_from_features', 'ro_corrcoef', 'bw2qt', 'qt2bw', 'plot_wavelet_family']
# %%... |
827c0b98790b5846bba2d0d6a4bbc150a73fb9b4152550b3efebe3ba67c2457f | Python | 29,220 | 753 | from __future__ import division
from warnings import warn
import numpy as np
import h5py
from ..core.nodes import *
# To keep same order of views and groups in the hdf5 file
# h5py.get_config().track_order = True
def _make_unique(x):
"""Make values in the input list unique"""
from collections import Counter
... |
a68d47150995977de45823e1efba1191906ba2d59e5085bacd36ed5be7c8dbe1 | Python | 29,226 | 502 |
'''This modules implements different configuration of a ``base.Microscope``.
Currently implemented microscopes are
* ``DyMINMicroscope``
* ``DyMINRESCueMicroscope``
* ``RESCueMicroscope``
Implementing their own microscope requires to reimplement the ``get_signal_and_bleach``
method of a ``base.Microscope``.
.. r... |
c6df839ba309d945572c41f21ad83998e0c84debe6c44f728fd05dc203484e4d | Python | 29,233 | 765 | import torch
import torch.nn as nn
import torch.optim as optim
from torchvision import datasets, transforms
from torch.utils.data import Dataset, DataLoader
from copy import deepcopy
import numpy as np
import matplotlib.pyplot as plt
import argparse
import pdb
import os
import sys
import scipy.io
from scipy.sparse impo... |
a839993e0da98d5caa14fe23c1bf35d817f44a76d33cdca1a4a44b20a3eb9e36 | Python | 29,239 | 618 | import numpy as np
import networkx as nx
import os.path
import matplotlib.pyplot as plt
import time
import math
import gc
gc.collect()
import warnings
warnings.filterwarnings("ignore")
import os
os.system('cls' if os.name == 'nt' else 'clear')
plt.rc('font',size=15)
UseDoubleWell=1
RCType=0# Different... |
a0a4b71aca8c39f96a4337321881e9022dfe58aed043e3f35cd6d2f3066ce865 | Python | 29,246 | 812 | r"""Metabolomics-specific plots.
Three core plots every metabolomics paper has:
- **Volcano plot** — log2FC vs -log10(padj), metabolite labels on
significant hits.
- **S-plot** — OPLS-DA signature plot of p(corr) vs p(cov) used to
interpret which metabolites drive the group separation.
- **VIP bar** — top-N metab... |
b2c4d1eeb1ca21e233d293e1776d08d2f60508c109c5ac07c2466e2af24114bf | Python | 29,250 | 620 | import numpy as np
import networkx as nx
import os.path
import matplotlib.pyplot as plt
import time
import math
import gc
gc.collect()
import warnings
warnings.filterwarnings("ignore")
import os
os.system('cls' if os.name == 'nt' else 'clear')
plt.rc('font',size=15)
start = time.time()
"""SDE: double w... |
d5bc16c931a9c835ca9f8faae4a7fcae7f717e815aaa7ebeab7d1ed6f99b91dd | Python | 29,285 | 825 | #
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# 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 ... |
ebe981931479f548569642ad14f543e73f989aaf4e6a2ba76da170b964c508c3 | Python | 29,363 | 618 | import numpy as np
import networkx as nx
import os.path
import matplotlib.pyplot as plt
import time
import math
import gc
gc.collect()
import warnings
warnings.filterwarnings("ignore")
import os
os.system('cls' if os.name == 'nt' else 'clear')
plt.rc('font',size=15)
start = time.time()
"""SDE: double w... |
5f8e6cddad1081a896ae7d0bd417ec707bd059183581487ff3b56932d4eb019f | Python | 29,377 | 619 | import numpy as np
import networkx as nx
import os.path
import matplotlib.pyplot as plt
import time
import math
import gc
gc.collect()
import warnings
warnings.filterwarnings("ignore")
import os
os.system('cls' if os.name == 'nt' else 'clear')
plt.rc('font',size=15)
UseDoubleWell=1
RCType=0# Different... |
55a3527ac8608903e2b569417d9f3ef28a522b9c3231bd86ecc023b08fc0890e | Python | 29,378 | 778 | #!/usr/bin/env python3.7
"""Defines Trace 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 random
from cop... |
23123e1c948cbbabeae2526fb193bc6fed9ff20f0f3e001f6ce0ad61f6475cc8 | Python | 29,400 | 594 | # 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... |
8e0d02b545b9b19eab0b4bc2fffd8bb8d11e0ec4b3f6b8d2b442fab842d1e0e5 | Python | 29,452 | 640 | """
Geneformer precollator and pretrainer.
Huggingface data collator and trainer modified to accommodate single-cell transcriptomics data.
"""
import collections
import math
import pickle
import warnings
from enum import Enum
from typing import Dict, List, Optional, Union
import numpy as np
import torch
from datasets... |
7467c875f9672590aabd9b440c7b89ae523c446118d049ba01e4c5285d6950fb | Python | 29,460 | 797 | """
Functions for the analysis of extracted feature matrix.
"""
import itertools
import logging
import os
import warnings
from copy import deepcopy
from pathlib import Path
import inspect
import numpy as np
import pandas as pd
import shap
import sklearn
from sklearn.metrics import accuracy_score, mean_absolute_error, ... |
bf72b19d45f20cf893d8f17f528a99fcc77eb5409b833fe43c6fe3131365cd54 | Python | 29,493 | 757 | """Generate ``llms.txt`` and per-section ``llms-full.txt`` files for AI agents.
This in-repo Sphinx extension replaces the third-party ``sphinx-llms-txt`` with
output structured by the site's navigation (the `llms.txt spec
<https://llmstxt.org/>`_ and most coding-assistant tooling favor sectioned
output). It emits thr... |
12872bc6a024ccc2b1ec70c3087f8031e6d71668ad23b9e5d13563e171240b55 | Python | 29,501 | 809 | # -*- coding: utf-8 -*-
# (C) Copyright 2026 IBM. All Rights Reserved.
#
# Licensed under the MIT license. See LICENSE file in the project root for details.
"""Convolution layers."""
# pylint: disable=too-many-arguments, too-many-locals, too-many-instance-attributes
from typing import Optional, Tuple, Union, List, ... |
9e7a6da9778f90f1df9576cfdf91d0178886222dd5e777cde380e1f40268f216 | Python | 29,528 | 811 | import enum
import os
import pickle
import urllib
import warnings
from numbers import Number
from types import ModuleType
from typing import Any, Dict, List, Optional, Sequence, Tuple
import numpy as np
import pyarrow.fs
import ray
from ray import logger
from ray._common.utils import load_class
from ray.air._internal... |
a31c0e688f96ce34f228c3c45839d44e7413a7c918a9d189a341cc6f1c540bac | Python | 29,542 | 781 |
"""
This module is used to define the class containing the entire Bayesian Network,
and the corresponding attributes/methods to train the model, set algorithmic options, calculate lower bound, etc.
"""
from __future__ import division
from time import time
import pandas as pd
import sys
import math
# import resource
... |
c9c2ba0e48c340f475a1175dfd9c565176e66345e89b5887981278ab0efcf3c7 | Python | 29,542 | 576 | # 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... |
0c69061832bc9b9077a0c4f324aca7b563fdf646b07a04139823567a23377739 | Python | 29,550 | 835 | import copy
from logging import getLogger
import numpy as np
import torch
from torch import nn
from pfrl import agent
from pfrl.action_value import SingleActionValue
from pfrl.utils import clip_l2_grad_norm_, copy_param
from pfrl.utils.batch_states import batch_states
from pfrl.utils.mode_of_distribution import mode_... |
6dbc03e7f7e258bbce4699762a16b815188146030692c003c5abd2f0a12ab044 | Python | 29,587 | 764 | """Python port of plot1cell::plot_circlize (HaojiaWu/plot1cell).
The original R function arranges a UMAP/t-SNE inside a circular
"circlize" layout: the circumference is split into cluster sectors
(arc length ~ log10(n_cells)), and any number of concentric outer
rings show per-cell metadata grouped by cluster. The scat... |
b16f30f15f03bff2be6739568d31d13812a49a4d1cd4c3ca4ad41d827f0d73db | Python | 29,595 | 802 | import json
from pathlib import Path
from dataclasses import InitVar, dataclass, field
from typing import Any, Dict, List, Mapping, Optional, Tuple, Union
from typing_extensions import Self, Literal
import numpy as np
from scipy.sparse import spmatrix, csr_matrix
from anndata import AnnData
from datasets import Datase... |
b03bbe765eb10c0b9fd05345a7c552681ea42f20acb3e7e7335676af027b913a | Python | 29,621 | 505 | """
Simple data analysis of mice behaviour on olfactory/visual task switches
by Aditya Gilra, 24 Oct 2021
"""
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import scipy.io as scipyio
import sys
# to have reproducible random number generation
np.random.seed(1)
# Obsolete -- see Nick's ne... |
72b27db231f1c2cb1f5f341161a9436a860972ba00864c2c0316c3b831c64b19 | Python | 29,629 | 601 | # Outstanding - Calculate_Perturbations() does not allow for categorical multi-class
# create missing_log_df function
import csv
from datetime import datetime
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
import numpy as np
import pandas as pd
from jin... |
9f3540bf5b02361d85aa97a322d7453064a1caf1d61cc2308b14e44af1a43a04 | Python | 29,677 | 810 | # -*- coding: utf-8 -*-
# (C) Copyright 2020, 2021, 2022, 2023, 2024 IBM. All Rights Reserved.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#... |
cee92eb46693a21fc9b1db03019988e14cba742fa13838bd1955eb23df887c3f | Python | 29,687 | 637 | import logging
from typing import Dict, List, Tuple, Sequence
import numpy as np
import tensorflow as tf
from tensorflow.keras.layers import Dense, Flatten, Reshape, LayerNormalization, DepthwiseConv2D, concatenate, Concatenate, Add
from ml4h.models.Block import Block
from ml4h.TensorMap import TensorMap
from ml4h.mo... |
582825f7dc8c79566d065221e036db74c613825b5431e7a1e1c1038d7e7d20a7 | Python | 29,695 | 664 | # encoding: utf-8
import mozaik
import numpy
import ast
from mozaik.connectors import Connector
from mozaik.connectors.modular_connector_functions import *
from collections import Counter
from parameters import ParameterSet
from mozaik.tools.misc import sample_from_bin_distribution, normal_function
from mozaik import l... |
7eea26f6e295a68dc9cf37e2221152847fb672ab8571646116a8c0ae3f4ebe28 | Python | 29,702 | 744 | ####################################################################################################
# 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... |
1bcf9af416669b2f25de7ea49b68c7bad758891413bc6b97e7163b95fa19f65e | Python | 29,730 | 714 | from allensdk.core.brain_observatory_cache import BrainObservatoryCache
import copy
import h5py
import hashlib
import itertools
import matplotlib
import matplotlib.pyplot as plt
import mat73
import numpy as np
import os
import pandas as pd
import pickle
import scipy.optimize
import scipy.stats
import scipy.special
impo... |
48b86f76d7aa4ddf41e2c8c8075a23b91e608a1bcc86cecc183a6fe4a5c41a64 | Python | 29,741 | 800 | import collections
import copy
import ctypes
import multiprocessing as mp
import multiprocessing.synchronize
import time
from logging import Logger, getLogger
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple
import numpy as np
import torch
import torch.nn.functional as F
import pfrl
from pfrl i... |
9c7ec44cf46567b098fd70ce5e63361f8f2ce9689a44466e489a79d1d0bd013d | Python | 29,752 | 707 | import os
import pandas as pd
import torch
import torch.distributed as dist
import torch.multiprocessing as mp
from torch.nn.parallel import DistributedDataParallel as DDP
from torch.utils.tensorboard import SummaryWriter
from tqdm import tqdm
import optuna
import functools
import time
from .model import GeneformerMul... |
d7c6166e2614cb9d59db34513fa040dd1c8754ae582a01843f22db035da7f0e7 | Python | 29,755 | 720 | ####################################################################################################
# Copyright (c) 2016 - 2024, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
# Adrien Fleury <adrien.fleury@epfl.ch>
# This file is part of NeuroMorphoVis <https://github.com/... |
be214613794178983ff85dcd35398ea3a2ccbd9c787207d8b3fc662c30732294 | Python | 29,776 | 582 | # 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... |
78a94b4503da0082728bec42753ba4e0782b82bbf2a17909025495029e7324da | Python | 29,853 | 519 | import io
import numpy as np
from scipy import sparse
from scipy import signal
from scipy.io import savemat, loadmat
import time
import multiprocessing as mp
from PostProcessing.seperate_neurons import watershed_neurons, separate_neuron
from PostProcessing.combine import segs_results, unique_neurons2_simp, group_neuro... |
97c24ca964601d862f25bf38da63c6095980a3c3e7ff41b4e6f960e411fe0bb3 | Python | 29,856 | 589 | #!/usr/bin/env python
# coding: utf-8
# # SCRIPT: FMRI-DECODING IN CUE REPLAY TASK
# # PROJECT: FMRIREPLAY
# # WRITTEN BY QI HUANG 2022
# # REFERENCED TO LENNART WITTKUHN, NICOLAS SCHUCK, 2021
# # CONTACT: STATE KEY LABORATORY OF COGNITIVE NEUROSCIENCE AND LEARNING, BEIJING NORMAL UNIVERSITY
# In[1]: import relevant ... |
af9411fae5ee6b44ae0d57d05e1272c240b83ebc26430dd0d829543a43d7c135 | Python | 29,858 | 728 | r"""The dynamics engine for :mod:`omicverse.mol.md`.
Three explicit stages — :func:`minimize`, :func:`equilibrate`,
:func:`production` — plus :func:`simulate`, the one-call orchestration that
covers the common case.
"""
from __future__ import annotations
import os
from typing import Any, Dict, Optional
from ..._reg... |
778d13c06655b3d780f2a38f63acd1a06034c390ded68d55cf22c92987e746ed | Python | 29,903 | 715 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
"""
Resolve clustered records into a complex SV
"""
import numpy as np
import pybedtools as pbt
import svtk.utils as svu
from .cpx_inv import classify_complex_inversion
from .cpx_tloc import classify_simple_translocation, classify_insertion
class ComplexSV:
def __... |
5d6b219b19009fd928a2fe45c32b405a4548df0004f38f5927e895b21b353baf | Python | 29,904 | 826 | # 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, ... |
9febc36d8593bea8b6e47a4a70e768afb6b50452d41dfb870de6b9057e5c8687 | Python | 29,924 | 848 | import numpy as np
import pytest
import nir
from tests import mock_affine, mock_delay, mock_integrator, mock_linear, mock_output
def test_has_version():
assert hasattr(nir, "version")
assert hasattr(nir, "__version__")
def test_has_NIRNode():
assert hasattr(nir, "NIRNode")
def test_input_output_type_... |
3d07dce6a1e4da519bf653f0c7683081220b529fbc8d4df50d8d7c58cf5e35ef | Python | 29,929 | 719 | '''
process_inputs.py
Purpose: Prepares preprocessed data files to serve as inputs to the main model
Usage: python ./process_inputs.py [-c <str>] [-k <int>]
Arguments:
'-c', '--cell_line', default='E116', type=str
'-k', '--num_neighbors', default=10, type=int)
Preprocessed input files:
I... |
33da2efac64170d06981015ad10eb1daa9e35dbbf37585137d58997e0aecb28d | Python | 29,934 | 816 | import numpy
import random
import math
from matplotlib import pyplot
from skimage import draw, measure, io
from scipy import spatial
from tqdm import trange
from pysted import _draw
TIMESTEP = 1
class Nodes:
"""
A ``Nodes`` object is responsible to interact with a list of nodes and apply
different force... |
ba506ec6f0e49e10fc75465925fa98998b8840de29e596b85678404a493ff2a4 | Python | 29,934 | 820 | import collections
import itertools
import random
import numpy as np
import torch
import torch.nn.functional as F
import pfrl
from pfrl import agent
from pfrl.utils.batch_states import batch_states
from pfrl.utils.mode_of_distribution import mode_of_distribution
from pfrl.utils.recurrent import (
concatenate_recu... |
4b048c23733c34e06a5de46ddcd38c5a55ac635144f3867ce68104bf46804a09 | Python | 29,937 | 692 | import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from sklearn import linear_model
import networkx as nx
import seaborn as sns
import pandas as pd
from sklearn import decomposition as skldec
from typing import Optional, Any, Dict, List, Tuple
from ..utils import plot_text_set
from .._registry impo... |
641d1799f36311d024de67a64875720fd033dd569024c3638adb5eb5a2520a63 | Python | 29,986 | 805 | ####################################################################################################
# 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... |
b1d021f2df6582c6602bce97ffde49e9e1e046a286a75b09a59dca53be6e2db0 | Python | 29,994 | 703 | import torch
import torch.nn as nn
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):
super().__i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.