sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
90846a3be3ec95ec40630a65812c38db3d4a60ebeb9f74e2e415e68c4d6e253c
Python
29,862
763
""" NoClaMe ------- This script implements a series of metrics for node-classification. These metrics are for binary node-classification, intended to work for node-classification on molecular graphs, which usually involves a large number of relatively small graphs (<50 vertices). Implemented node-classification me...
078caf02753590c8ecf161bed0b05a38f6bbcd508f481eb4970c108dd0a291ad
Python
29,904
699
import os import numpy as np import pandas as pd import matplotlib import matplotlib.pyplot as plt import anndata as ad import scanpy as sc from scipy.io import mmwrite, mmread import seaborn as sns import scipy np.random.seed(42) # load anndata dir_path = "/home/nomura/Proj/mmvelo/experiments/SHARE-seq_hf/2023-08-0...
0586ec75e5e5c67e6ddbd86c292df4a6348716eeafb7c4520859ad0acb3a0314
Python
29,955
589
''' Created on Nov 7, 2024 @author: voodoocode ''' import numpy as np import scipy.signal import lmfit import matplotlib matplotlib.use("Qtagg") import matplotlib.pyplot as plt import pandas import skimage import csv import finnpy.file_io.data_manager as dm import finnpy.feat.cfc as cfc import finnpy.filters.frequen...
84d7d8ca1a91692de44361dff74c34805dd92b6f0272a16be5913aa2d986507f
Python
30,042
744
# Copyright (c) Facebook, Inc. and its affiliates. # pyre-unsafe import itertools import logging import numpy as np from collections import UserDict, defaultdict from dataclasses import dataclass from typing import Any, Callable, Collection, Dict, Iterable, List, Optional, Sequence, Tuple import torch from torch.util...
3f0dc374811b83ab81c4d5bf0b8d7d6afb86c683a8a67aa9d46ea5a39cacd7f5
Python
30,045
656
# Copyright (c) Facebook, Inc. and its affiliates. from .config import CfgNode as CN # NOTE: given the new config system # (https://detectron2.readthedocs.io/en/latest/tutorials/lazyconfigs.html), # we will stop adding new functionalities to default CfgNode. # ---------------------------------------------------------...
a0b507683d2bcf55dd040faa61d4e54facb8bbedb8af486f16af93891351a20f
Python
30,075
845
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import itertools import json import sys from math import sqrt from unittest import mock import gufe import mdtraj as mdt import numpy as np import pytest from numpy.testing import assert_all...
3f2a894d03743d1de032f5163ed93737b1713b50acd0edfc3a1209d6dc6f6371
Python
30,132
681
############################################################################ # Copyright (c) 2022-2026 University of Helsinki # All Rights Reserved # See file LICENSE for details. ############################################################################ import csv import os import pickle import gzip import shutil ...
bf7662be2374a0431d32af320923af523d5a1650c32044cd7cdbe831729dfd78
Python
30,223
774
# This script is part of navis (http://www.github.com/navis-org/navis). # Copyright (C) 2018 Philipp Schlegel # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
88312d23b846f21047f735af3774c740b91603d36089484825ff170e7b79d56b
Python
30,254
738
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ TST fiberphotometry vs EthoVision Activity (Supplementary Fig. 4b-g) """ import os import re import json import glob import math import warnings from collections import defaultdict import numpy as np import pandas as pd from scipy.stats import pearsonr, spearmanr, ...
8af65718dc553069883c0b9bfec3f5aecf690745c102df37427b12e59607d791
Python
30,276
623
import os import numpy as np from time import perf_counter import pyqtgraph as pg from pyqtgraph.Qt import QtWidgets from pyqtgraph.Qt import QtCore from pyqtgraph.console import ConsoleWidget from pyqtgraph.dockarea.Dock import Dock from pyqtgraph.dockarea.DockArea import DockArea from PyQt5.QtWidgets import * from Py...
4de9e61cb23ea854d7809fded7c214f3088f7539f95d0114560964313ee8df97
Python
30,281
745
#!/usr/bin/env python from __future__ import division import pandas as pd import numpy as np import os import sys import traceback import gzip import bz2 import argparse from scipy.stats import chi2 from ldscore import sumstats from ldsc import MASTHEAD, Logger, sec_to_str import time np.seterr(invalid='ignore') try: ...
6c3b61fb0d5e9e4a8cd3986e587cbedc4514de45ea087c66919f7e12b0465adb
Python
30,315
770
""" Core Image Processor for Structural Plasticity Analysis Implements the quantification algorithm described in Petsakou et al., 2015: "Circadian rhythms in Rho1 activity regulate neuronal plasticity and network hierarchy" This module provides tools to analyze 3D microscopy images of neuronal projections, qua...
9bcb853e182774dd6dfac1bb73cb46aeabd7814e46b54ade2caadd7f1f4eba12
Python
30,327
837
import os import re import sys from sklearn.model_selection import StratifiedKFold import torch import random import numpy as np import torch.nn as nn import torch.optim as optim from matplotlib import pyplot from torch.utils.data import Dataset, DataLoader from sklearn.metrics import accuracy_score,precision_score,rec...
a935efff1e0d55aae88b6abd8e0d7ccdc794840639da562466dcda5c20e9059a
Python
30,380
846
# This script is part of navis (http://www.github.com/navis-org/navis). # Copyright (C) 2018 Philipp Schlegel # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
b8fbf8cf82986b7b45e31aafbdae7dcabb3cafa934844a132d9fc3f21fdb2b3d
Python
30,391
722
# Copyright (c) Facebook, Inc. and its affiliates. import contextlib import copy import io import itertools import json import logging import numpy as np import os import pickle from collections import OrderedDict import pycocotools.mask as mask_util import torch from pycocotools.coco import COCO from pycocotools.cocoe...
e4e09bfb23adebcd206cedc1902b428468256133d3d9eef99d805c0daac57daf
Python
30,433
800
# -*- coding: utf-8 -*- """neu_efficient_binary Automatically generated by Colab. Original file is located at https://colab.research.google.com/drive/1SNwdn9MD7Ycldrwo-InD2-RFmpCLBMKT Transfer-learning EfficientNetV2B0 pipeline for binary frost vs non-frost classification, with cross-validation, error analysis, ...
d2fdcf857d0da626406095e9d8aaf3cb7974328e7c98131ceda0aff45cc68235
Python
30,497
724
import torch import torch.nn as nn import torch.optim as optim from torch_geometric.loader import DataLoader from torch_geometric.nn import DataParallel import os os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "max_split_size_mb:1024" import sys import time from tqdm import tqdm import random import numpy as np import pand...
8a1c44cb5d8ed3c04c105d2351728427b45a6d144213548df808fbcba1b39596
Python
30,577
807
"""Tests for snakemake template formatting utilities.""" from __future__ import annotations import string import hypothesis.strategies as st import more_itertools as itx import pytest from hypothesis import assume, example, given import tests.strategies as sb_st from snakebids import bids from snakebids.paths impor...
87791365f91cdf4a5887548429f1e10977507eec5ec2417c5e5ccff982fe0544
Python
30,589
777
# AUTOGENERATED! DO NOT EDIT! File to edit: 02_parsers.ipynb (unless otherwise specified). __all__ = ['CoverageBigWig', 'BedReader', 'GroupedParser', 'FastaReader', 'SpliceSiteParser'] # Cell import numpy import scipy from matplotlib import pyplot import seaborn import pandas as pd import pyfastx import pyfaidx from ...
67752f51d9701b75469e4e53dce22e96413b82f6469e2c404b585e3c6e717219
Python
30,600
632
############################################################################ # Copyright (c) 2023-2026 University of Helsinki # # All Rights Reserved # See file LICENSE for details. ############################################################################ """ 10x Genomics barcode detectors. Supports 10x Genomics v...
732713f612257ab5ce0e54c23ca6ef85a001ba835c2d199b7b4927047e089da6
Python
30,688
805
# This script is part of navis (http://www.github.com/navis-org/navis). # Copyright (C) 2018 Philipp Schlegel # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
9fbe5b5f593938053d8834a40501b28e38182eba92679081156d11a40b1f516a
Python
30,721
502
"""Stage 1: run the CNN + WideVariant filters and select candidate SNV positions. This is the only stage that runs the CNN (via ``cnn_pred.CNN_predict``). It writes ``_snv_state.npz`` (the hand-off the later stages read), the raw CNN scores ``snv_table_cnn_raw.tsv``, and ``snv_table_filtered_tmp.tsv``, which stage 2 f...
db62a866856abd47f29099d638093e6d84b0164beb39c7b1b20161e311d8a163
Python
30,790
660
#!/usr/bin/env python ''' (c) 2014 Brendan Bulik-Sullivan and Hilary Finucane LDSC is a command line tool for estimating 1. LD Score 2. heritability / partitioned heritability 3. genetic covariance / correlation ''' from __future__ import division import ldscore.ldscore as ld import ldscore.parse as ps im...
5a84daee2abb1d96bce59670894eeff7d8e9a8f1b7b0e58bd9ee9c7b83abe6b7
Python
30,850
773
#!/usr/bin/env python # # Copyright (c) 2019 10X Genomics, Inc. All rights reserved. # from __future__ import annotations import array import copy import json from collections import OrderedDict, defaultdict from typing import TYPE_CHECKING, Any import martian import numpy as np import scipy.sparse as sp_sparse impo...
9922451160d1e99bb7587d292197ac93528c4f1fa3e39bf07805f1f687eb9c78
Python
30,988
838
# This script is part of navis (http://www.github.com/navis-org/navis). # Copyright (C) 2018 Philipp Schlegel # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
2e2e29e5c325e1a4ba31e210a367600ab03e238c71cbccc5e3ec04103c2a44d2
Python
31,031
759
#utils import collections import os import tarfile import urllib import zipfile from pathlib import Path from torch.utils.data import Dataset import h5py import numpy as np import torch from taming.data.helper_types import Annotation # from torch._six import string_classes from torch.utils.data._utils.collate import np...
2718bf80a00a18bb0f6b5c98ad728ccb36404f391498d1ebb65e42eec55621d2
Python
31,069
951
############################################################################ # Copyright (c) 2022-2026 University of Helsinki # Copyright (c) 2020-2022 Saint Petersburg State University # # All Rights Reserved # See file LICENSE for details. ############################################################################ ...
8f5615b884390aef61a1855ab0b1ccaeb92dc649deafbb228808dacd599f8e60
Python
31,075
753
import sys sys.path.insert(0, '..') # for model.py import os import argparse import numpy as np import pandas as pd import matplotlib.pyplot as plt import plottools.plottools as pt from scipy.optimize import curve_fit from model import simulate, load_models from eods import plot_eod_interval_hist from baseline impor...
15a749ef3c12a203fd730033f0a0d089d31c693ea0b268e275cac9b438343134
Python
31,163
810
# -*- coding: utf-8 -*- """ Autoradiography """ import numpy as np import pandas as pd import matplotlib.pyplot as plt from matplotlib import patches import seaborn as sns from netneurotools import datasets, metrics, stats, plotting from scipy.stats import zscore, pearsonr from scipy.optimize import curve_fit from ma...
25121a5053b0089f9ea3caec72b13be82400c6bb2b817607f1a5dec659534c09
Python
31,173
873
"""Tests for the pluggable parallel backends in `navis.compute`. Two halves: the registry (which backend gets picked, and why) and the dispatch seam (chunking, ordering, failure handling). The seam is exercised through a recording dummy backend so the interesting properties - notably that results are reordered correct...
2baf91cdc083b27eb5b4d1c77cdfe67c104a9c5d41ae69ae5724e411592c05f7
Python
31,248
886
""" Training procedure """ __author__ = "Fabi Bongratz" __email__ = "fabi.bongratz@gmail.com" import os import re from copy import deepcopy import json import wandb import torch import torch.multiprocessing as mp import torch.distributed as dist import numpy as np from torch.nn.parallel import DistributedDataParall...
a2c6e6061ddec58b6175877c637a3fc1962b31ddd6fd6922ab9b08707f302cd5
Python
31,284
797
#!/usr/bin/env python # # Copyright (c) 2019 10X Genomics, Inc. All rights reserved # """Utils for summarizing and computing statistics on RNA reads and UMIs from molecule_info.""" from __future__ import annotations from collections.abc import Iterable from copy import deepcopy from typing import Any import h5py as ...
fc0e197ac19324f4ede3ed33f6f2714d1194742e5e1ed9f0d93f1ce4fa7c2eb1
Python
31,344
701
import torch import random from itertools import combinations import torch.nn as nn import torch.nn.functional as F from torch.distributions import Normal, kl_divergence as kl # Acknowledgement to scCRAFT from Chuan He (https://www.biorxiv.org/content/10.1101/2024.10.22.619682v1) def count_labels_per_gro...
c87d584f2f4af4944a99d3c631e01bb0286ea87c02ad9d9e4d2338176a389683
Python
31,539
829
""" Control Spike Sorting Pipeline - Stage 2 (Waveform Curation) ============================================================= Run AFTER reviewing PPTs from stage1_sort.py and editing curation_config.json. This stage: 1. Reads curation_config.json for rescue_ids / remove_ids 2. Selects accepted units from analyzer_raw...
f50c54b44bcbcecf5b9c861684efa159eb48ee04488066c31ee43f0cc3e856f3
Python
31,549
1,106
"""Tests for DataRecorders.""" import json import os import tempfile from pathlib import Path from unittest.mock import Mock import numpy as np import pandas as pd import pytest from mesa.agent import Agent from mesa.experimental.data_collection import ( DataRecorder, DataRegistry, DataSet, DatasetCo...
bf282a0e9c51ebf929b740dfa334d2dc9533896fb23989c0331166e04eeb5cfe
Python
31,569
824
# This script is part of navis (http://www.github.com/navis-org/navis). # Copyright (C) 2018 Philipp Schlegel # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
0a9b38dbfe2ef2643da6c4f5c6e3ee51759f00f17130e137b3b04910e08e4137
Python
31,675
1,096
""" Created on Mon Oct 30 13:59:21 2023 @author: dcupolillo """ from __future__ import annotations from pathlib import Path from typing import Union import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import Normalize from functools import cache import ROIpy as rp from spyne.core.imaging.vi...
99c8952b1bea2ac668d84dee052528c5ae862bca48f7bc7554e26f3f3d9284fd
Python
31,725
857
"""Helper functions for drawing mesa spaces with matplotlib. These functions are used by the provided matplotlib components, but can also be used to quickly visualize a space with matplotlib for example when creating a mp4 of a movie run or when needing a figure for a paper. """ import itertools import os import war...
494d26b37cdb1c04f084ca1c8f1658a03d56066b182700da141c35d96a5e55b4
Python
31,811
926
# This script is part of navis (http://www.github.com/navis-org/navis). # Copyright (C) 2018 Philipp Schlegel # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
d80cfec971e84280be857cb7597b89c2a35fe9406ecfef877320bd6376765306
Python
31,878
755
import os import numpy as np import pandas as pd import umap import matplotlib.pyplot as plt import anndata as ad import scanpy as sc import scvelo as scv import cellrank as cr import scanpy.external as sce from scipy.io import mmwrite, mmread import statsmodels.api as sm np.random.seed(42) # peak-gene linkage matrix...
29757564953cf5aa56af7c75576c7d33bff7661631f1ac706aa3926c8775f8e2
Python
32,016
711
""" Attaching Data ============== <!-- difficulty: advanced --> Carry your own data through subsetting, masking and pruning. !!! example "New in {{ navis }} 2.0" `attach` and `attach_link` are new and we are keen to hear how they hold up on real data. Please read [Caveats](#caveats) and [Antipatterns](#antipa...
ee5cb8c5974cdb8241a9fc587798f3872d22dfac7f375134003f192311311910
Python
32,045
901
# This script is part of navis (http://www.github.com/navis-org/navis). # Copyright (C) 2018 Philipp Schlegel # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
511930f1b9dbf8eb7c805492afe5de21499f38c568dbdf482dc57579b34ab1d4
Python
32,072
1,110
"""Tests for mesa_signals.""" import doctest from unittest.mock import Mock, patch import pytest from mesa import Agent, Model from mesa.experimental.mesa_signals import ( ALL, HasEmitters, ListSignals, Observable, ObservableList, ObservableSignals, SignalType, computed_property, ...
ed0f74a22e99f13576b7619c5024cebcbc38d361068423eddd0aee7b49bad57d
Python
32,078
661
############################################################################ # Copyright (c) 2024-2026 University of Helsinki # # All Rights Reserved # See file LICENSE for details. ############################################################################ import logging import math from collections import defaultdi...
ac073b3467de1ff94b1df61df94b45392f6929862de8b39ce6300f717a41aa47
Python
32,309
803
# Copyright (c) 2019 10x Genomics, Inc. All rights reserved. # Keeping the annotation import for now until PEP 563 is mandatory in a future Python version # Check: https://peps.python.org/pep-0563/ # Check: https://github.com/astral-sh/ruff/issues/7214 from __future__ import annotations import csv import sys from coll...
c716039dc7f68902d28aa68300b91bea3c8928fe7f948c464ff5d70dbc6eb880
Python
32,312
596
########################################################################### # Copyright (c) 2026 University of Helsinki # # All Rights Reserved # See file LICENSE for details. ############################################################################ import logging import math import sys from ..indexers import Arra...
f41b6c895d28a500711e6923bef1f3cf7db60c10f91c1d52f0f13e77ae2eef7f
Python
32,324
816
# /// script # requires-python = ">=3.13" # dependencies = [ # "marimo>=0.23.3", # "numpy>=2.5.1", # "pandas>=3.0.3", # "plotly>=6.9.0", # "scipy>=1.18.0", # ] # /// #local view: uv run marimo run maxLFQmo.py #server edit: animeshs@ubuntu:~/scripts$ uv run marimo edit maxLFQmo.py --host 0.0.0.0 --po...
2cfaac0610720403ad6b514067dd4b1e31b68f7d6c834db78021ddbeddb1ce32
Python
32,339
808
#!/usr/bin/env python # # Copyright (c) 2022 10X Genomics, Inc. All rights reserved. # # """Generate antigen specificity scores and antigen assignments.""" from __future__ import annotations import csv from ast import literal_eval from collections import Counter, OrderedDict, defaultdict, namedtuple from enum import E...
c52b212e8aba56d5dcd24748a25eb03cd488c5071b2aa0db6e0adcf24299a877
Python
32,346
755
# -*- coding: utf-8 -*- """ Created on Fri Jul 15 12:25:40 2016 @author: Luciano Masullo, Federico Barabas # TODO: QTHREADS ARE NOT WORKING AS THEY WERE SUPPOSED TO """ import os import time import numpy as np from scipy import ndimage as ndi import tifffile as tiff from PIL import Image import matplotlib.pyplot as ...
7a1702df64f2b46d2b7474d33dc2f2b2ce50f3f8d594dce5898193aa9e3269da
Python
32,455
814
#!/usr/bin/env python # # Copyright (c) 2019 10X Genomics, Inc. All rights reserved. # """This file shows plots in the analysis tab that aren't related to the outputs of the SC_RNA_ANALYZER pipeline. e.g. targeted UMI plots, sequencing saturation plots, etc splitting things up in this way allows turing repo to utilize...
36931cd3620933751c79a46ff072158064f18acd69418f9ccea8621537b4cf8a
Python
32,500
775
""" coregister - Image Registration for Aligning Neuroimaging Data Part of the micaflow processing pipeline for neuroimaging data. This module performs comprehensive image registration between two images using the Advanced Normalization Tools (ANTs) SyNRA algorithm, which combines rigid, affine, and symmetric normali...
08d37ad6ae8a05112d89ddd37e4e51e6b557455b93ee7d79adbea463bc3728a7
Python
32,546
888
""" Created on 10/08/2017 @author: Niklas Pallast Neuroimaging & Neuroengineering Department of Neurology University Hospital Cologne Documentation preface, added 23/05/09 by Victor Vera Frazao: This document is currently in revision for improvement and fixing. Specifically changes are made to allow compatibility of ...
59f6824c313ae584cebed0c61c9962e2802628f97c4e3c4c27a48b4cdf6bcf00
Python
32,618
837
# This script is part of navis (http://www.github.com/navis-org/navis). # Copyright (C) 2018 Philipp Schlegel # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
99bdba165dfb1e219575773d3e7568c003607ebf15ee41c314e67e3765c93897
Python
32,671
840
# This script is part of navis (http://www.github.com/navis-org/navis). # Copyright (C) 2018 Philipp Schlegel # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
dddb4d1f017e4f26ef195a7c805bf23039d18445b3785b8d8c420c7b3f969d17
Python
32,718
886
# -*- coding: utf-8 -*- """bnn_binary Automatically generated by Colab. Original file is located at https://colab.research.google.com/drive/1VUekM0LLYNzbyz9LEeoRQt6aZ7v0Htnk """ !pip install tf-keras-vis """End-to-end Bayesian CNN pipeline for frost vs non-frost image classification with MC Dropout uncertainty ...
a38217e08844d3a57405f0ad811b87374622f90d4cd9c28b321086da082054c9
Python
32,896
959
# This script is part of navis (http://www.github.com/navis-org/navis). # Copyright (C) 2018 Philipp Schlegel # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
89c785fd9adfc8355357ec62cb2da2677d39ea3d93fee5f24e4a8c5293694a61
Python
33,298
810
#utils import collections import os import tarfile import urllib import zipfile from pathlib import Path from torch.utils.data import Dataset import h5py import numpy as np import torch from taming.data.helper_types import Annotation # from torch._six import string_classes from torch.utils.data._utils.collate import np...
ffeadf0eda16f7d0347723468c9a8fe95c290818e715b482eaf436309e704c50
Python
33,319
1,118
"""Tests for Event, EventList, Schedule, and EventGenerator.""" # ruff: noqa: D101, D102 import gc import pickle from collections.abc import Callable from functools import partial from unittest.mock import MagicMock import pytest from mesa import Model from mesa.time import ( Event, EventGenerator, Event...
debcadab1d5d6ce4f50a597f3b42fffc4852baa03e44edd6b7d26606f7c9792f
Python
33,364
726
############################################################################ # Copyright (c) 2022-2026 University of Helsinki # Copyright (c) 2021-2022 Saint Petersburg State University # # All Rights Reserved # See file LICENSE for details. ############################################################################ ...
043ff43c4d4304f7259419d1bd4529445da71661b5362653ecd174bd4342c413
Python
33,409
835
# pytorch_diffusion + derived encoder decoder import math import torch import torch.nn as nn import numpy as np from einops import rearrange from ldm.util import instantiate_from_config from ldm.modules.attention import LinearAttention def get_timestep_embedding(timesteps, embedding_dim): """ This matches th...
03713fb2b1f9d673087e46679f7d1b25b28f4d216714e45c54b2f8084fa94895
Python
33,426
874
"""Hosts the GearToolkitContext class. Provides gear helper functions.""" import argparse import json import logging import os import pathlib import sys import tempfile import typing as t import warnings from pprint import pformat from shutil import rmtree try: import flywheel HAVE_FLYWHEEL = True except (Mod...
8f507fb3263b89fd3811990fa8efd11d331d0c526efd46161160dfcd221159a0
Python
33,513
863
#!/usr/bin/env python3 # # Copyright (c) 2021 10X Genomics, Inc. All rights reserved. # """Identify partitions that contain cells.""" from __future__ import annotations import dataclasses import json import math import os from collections import defaultdict from typing import TYPE_CHECKING, Any, NamedTuple import ma...
9bf53d4359ace4ac36c6d31df36189ed2060bd8fc5696546277a953d2fa8cdde
Python
33,538
850
""" If you use this code, please cite one of the SynthSeg papers: https://github.com/BBillot/SynthSeg/blob/master/bibtex.bib Copyright 2020 Benjamin Billot 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 Lice...
488aa8324cc904473fec426bea389a46a960592949a14cb8f3fda90be34b5a6b
Python
33,675
803
# This script is part of navis (http://www.github.com/navis-org/navis). # Copyright (C) 2018 Philipp Schlegel # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
c6180fe6c76b0b2892e0160a0dd1e4d1333ab4f85dfe0b48fc5bb479de4bf120
Python
33,716
769
# This script is part of navis (http://www.github.com/navis-org/navis). # Copyright (C) 2018 Philipp Schlegel # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
daa1f4a784f0cc9ab891d876ee7b3e0d169782ab844716eec836d4f50ecdd73d
Python
33,779
877
from abc import ABC, abstractmethod import types from typing import Iterable from lightning import pytorch as pl import torch from torch import Tensor from torch.utils.data import DataLoader from chemprop.conf import LIGHTNING_26_COMPAT_ARGS from chemprop.models import MPNN, MolAtomBondMPNN from chemprop.utils.regist...
9380dcf6bb5ea9146f517a59749a0c8ce387deb40af505b8b6fe94e196257c25
Python
33,818
931
"""Mesa visualization module for creating interactive model visualizations. This module provides components to create browser- and Jupyter notebook-based visualizations of Mesa models, allowing users to watch models run step-by-step and interact with model parameters. Key features: - SolaraViz: Main component for...
3a034d4f99688d26298efe0b09ebecdbab53444cbce958b518d4184a35590426
Python
33,986
976
""" Functions on PointData and CellData. """ # Author: Oualid Benkarim <oualid.benkarim@mcgill.ca> # License: BSD 3 clause import warnings import numpy as np from scipy.stats import mode from scipy.spatial import KDTree from scipy.sparse.csgraph import laplacian, connected_components from sklearn.utils.extmath imp...
8c8a66278fb7593e2685d9632124c9b30648e895173de934d544a8383190ebd1
Python
33,986
981
"""Unified k-fold cross-validation training for GNN and VAE models. Critically, regression target scaling is done **inside** the fold loop to prevent data leakage. Supports GNN models (operating on PyG graph data) and VAE models (operating on flattened molecular tensor representations). """ import copy import logging...
d9dfd29ce7789b4ce533e739a4e6fb0ba40fa4acefb27c737f0ae7ae01523a82
Python
34,037
757
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Harder Hide-the-Label Competition Framework This module implements a harder version of the hide-the-label competition that makes it more difficult for Bayesian optimizers by using non-GP models and adding various difficulty factors. Methods implemented: 1. Non-GP Typ...
c37bb500e9ddd414beff4fae76992af847a8bfeef4b1dace3a052e5fba751554
Python
34,337
603
import shutil from copy import deepcopy from typing import List, Union, Tuple import numpy as np import torch from batchgenerators.utilities.file_and_folder_operations import load_json, join, save_json, isfile, maybe_mkdir_p from dynamic_network_architectures.architectures.unet import PlainConvUNet from dynamic_networ...
3a1f95ae2dce94d7a9f58f64fa042ad2796794af7cfa31851b7c534e59caaee2
Python
34,419
786
# This script is part of navis (http://www.github.com/navis-org/navis). # Copyright (C) 2018 Philipp Schlegel # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
8858be0c8b3886d62040c63631e1fffd809395d40162f06813ba70aa5a191881
Python
34,516
935
"""Test the DataCollector.""" import unittest import warnings from functools import partial import pandas as pd import pytest from mesa import Agent, Model from mesa.datacollection import DataCollector from mesa.exceptions import TableMissingException class MockAgent(Agent): """Minimalistic agent for testing p...
73337679c5a6ee0499f2c45a3daacf11164262e732e41867e6d4a7b4902a3f23
Python
34,619
842
#!/usr/bin/env python # Copyright 2016-2023 Biomedical Imaging Group Rotterdam, Departments of # Medical Informatics and Radiology, Erasmus MC, Rotterdam, The Netherlands # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obt...
bdf22cf85cebb556aa8c0c48dfe9325fb96b6a2de55cf94358a82c48d2ee1e02
Python
34,770
910
# This script is part of navis (http://www.github.com/navis-org/navis). # Copyright (C) 2018 Philipp Schlegel # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
89a09c850f53cf2b1a9e340b627ede2ec76f9ff158b55a9c449394cae3189465
Python
34,871
884
# This script is part of navis (http://www.github.com/navis-org/navis). # Copyright (C) 2018 Philipp Schlegel # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
e1775043217736a03a104dd61c8e76a3f46985eebb8fbd349dea356d3f80722d
Python
34,877
838
#!/usr/bin/env python3 # ############################################################################ # Copyright (c) 2022-2026 University of Helsinki # Copyright (c) 2020-2022 Saint Petersburg State University # # All Rights Reserved # See file LICENSE for details. #####################################################...
92e0c23ada849f532be12d9be2ebcddd98d3b040aa366981ac5f06c96d53b6af
Python
34,953
961
from abc import abstractmethod from functools import partial import math from typing import Iterable import numpy as np import torch as th import torch.nn as nn import torch.nn.functional as F from ldm.modules.diffusionmodules.util import ( checkpoint, conv_nd, linear, avg_pool_nd, zero_module, ...
6d829bd1b98255c051c124bd2388a95dcebedf56559ce1a373549fcd9ea2293c
Python
35,119
862
""" SDC - Susceptibility Distortion Correction for Echo-Planar Imaging Part of the micaflow processing pipeline for neuroimaging data. This module corrects geometric distortions in echo-planar imaging (EPI) MRI data caused by magnetic field (B0) inhomogeneities. EPI sequences, commonly used for functional MR...
ec80a6df89038726724aeead819b0460377554a8976c0a0c1a74d3c59e4f17ac
Python
35,135
821
import pytest import logging from unittest.mock import MagicMock, patch from isoquant_lib.fusion.fusion_detector import FusionDetector, _CIGAR_CACHE logger = logging.getLogger('IsoQuant') class TestFusionDetectorInitialization: """Test FusionDetector initialization.""" @patch('isoquant_lib.fusion.fusion_det...
692ed4b532d0fa2262d5e51fc36dddb00f53287c0f15d93ad6406d617bc1c65b
Python
35,252
910
#!/usr/bin/env python # # Copyright (c) 2018 10X Genomics, Inc. All rights reserved. # from __future__ import annotations import pickle from collections.abc import Collection from copy import copy from typing import TYPE_CHECKING, TypedDict import numpy as np import pandas as pd import cellranger.molecule_counter as...
fb66a876a254277843caad6d6eeab5317b4c207de8da37567f38b820ed3b6dd1
Python
35,490
826
#!/usr/bin/env python3 """ extract_b0 - B0 Volume Extraction and Dataset Splitting Tool Part of the micaflow processing pipeline for neuroimaging data. This module extracts b=0 (non-diffusion-weighted) volumes from diffusion-weighted images (DWI) and separates them from the diffusion-weighted volumes. B0 volumes are...
3a8cb9ccf5beab1da93b5c5fa1afafbc8adc235fbe2056933f2242a710042bc6
Python
35,517
674
#!/usr/bin/env python # Copyright 2016-2021 Biomedical Imaging Group Rotterdam, Departments of # Medical Informatics and Radiology, Erasmus MC, Rotterdam, The Netherlands # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obt...
568ec74e3068fa964727b0c2f953a2b448ec62f2070172d09ab8eadef9ab1c35
Python
35,586
823
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Harder Open Race Competition Framework This module implements a harder version of the open race competition that makes it more difficult for Bayesian optimizers by using non-GP models and adding various difficulty factors. Methods implemented: 1. Non-GP Type 1 Models...
d6f161e7ebc680e917ea43bb0e120aa73b657d06f6f1714ed23d5f06460d6d91
Python
35,682
664
from __future__ import annotations import csv import json import os from pathlib import Path import queue import subprocess import sys import threading import time import traceback ROOT = Path(__file__).resolve().parents[1] APP_TITLE = "Smart Home Intent Classification Experiment Console" APP_VERSION = "3.0" def re...
a531ba6b8941921892753dba5b3ff351c728d10da43df9e3034fbe4706f8b55f
Python
35,701
945
# This script is part of navis (http://www.github.com/navis-org/navis). # Copyright (C) 2018 Philipp Schlegel # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
6e722ad5d39ff74132e72b80aab1cadebaaf575db99095ffba8d25b23ac95cc3
Python
35,827
1,068
#!/usr/bin/env python # # Copyright (c) 2016 10x Genomics, Inc. All rights reserved. # # Utilities for reading and generating Illumina Experiment Manager sample sheets # import csv import logging import re from collections import namedtuple from six import ensure_text import tenkit.pandas as pandas import tenkit.se...
4081875283f3a8362a5aaa13ad15d48a39aad7dbb918198f2dff7e0f4b99b4c4
Python
35,908
1,055
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import copy import os import sys from importlib import resources from pathlib import Path from unittest import mock import numpy as np import pooch import pytest from gufe.settings import Op...
79753fe1471887cc4d8a8b8e7ffe6da56ad33ae5dc45e343c4b0d116bcee5442
Python
35,999
1,082
"""Tests for mesa.experimental.scenarios.""" import pickle from concurrent.futures import ProcessPoolExecutor import numpy as np import pandas as pd import pytest import scipy.stats.qmc as qmc from mesa import Agent, Model from mesa.experimental.data_collection import DataRecorder from mesa.experimental.scenarios im...
1430552c048368a98c37f570de9a7c7e7ab707f21dc1bb9421c920db443d8674
Python
36,270
1,008
from __future__ import annotations import copy import functools as ft import itertools as it import operator as op import re import string import warnings from pathlib import Path from typing import Any import more_itertools as itx import pytest from hypothesis import assume, example, given from hypothesis import str...
1f38ead2a68a78eb83ec04cb184bdda0c5363f7c1c3d41c1108491a9198fcb73
Python
36,461
960
# AUTOGENERATED! DO NOT EDIT! File to edit: 06a_seq_summaries.ipynb (unless otherwise specified). __all__ = ['rbpamp_imported', 'SequenceSummarizer', 'PWM', 'PWMScorer', 'RBPampAffinityModel', 'RBPampMotifScorer', 'generate_sequence_with_all_kmers', 'MultiPWM', 'MultiPWMScorer', 'ProboundModel', 'ProBoundSc...
965fae6b56725e2c1d05b7fe9ca76ec023482a89b6849a693a4ea709767f0082
Python
36,469
747
############################################################################ # Copyright (c) 2022-2026 University of Helsinki # Copyright (c) 2020-2022 Saint Petersburg State University # # All Rights Reserved # See file LICENSE for details. ############################################################################ ...
c189eaa3ea51d375d18e394159051c3367ac8ecee149f54e92d5c136d14eba05
Python
36,520
1,010
# -*- coding: utf-8 -*- """photomicrgraphs Automatically generated by Colab. Original file is located at https://colab.research.google.com/drive/1B-m7P9u1keP7_O9S3-G-fRmOpVnUexl- # Full Photomicrograph Classification + Score‑CAM + Metrics """ import os os.environ["TF_FORCE_GPU_ALLOW_GROWTH"] = "true" import te...
ab999afc6198be9dc2b0c62e69f51a7a23ec6e0b2bedbebc5e844bcce91bc83f
Python
36,578
992
# -*- coding: utf-8 -*- """neu_cnn_multiclass Automatically generated by Colab. Original file is located at https://colab.research.google.com/drive/15HYyLD7l-r-kN99mJXIE_pRLxuyy2ria """ !pip install tf-keras-vis """End-to-end multiclass CNN pipeline for microstructure image classification, with detailed misclas...
db0697bb7f0559913806c3bac518b658bde61cd9658529a37b83c43c48720578
Python
36,861
987
# -*- coding: utf-8 -*- """neu_bnn_multiclass Automatically generated by Colab. Original file is located at https://colab.research.google.com/drive/1MJOewWobpYzWZFNhtajIpRqpjIkOd0FK """ !pip install tf-keras-vis """End-to-end multiclass Bayesian CNN pipeline for microstructure image classification with MC Dropo...
a8896167d53d3e4b807602695a9e63c5465e4f9e7ae9e47e9bddb1d31612bc66
Python
37,101
948
from argparse import ArgumentError, ArgumentParser, Namespace import json import logging from pathlib import Path import sys from typing import Iterator from lightning import pytorch as pl import numpy as np import pandas as pd import torch from chemprop import data from chemprop.callbacks import CallbackRegistry fro...
7aca6881b25469b48726c12676fc1059e9c1f3dd5576d31024af13711a0ffa66
Python
37,148
760
from copy import deepcopy from typing import Literal, Tuple, Union, List import torch from batchgenerators.utilities.file_and_folder_operations import isfile from dynamic_network_architectures.architectures.abstract_arch import AbstractDynamicNetworkArchitectures from torch._dynamo import OptimizedModule from nnunetv2...
912f079de97b6ac7c4157fce665fcccdae22523624e2ad219d8149b754ad777a
Python
37,576
1,034
import inspect import json import multiprocessing as mp import subprocess import os from helpers import (get_fmriname, get_readoutdir, get_realdwelltime, get_relpath, get_taskname, ijk_to_xyz) class ParameterSettings(object): """ Paths to files and settings required to run DCAN HCP. Cl...
e72abea05f5039e103b75c092ff82ccad6e826d59e7e2044522a82537dd75c7e
Python
37,699
877
# Copyright (c) Facebook, Inc. and its affiliates. import inspect import logging import numpy as np from typing import Dict, List, Optional, Tuple import torch from torch import nn from detectron2.config import configurable from detectron2.layers import ShapeSpec, nonzero_tuple from detectron2.structures import Boxes,...
7a08f309757c5c6ceb7023062c4a18c1aaedeb4635446d0627240dd175c233fe
Python
37,815
816
import torch import torch.nn.functional as F import pytorch_lightning as pl from main_hdf5 import instantiate_from_config import numpy as np from taming.modules.diffusionmodules.model import Encoder, Decoder, EncoderVINN, DecoderVINN from taming.modules.vqvae.quantize import VectorQuantizer2 as VectorQuantizer from ta...