sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
56401d56036a87062af2ff2cfa60ac31855a969931e79447b64d24174339654a
Python
78,600
2,220
# Copyright 2001-2019 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
4d5f565d5853e7bf55d9e7c3a2a7952fcfdc2987e8032b88639929e8bf202c45
Python
78,612
2,284
# Copyright 2017 Google LLC. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # #...
3bf2b0bb840f4ebaaa0a0815d820d51f4d96e3aa55eb056edf4c4f219afc9ca2
Python
78,661
2,146
"""Read/write support for Maildir, mbox, MH, Babyl, and MMDF mailboxes.""" # Notes for authors of new mailbox subclasses: # # Remember to fsync() changes to disk before closing a modified file # or returning from a flush() method. See functions _sync_flush() and # _sync_close(). import os import time import calendar...
6d190e855b5a2173a74f2a8da1f76d1486416ab0b962465e3bddfdb16dbec3c5
Python
78,670
2,204
# Copyright 2017 Google LLC. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # #...
6457893f0d08f9448c17168de2166f4986126343d27f1dd4a9e4458090f65f5a
Python
78,685
2,055
""" TIFF overlay generation for detection, pairing, and tracking. Creates multi-channel TIFF stacks with original data and overlays for quality control and visualization. """ from __future__ import annotations from pathlib import Path from typing import Optional, List, Tuple, Dict import warnings import numpy as np...
00e2b719add427557c8b00b817c14a7d5b8dde7f6d914d96852e9a8fa8168874
Python
78,689
1,973
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import abc import logging import os import warnings from collections.abc import Callable import numpy as np import torch import torch.nn as nn from torch._prims_common import DeviceLikeType from tqdm import tqdm from .sde_lib import SDE, _broadc...
6e763574daac72927d478cb6c288d0921b6937a05663370c95648a69899db7d6
Python
78,782
1,769
__author__ = 'Carlos Ventura' __email__ = ['carlosventura@stonybrook.edu'] #!/usr/bin/python import os import subprocess import shutil import glob import sys import ast from pathlib import Path import importlib import gzip import pickle import logging current_dir = Path(__file__).resolve().parent package_dir = curre...
e695a76d936f009d926e50eae09e34e1256ceee86ffb5b5825748e98f9080036
Python
78,794
2,151
"""Read/write support for Maildir, mbox, MH, Babyl, and MMDF mailboxes.""" # Notes for authors of new mailbox subclasses: # # Remember to fsync() changes to disk before closing a modified file # or returning from a flush() method. See functions _sync_flush() and # _sync_close(). import os import time import calendar...
fe2df8b4092506850959468d347601fe867d43aef0f617e70e87cb942441410e
Python
78,958
1,999
"""Various cluster quality metrics. Some of then come from or the old implementation: * https://github.com/AllenInstitute/ecephys_spike_sorting/tree/master/ecephys_spike_sorting/modules/quality_metrics * https://github.com/SpikeInterface/spikemetrics Implementations here have been refactored to support the multi-segm...
06191ecf6a60f3532df4190fb7dd181059ddbc83a5356b58bd510044821b454e
Python
79,070
2,224
# -*- coding: utf-8 -*- """This module defines functions for signature dynamics (SignDy), analyzing normal modes obtained for conformations in an ensemble.""" import time from numbers import Integral from numpy import ndarray import numpy as np import warnings from prody import LOGGER, SETTINGS from prody.utilities ...
b55833e467eff207122dd43b17d6f13bc4d284558a9acc8ee9ef5da11ef682d1
Python
79,354
2,019
# Mancy Chen 29/01/2025 ######################################################################################################################## # Visualize Schaefer atlas import sys sys.path.append('/.../miniconda3/lib/python3.10/site-packages') # Import necessary libraries from nilearn import datasets, plotting, i...
14f7b204d739be08ffb9d7b49f95242cd483c167fae15fc0823cc105e310e178
Python
79,760
2,288
""" Test the parallel module. """ # Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Copyright (c) 2010-2011 Gael Varoquaux # License: BSD Style, 3 clauses. import mmap import os import re import sys import threading import time import warnings import weakref from contextlib import nullcontext from...
4af1cb70c313e0caf1f30a1d8fce8aa3b5c96b9396c0a118b8ddd066be1917f3
Python
79,801
2,377
from tkinter import * from tkinter import ttk from matplotlib.figure import Figure from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg import numpy as np from matplotlib import rcParams import os import pickle def precalculate_all_acgs( clus_info, param, save_path=None, bin_size=0.001, max_lag=0.05 ):...
03eec53cff45fe43d2f8af6754a4542db609202c27605b4548b55d9cb3e2fd86
Python
79,836
2,012
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. # pyre-strict import typing import warnings from typing import ( Any, Callable, cast, Dict, ...
fb4466bab237d5780068ddb45828b4ceb72ea1ab7dd27340ef4ffac86971d8f5
Python
79,875
2,420
# Copyright 2007 Google Inc. # Licensed to PSF under a Contributor Agreement. """A fast, lightweight IPv4/IPv6 manipulation library in Python. This library is used to create/poke/manipulate IPv4 and IPv6 addresses and networks. """ from __future__ import unicode_literals import itertools import struct __version...
0d36e136eabdfec486d46449999e8d711b1d2478334917c01fcc6a06ce835624
Python
79,983
1,449
import pandas as pd import numpy as np from matplotlib import cm import matplotlib as mpl import config import theories_rois from pathlib import Path import matplotlib.pyplot as plt from general_utilities import load_fsaverage_coord from matplotlib import font_manager import os selectivity_colors = { "face": [1, 1...
b91e94a7f783c397bb1f49aff7e77ed11ef900ae2cdd5fa9f9336bdac16009bf
Python
80,023
1,540
"""program "PAW_protein_grouper.py" Produces quantitative protein and peptide results tables. This is a protein grouping step in the PAW analysis pipeline for Comet searches of large data sets where spectral count or TMT quantitation is being performed. The program combines similar proteins into "families" (homology g...
56b4f0170836e7706d39e59993fd1aa91357d6a18c9a0326086f12a77c9d0648
Python
80,158
1,636
import copy import logging from functools import partial from typing import (TYPE_CHECKING, Any, Callable, Dict, List, Optional, Sequence, Tuple, Union) import numpy as np import pandas as pd import shap import shap.utils._legacy as shap_utils from scipy import sparse from scipy.special import expi...
30163ab69d3836d3bc3dfdca6bc73d8d89ed6784ef1e87e796591fd46af19bb2
Python
80,557
1,714
from __future__ import annotations from re import T """class_unet_fan_nosplit.py – Training UNet on fan-label maps (angle units) with the same nosplit dataset strategy as grid version. """ import os import random import json import shutil import argparse from collections import Counter, defaultdict from typing import ...
63bde22975010462d974706e451c2f6b517a0772b7f27f475316f65e76994abd
Python
80,695
2,104
#!/usr/bin/env python """ gui/localize ~~~~~~~~~~~~~~~~~~~~ Graphical user interface for localizing single molecules :authors: Joerg Schnitzbauer, Maximilian Thomas Strauss, 2015-2019 :copyright: Copyright (c) 2015-2019 Jungmann Lab, MPI of Biochemistry """ import os.path import sys import yaml f...
a64d8807ccc36ae62cdfa8e86d536202defb82ad542993532061e1e7d0af9991
Python
80,717
1,900
# Documentation style guide: ## - Class init docstrings should be in the class definition docstring. ## - Use a style guide similar to Google's Python style guide except that argument definitions should start on a new indented line after the argument name. ## - If there is more than one argument, use multiple lines for...
40f0558f0974d467ed24df802ca7d7a8db20e2d1b7b5bdc1bae3046b28786c40
Python
80,873
2,174
import math import os import numpy as np import pytest from absl.testing import parameterized from keras.src import backend from keras.src import constraints from keras.src import export from keras.src import layers from keras.src import models from keras.src import ops from keras.src import optimizers from keras.src...
d649519f4ec66872cd58369c84d1c680ed03be4992ab3b33157d69fbb7b44294
Python
80,899
1,868
import functools import importlib import inspect import json import logging import math import threading from contextvars import ContextVar, copy_context from dataclasses import asdict, dataclass, fields from enum import Enum from typing import Any, Callable, ClassVar, Literal, TypeAlias, TypeVar, overload from pydant...
4ba7bf1e009ae818bb71af40097338d9a074a28819a2cea5191bdb965b2eda62
Python
80,974
1,560
import ctypes import sys from abc import ABC, abstractmethod # abstract class import torch import torch.nn as nn import numpy as np import os from deprecated import deprecated import ailoc.common class VectorPSF(ABC): """ Abstract base class for vector psf simulators """ @abstractmethod def sim...
06a8d3eca34069d7342afc45e4fd49a63e737c905e7e1540345b90cd0a2665cf
Python
81,128
1,929
from __future__ import annotations import argparse import csv import gzip import json import math import re from dataclasses import dataclass from pathlib import Path from statistics import mean, median from typing import Any, Callable import matplotlib import numpy as np from scipy import signal as sp_signal matplo...
3ffd8e26deac4ba3d6117eeb0bf7227d65abd90e1bfc5df0fe7732df3cd7790e
Python
81,167
1,800
"""Provide JIDT estimators.""" from pkg_resources import resource_filename import numpy as np from abc import abstractmethod from idtxl.estimator import Estimator from . import idtxl_exceptions as ex from . import idtxl_utils as utils try: import jpype as jp except ImportError as err: ex.package_missing(err, 'J...
185096bb24ce355bb7b1bf9f9c9e60a37ebb6a0a2b3904158750077624da9302
Python
81,181
2,141
# Version: 0.22 """The Versioneer - like a rocketeer, but for versions. The Versioneer ============== * like a rocketeer, but for versions! * https://github.com/python-versioneer/python-versioneer * Brian Warner * License: Public Domain * Compatible with: Python 3.6, 3.7, 3.8, 3.9, 3.10 and pypy3 * [![Latest Versio...
3068f9759a091c34289cfdffbc4a869e672c2311bc028890b9e5c54a5e561b7a
Python
81,237
1,811
import inspect import json import keyword import logging import os import pathlib import signal import urllib.parse from abc import ABCMeta, abstractmethod from contextlib import contextmanager, nullcontext from dataclasses import dataclass from inspect import Parameter, Signature from types import FunctionType from ty...
93e0d80d0cf47f2e062ecf1d7a91e8f2624597d2943d1c5c395dddea1507fe7c
Python
81,271
1,624
"""The gallery-tier suite: one case per expectation in the gallery, which every member proves. This module builds the suite's collection-time parameterization -- the (case, data source) product that turns the declarative case table in `gallery_expectation_case_table.py` into parametrized test items -- and the measurem...
042cd3e8619ff0cb1aa6581c343bf97c058f046bd7dc05211b1e14d4740e0bbf
Python
81,352
1,879
"""The ants module provides basic functions for interfacing with ants functions. """ import os from ...utils.filemanip import ensure_list from ..base import TraitedSpec, File, Str, traits, InputMultiPath, isdefined, Tuple from .base import ANTSCommand, ANTSCommandInputSpec, LOCAL_DEFAULT_NUMBER_OF_THREADS class ANT...
6a52384509da439408f87bbbeb0aa35caf269ac431742b0740372481207cafe7
Python
81,479
2,035
# Author: Nicolas Legrand <nicolas.legrand@cas.au.dk> # Author: Aleksandrs Baskakovs <aleks@cas.au.dk> """Vectorised belief propagation step for deep predictive coding networks.""" from __future__ import annotations import dataclasses from typing import Optional import equinox as eqx import jax import jax.numpy as ...
549a50dd19e7336bd89ed2ac11ea7351ffb0f1b0f61048f2c62acfbc0c3d7cce
Python
81,571
2,005
''' 'Mag' usually refers to the magnetic resin that contains magnetic and fluorescent particles of different wavelengths ''' ######################################################### ### Start of config example for NikonPeter microscope ### ######################################################### mic = 'NikonPeter' mi...
41ae017646e071539a5454ae6292bcafc129f172270ad7351672483023f68369
Python
81,985
2,378
# Copyright 2017 Google LLC. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # #...
16983b1e732657cbaffd49e46b25a9762c9706c404128c73f8fb34f9059dfb34
Python
82,126
1,727
""" This file regroups several custom keras layers used in the generation model: - RandomSpatialDeformation, - RandomCrop, - RandomFlip, - SampleConditionalGMM, - SampleResolution, - GaussianBlur, - DynamicGaussianBlur, - MimicAcquisition, - BiasFieldCorruption, - IntensityAugmen...
a0180a708c318f20938fd9c3a76b9e3cb01590da485358eeffc87d1f85305230
Python
82,145
1,643
# -*- coding: utf-8 -*- ''' Class to extract sequences from neural firing and calculate relevant variables Use: (1) call init with Spikes, position, and method to generate Sequences object (2) call init with name to load object for further processing ''' # standard libraries from os.path import exists, getsize...
189452d5618e833eb205a5222b3b905c6742dfb2d64ee656a6eeee52f3ce18de
Python
82,327
1,931
from __future__ import annotations import argparse import csv import json import math from dataclasses import dataclass from pathlib import Path from typing import Any import mne import numpy as np import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt from eeg_units import ensure_eeg_data_in_volts ...
00dc0dc4b1e941c555756b0958cb185fc1020412c2e883eed6fdbbe193843ffa
Python
82,442
1,878
# -*- coding: utf-8 -*- """The ants module provides basic functions for interfacing with ants functions. """ import os from ...utils.filemanip import ensure_list from ..base import TraitedSpec, File, Str, traits, InputMultiPath, isdefined from .base import ANTSCommand, ANTSCommandInputSpec, LOCAL_DEFAULT_NUMBER_OF_...
4043d6eadc7c4ac1a9cae8e32a4045ca2261051b0e372b94de2a31da3d715262
Python
82,464
1,829
""" Topic Model References ---------- Blei, David M., Andrew Y. Ng, and Michael I. Jordan. "Latent Dirichlet Allocation." Journal of Machine Learning Research 3 (2003): 993–1022. Griffiths, Thomas L., and Mark Steyvers. "Finding Scientific Topics." Proceedings of the National Academy of Sciences 101 (2004): 5228–5235....
17b27a457f1120705240654868ff36d377c9ffb508e62ca9ed9b0800275aaece
Python
82,563
1,943
"""This file and its contents are licensed under the Apache License 2.0. Please see the included NOTICE for copyright information and LICENSE for a copy of the license.""" import json import logging from typing import Any, Mapping, Optional from annoying.fields import AutoOneToOneField from core.current_request impor...
71adc65b2ac0e19a3372bb54cfa7266457bc965b5d7189bee378e93eb0c47b90
Python
82,603
2,045
"""Functions for creation of an HTML report that plots and explains output.""" import datetime import logging import os import shutil import subprocess import warnings from typing import Any, Dict import matplotlib.pyplot as plt import numpy as np import scipy.sparse as sp import scipy.stats import torch from IPython...
d2f73c7128a3931f74411b46352146ba85322a8dc8f12a721d4801dc43d9766e
Python
82,644
2,080
# subprocess - Subprocesses with accessible I/O streams # # For more information about this module, see PEP 324. # # Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se> # # Licensed to PSF under a Contributor Agreement. # See http://www.python.org/2.4/license for licensing details. r"""Subprocesses with ...
99732cf0d6ac2d74ba38eb8d589cb7325807919c741d2b71235d6e64dcb07822
Python
82,796
1,803
__author__ = "Simon Nilsson; sronilsson@gmail.com" from typing import List, Optional, Tuple import numpy as np from numba import float32, float64, int64, jit, njit, prange, typed, types from simba.utils.checks import check_float, check_valid_array from simba.utils.data import get_mode from simba.utils.enums import F...
61fc1c5e8f36e03e0e833efbccdeaaa4945c6d5281e9f452ab2c3aa209f43c21
Python
82,868
2,344
"""Tests for the fn-14 non-LD filtering trail.""" from __future__ import annotations import itertools import logging import operator import warnings from collections.abc import Callable from functools import reduce from pathlib import Path from typing import Any import numpy as np import pandas as pd import pytest ...
2b894402921b38a2a1ee4cc52447816358b13b95f99fa61dca16804472989657
Python
82,977
2,433
# -*- coding: utf-8 -*- r"""This module defines a class for selecting subsets of atoms. You can read this page in interactive sessions using ``help(select)``. ProDy offers a fast and powerful atom selection class, :class:`.Select`. Selection features, grammar, and keywords are similar to those of VMD. Small differenc...
ae98f73d60de485c8e5b339e9fb0438ebb926e0d8b4ee2a5beeda4b9c23d3adc
Python
83,493
1,788
from mimetypes import init import torch import torch.nn as nn import torch.nn.functional as F from functools import partial import math import modeling.unet from .utils import freeze, log_ftr_map_histograms, flag_pretrain, is_pretrain from timm.models.layers import DropPath, trunc_normal_ from .vision_transformer impo...
e2599958bb443d12e797c3737ed3a861325da3a8e978cb4fe9da900b483f6d64
Python
83,518
2,947
from __future__ import absolute_import, division, unicode_literals import string EOF = None E = { "null-character": "Null character in input stream, replaced with U+FFFD.", "invalid-codepoint": "Invalid codepoint in stream.", "incorrectly-placed-solidus": "Solidus (/) incorrectly ...
1b34cab0ef5502267a203a91d6d1f07665425abef4416d09f559de2ef2dfbf11
Python
83,718
1,800
# -*- coding: utf-8 -*- """ Created on Mon Feb 19 02:54:48 2024 @author: staslist """ import re import csv import unittest import numpy as np import os #import time from scipy.stats import hypergeom from datetime import datetime from numba import jit # Bi-Clustering Algorithm Code # Assume I have...
cf52484a1a512187e709e30c37fd2f5d976b35049ff775ab47c5b81c654137fd
Python
83,798
2,593
# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates # 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...
6889e659235773422a944335780fce472cc59dbdd0ccb861bf3b92d5c931ae42
Python
84,058
2,086
""" Module difflib -- helpers for computing deltas between objects. Function get_close_matches(word, possibilities, n=3, cutoff=0.6): Use SequenceMatcher to return list of the best "good enough" matches. Function context_diff(a, b): For two lists of strings, return a delta in context diff format. Function nd...
4ed5bb9a20b3e26a34a1c1e54cfec5ba296480185e56683f5190b2437b7a79f1
Python
84,200
2,155
import argparse import csv import json import math from dataclasses import dataclass from pathlib import Path from typing import Dict, List, Optional, Tuple DEFAULT_METRIC_KEYS = ( "test_loss_mean", "eval_loss_mean", "loss_mean", "accuracy_mean", "mcc_mean", "f1_mean", "roc_auc_mean", ...
2f05640f5ae64243bf33522b7a349bc23c2c54703341fe9b456bddd31769ab5e
Python
84,304
1,897
__author__ = "Simon Nilsson; sronilsson@gmail.com" import math from itertools import combinations from typing import Optional, Tuple, Union from simba.utils.printing import SimbaTimer try: from typing import Literal except: from typing_extensions import Literal import numpy as np from numba import cuda fro...
a4de88ef5361c2434c4440e9354d0238cb20b1307c4386125d31dea3ea6465d1
Python
84,346
2,096
""" Module difflib -- helpers for computing deltas between objects. Function get_close_matches(word, possibilities, n=3, cutoff=0.6): Use SequenceMatcher to return list of the best "good enough" matches. Function context_diff(a, b): For two lists of strings, return a delta in context diff format. Function nd...
9f79d3c27ee9483a43cc3358596ddf3efc30532c0b550f35523433a8b9ad90e9
Python
84,836
2,082
import base64 import datetime as dt import decimal import importlib import json import logging import os import re import shutil import sys import tempfile import uuid from contextlib import contextmanager from copy import deepcopy from pathlib import Path from typing import Any, Dict, List, Union import numpy as np i...
eee545e602db54bf0aea0c6523f4cbf55b4906dfeb57f831de4840254632c0fe
Python
84,931
2,331
""" MaxVit and CoAtNet Vision Transformer - CNN Hybrids in PyTorch This is a from-scratch implementation of both CoAtNet and MaxVit in PyTorch. 99% of the implementation was done from papers, however last minute some adjustments were made based on the (as yet unfinished?) public code release https://github.com/google...
cfe2d2e3e7f9d7d482025673e9c645f2dc2328c0844fa8a8d3959315c86d8581
Python
85,135
2,109
from __future__ import annotations import math import csv import dataclasses import sys import copy from dataclasses import dataclass, field from typing import List, Tuple, Optional, Dict, Callable import time import numpy as np # 可选依赖:matplotlib(更稳的 backend 选择 + 交互绘图) try: import os import m...
6c991d22c15fc2c4d9fc50a25ba533c7c24b460d4edd840ce0900c91a5e3fd5e
Python
85,279
1,705
import numpy as np import utils.ipt_util as utility import torch from tqdm import tqdm from help_func import print_var_detail import time from utils.evaluation_utils import calc_nmse_tensor, calc_psnr_tensor, calc_ssim_tensor, binaryMaskIOU import copy from utils.dice_score import dice_loss, multiclass_dice_coeff, d...
68d276d539ca3eee49c76ff7d356335ba8bc7899312ea7e8110588dfde6e5f84
Python
85,341
2,290
""" Easy Install ------------ A tool for doing automatic download/extract/build of distutils-based Python packages. For detailed documentation, see the accompanying EasyInstall.txt file, or visit the `EasyInstall home page`__. __ https://setuptools.readthedocs.io/en/latest/deprecated/easy_install.html """ from glo...
5529d3ce0b8fa3e8db793b834434ee2ff16b2b61df3c21b9403706c7a205c99a
Python
85,405
1,873
from pathlib import Path from typing import List, Optional, Literal, Dict, BinaryIO import sys import warnings import importlib.util import numpy as np from spikeinterface import get_global_tmp_folder from spikeinterface.core import BaseRecording, BaseRecordingSegment, BaseSorting, BaseSortingSegment from spikeinterf...
a76fb695e0e96d03b6434b1bf317f777bb88370b561cc81c85b21b0ebe9631b8
Python
85,673
1,862
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Probe designer GUI @author: amandaschott """ import sys import os import re import numpy as np import pandas as pd import seaborn as sns import matplotlib from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.backends.backend...
ef63fa19da93442119677c4489a6c0dfc425e2c64873ad9a25b7b35c93ca235f
Python
85,727
1,349
# ───── Version and SCRIPT_VERSION ─────────────────────────────────────────── SCRIPT_VERSION = "1.4.3" # Incremented version # CHANGELOG removed as per user request import logging from pathlib import Path import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import os import tor...
ff26c105cad52c03d6d47565299bea7f9a2a5e88600bd25dea2d66a2a8acede8
Python
85,786
2,245
""" Bring-Your-Own-Blocks Network A flexible network w/ dataclass based config for stacking those NN blocks. This model is currently used to implement the following networks: GPU Efficient (ResNets) - gernet_l/m/s (original versions called genet, but this was already used (by SENet author)). Paper: `Neural Architect...
c7b9fc2034e12474ca864be98543aae3dcbf2f6667ddb73a9453f19ff4dbe017
Python
85,792
2,275
"""Functions related to the plotting of the e-models.""" """ Copyright 2023-2024 Blue Brain Project / EPFL 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/LICENS...
5ef6f4faa9b82b3c627a0476778963b9bc332260685a59bba37101c9f441e449
Python
86,292
2,421
import os import sys import re import pprint from typing import Optional, Dict, List import yaml import napari from napari.layers import Labels from napari.layers import Labels, Image from napari.types import LayerDataTuple from napari.viewer import Viewer from magicgui import magicgui from pathlib import Path impor...
17034d5081f864ea0347cc74ee6d0dbd199491b041d5f8c886150545e04e8f1d
Python
86,449
2,023
#!/usr/bin/env python3 """ ═══════════════════════════════════════════════════════════════════════════════ MS3 SIGMA DIVERGENCE DEFINITIVE PIPELINE — Google Colab (12GB RAM) ═══════════════════════════════════════════════════════════════════════════════ MANUSCRIPT: "Sigma-1 and Sigma-2 Receptors Exhibit Divergent Geno...
0ae13da21bbccd38a90bd81da5549f64e8238e9fcacc8701ce78d5d188fc5f7d
Python
86,507
1,795
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ HEPPy Streamlit UI """ from __future__ import annotations from pathlib import Path from types import SimpleNamespace import json import re import numpy as np import pandas as pd import matplotlib.pyplot as plt import streamlit as st import mne import neurokit2 as nk ...
eb179de8356ee9945fae1fa744c93eaf1dd8cf1fd49e4b021300c312e5888763
Python
86,535
2,275
""" picasso.simulate-gui ~~~~~~~~~~~~~~~~ GUI for Simulate : Simulate single molcule fluorescence data :author: Maximilian Thomas Strauss, 2016 :copyright: Copyright (c) 2016 Jungmann Lab, MPI of Biochemistry """ import csv import glob as _glob import os import sys import time import importli...
e131787e6d88f2a6c9e268394d381e0d407ceea42c5fa5e5a7fe9426146ed708
Python
86,813
1,565
import os import re import logging import random import pickle as pkl import time import tracemalloc import torch import pandas as pd from sklearn.preprocessing import MinMaxScaler, StandardScaler from sklearn.model_selection import KFold from sklearn.linear_model import Lasso, LinearRegression import numpy as np from...
4f577fdee4052eeafaa8dacdb448a2455ce57840af1c17bd7adafba37226aaec
Python
86,924
2,339
""" Easy Install ------------ A tool for doing automatic download/extract/build of distutils-based Python packages. For detailed documentation, see the accompanying EasyInstall.txt file, or visit the `EasyInstall home page`__. __ https://setuptools.readthedocs.io/en/latest/easy_install.html """ from glob import gl...
f9d35af2458b77b3647749dafa0b8158bbed122daf6d63c3be933ff6905aad01
Python
87,100
2,771
from pathlib import Path import os import sys from zipfile import ZipFile import tarfile from collections import namedtuple import time import re import warnings from json import loads, dumps from io import StringIO from itertools import zip_longest from collections.abc import Iterable import numpy as np import pandas...
df6e2da67a3394a47ed57cfbd44298109d26f71ea22948a8840b6b56b0f6189d
Python
87,278
2,428
""" Read and write ZIP files. XXX references to utf-8 need further investigation. """ import binascii import importlib.util import io import itertools import os import posixpath import shutil import stat import struct import sys import threading import time import contextlib try: import zlib # We may need its com...
168f05e8c73b02149915d353ed366b473704d752f99b3c28b5ac0980f22fd37b
Python
87,608
2,026
""" This package (`biapy.models`) is responsible for building and managing deep learning models within the BiaPy framework. It provides functionalities to: 1. **Dynamically build models**: Select and instantiate various neural network architectures (e.g., U-Net, ResUNet, ViT, ConvNeXt variants, etc.) based on co...
128296054c9f506907bfb4336ddf9837397dcb71e047dfffd5323d06687922d2
Python
87,657
2,354
""" Easy Install ------------ A tool for doing automatic download/extract/build of distutils-based Python packages. For detailed documentation, see the accompanying EasyInstall.txt file, or visit the `EasyInstall home page`__. __ https://setuptools.readthedocs.io/en/latest/easy_install.html """ from glob import gl...
9586dffd04fb9b7f2df7bdd98dd033a6898c84c334752cfa4d8657a2231f56fe
Python
87,719
1,943
import torch import torch.nn as nn import torch.nn.functional as F import torch # import os import pandas as pd import numpy as np # import json from fastNLP.core.metrics import MetricBase,seq_len_to_mask from fastNLP.core.losses import LossBase from preprocess import NPPeptidePipe,PPeptidePipe from torch.nn import Cos...
ac29ed5e746df106226580ea460fb7345b34153637e868dfb6a7ab66e09cd17b
Python
87,728
2,441
""" Read and write ZIP files. XXX references to utf-8 need further investigation. """ import binascii import functools import importlib.util import io import itertools import os import posixpath import shutil import stat import struct import sys import threading import time import contextlib try: import zlib # We...
431586528ca1a069cd96a960f10c424a82bedb1a7eacd3c239e9165611a2e44f
Python
87,898
2,101
""" Helpers for embarrassingly parallel code. """ # Author: Gael Varoquaux < gael dot varoquaux at normalesup dot org > # Copyright: 2010, Gael Varoquaux # License: BSD 3 clause from __future__ import division import collections import functools import itertools import os import queue import sys import threading impo...
a533ccd0627fd3164523ea63dcc5e86f05e0717e20c3d260f178b8134f22e702
Python
87,923
1,945
import torch import torch.nn as nn import torch.nn.functional as F import torch # import os import pandas as pd import numpy as np # import json from fastNLP.core.metrics import MetricBase,seq_len_to_mask from fastNLP.core.losses import LossBase from preprocess import NPPeptidePipe,PPeptidePipe from torch.nn import Cos...
de58b977b2627a813eb42ad29766b55e7526e288ed80e51edfe33a5f000c7af2
Python
87,959
1,980
""" Base data generator for paired image and mask data in BiaPy. This module provides the PairBaseDataGenerator class, which supports flexible data loading, augmentation, and normalization for deep learning workflows. It includes a wide range of augmentation options for both 2D and 3D data, and is designed to work wit...
02cf704e95bc28eefcd960574754e2ec8b8dea972342bf82c272203270797a2c
Python
88,125
2,106
""" Helpers for embarrassingly parallel code. """ # Author: Gael Varoquaux < gael dot varoquaux at normalesup dot org > # Copyright: 2010, Gael Varoquaux # License: BSD 3 clause from __future__ import division import collections import functools import itertools import os import queue import sys import threading impo...
61790d91c7b7ff8ab454d405abd52d989e852bae24443a5758fcdf04730b7630
Python
88,248
2,836
# -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """The fsl module provides classes for interfacing with the `FSL <http://www.fmrib.ox.ac.uk/fsl/index.html>`_ command line tools. This was written to work with FSL version 4.1.4. E...
05c2c329698f60b68eb213670b88c112b0a18be97a7d61b9835c54d18e3617d2
Python
88,287
2,520
"""Concrete date/time and related types. See http://www.iana.org/time-zones/repository/tz-link.html for time zone and DST data sources. """ import time as _time import math as _math import sys def _cmp(x, y): return 0 if x == y else 1 if x > y else -1 MINYEAR = 1 MAXYEAR = 9999 _MAXORDINAL = 3652059 # date.max...
2cec3f91b5453e33735b000011a890ec5a229e8bae4e1919d1adfd3ce1da79d7
Python
88,317
1,927
# doing simple morpghological operations might be easier than WEKA ... # What do I want exactly ? # approximate locations are ok # CCs are ok, simply need to fine tune a bit more # make a double CC on the two channels, and use a weight a.BF + (1-a).Fluo # --preprocess correctly at the beginning # --blend the ...
240e5561ed02a609626e8026936e65c5ff7cae53051d31020e5936b962b8f9a0
Python
88,378
2,324
# -*- coding: utf-8 -*- """ functions.py - Miscellaneous functions with no other home Copyright 2010 Luke Campagnola Distributed under MIT/X11 license. See license.txt for more infomation. """ from __future__ import division import warnings import numpy as np import decimal, re import ctypes import sys, struct from ...
76bbb5d5885fe8db5d23011da8d31923c2fea251f4783a26b9c0d5f19d5ccf9d
Python
88,393
1,935
#!/usr/bin/env python # -*- coding: utf-8 -*- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # mitoMutantAccTimes #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ Here we read the synthetic data generated by replViaTranscription.jar ...
78c734b4ba10f6f3f0f73024151d87592f5f82eb65ce19282454dce7052c53e3
Python
88,425
1,617
import os import shelve import numpy as np import prody as pr import pandas as pd from tqdm import tqdm from typing import Tuple, Dict, Optional, List from collections import defaultdict from sklearn.model_selection import train_test_split import torch from torch_cluster import knn_graph, radius_graph from torch_scatt...
13904f0c7492a0edf24bcab33e8094b73ef9c574459360181856d4ab943b8529
Python
88,498
2,235
"""Layer is an Operation with state. Takes care of: - Weights / variables (and tracking thereof) - deferred build - trainable argument value inference - masking - autocasting And some more magic: - add_loss - metric tracking - RNG seed tracking - activity regularization """ import collections import functools impo...
bb09d32c38d948f93967b6ef022ec81a69d9c81ae9610c38e0c8de04bee8ad09
Python
88,887
2,514
""" picasso/rotation ~~~~~~~~~~~~~~~~~~~~ Rotation window classes and functions. Extension of Picasso: Render to visualize 3D data. Many functions are copied from gui.render.View to avoid circular import :author: Rafal Kowalewski, 2021-2022 :copyright: Copyright (c) 2021 Jungmann Lab, MPI ...
cc0da8c335b5059a5c072c729b7a684be1b67307473569d6777ec849802e7845
Python
88,985
1,652
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. # pyre-strict import threading import warnings from collections import defaultdict from typing import ( A...
0b7d2c2b8258a5d6d6aa430a48501de8dfae03da1db9dc89dec75863f1161d74
Python
89,093
1,946
import sys import os import math import torch import numpy as np import logging from time import time from argparse import ArgumentParser, SUPPRESS from threading import Thread from math import log, e from collections import namedtuple from clair3.task.gt21 import ( GT21_Type, gt21_enum_from_label, HOMO_SNP_GT...
8d50a3a6920ae7ed0a835140974315aeae3e0a495bd24f644e3feceee1b53233
Python
89,150
2,555
"""Concrete date/time and related types. See http://www.iana.org/time-zones/repository/tz-link.html for time zone and DST data sources. """ __all__ = ("date", "datetime", "time", "timedelta", "timezone", "tzinfo", "MINYEAR", "MAXYEAR") import time as _time import math as _math import sys def _cmp(x, y):...
80f6146141f45eb3bd503922dcb1ee7d51f678835fab36e741393bd92663137f
Python
89,229
2,741
#!/usr/bin/env python3 # 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 dataclasses import dataclass, field from typing import Any, Dict, List, Optional from hydra.core.config_store im...
ccb93da19a85fa2c59132f6588983c52b8cd54b6f7071adf02396dfefccbc4d6
Python
89,440
2,068
# Author: Nicolas Legrand <nicolas.legrand@cas.au.dk> # Author: Aleksandrs Baskakovs <aleks@cas.au.dk> """Vectorised deep predictive coding network. This module provides a vectorised implementation of deep HGF networks that uses layer- wise matrix operations instead of per-node updates. """ from __future__ import an...
a8f9dcda037b19524a8c450f40559098675e7d1a9c26eb998edce0a4dcf8fbb6
Python
89,675
2,391
# -*- coding: utf-8 -*- """ML Coconut Fiber 1.ipynb Automatically generated by Colab. Original file is located at https://colab.research.google.com/drive/1cm1GzhRTH-QRb4NhIyNmJS3yfRSV-KHo # **Optimized and Explainable Machine Learning for Coconut Fiber Concrete Strength Using SHAP, PDP, and ICE** **Frequency Hi...
05377a95a4ebbc72fd7222838e24f621f4af3b1c92ad96454dde6bb4c0b54c79
Python
89,865
1,669
""" This script contains all helper function for the preprocessing pipeline authors: Alex Lepauvre and Katarina Bendtz alex.lepauvre@ae.mpg.de katarina.bendtz@tch.harvard.edu Dec 2020 """ import os from pathlib import Path import numpy as np import math import mne from mne.viz import plot_alignment, s...
b66ac2aa9ac82070dff32ff4392f4b2858f58c015c8e299ff59645e9c7939477
Python
89,934
2,912
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """The fsl module provides classes for interfacing with the `FSL <http://www.fmrib.ox.ac.uk/fsl/index.html>`_ command line tools. This was written to work with FSL version 4.1.4. Examples -------- See the...
e6a28545e38f1fc036bc91a8bedd07ba55ddfc8a6e711ad16d004dc9edcf1d02
Python
90,406
2,554
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """The fsl module provides classes for interfacing with the `FSL <http://www.fmrib.ox.ac.uk/fsl/index.html>`_ command line tools. This was written to work with FSL version 4.1.4. """ import os from glob i...
3e70661f01329a67191e6755ab9f97ed174d3958411f7bc2f4e05fe72d756672
Python
90,779
2,574
# -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """The fsl module provides classes for interfacing with the `FSL <http://www.fmrib.ox.ac.uk/fsl/index.html>`_ command line tools. This was written to work with FSL version 4.1.4. ""...
fed02494aa96b8dbd75a6ccf1334dfa2c2a7bd4949c781386944a6981ced1c3e
Python
91,111
1,868
# SPDX-License-Identifier: Apache-2.0 """ Classes to get, save and load (static or time dependent) connection matrices and sample submatrices from them authors: Michael Reimann, András Ecker last modified: 01.2022 """ import h5py import numpy as np import pandas as pd from scipy import sparse, stats from .circuit_mod...
b957d735f008150fedde725c7bf0772ea5f3e37d02bd7ded25a47cf8010d4988
Python
91,132
2,053
# coding=utf-8 # Copyright 2022 Microsoft Research and 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...
511d20d989028551b549d8d31cd0aa116b834574c0c9e4157b2a551f172fbcef
Python
91,337
1,906
# -*- coding: utf-8 -*- """ Created on Fri Apr 9 17:04:19 2021 @author: user """ import os import numpy as np import scipy as sp #from scipy import stats import pandas as pd import skimage #import subprocess #from statsmodels.stats.multitest import multipletests import gc #import sys #import h5py i...
f3e2771652245d728453d774f8c90d11278932c4c8b3e7e7fba73167ec6454e7
Python
91,363
1,749
import numpy as np import utils.ipt_util as utility import torch from tqdm import tqdm from help_func import print_var_detail import time from utils.evaluation_utils import calc_nmse_tensor, calc_psnr_tensor, calc_ssim_tensor, binaryMaskIOU import copy from utils.dice_score import dice_loss, multiclass_dice_coeff, d...