sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
df7224eb8b2430786c4d2f1da9de90b9b22b648d91fcc25a69a44014cf0d9121
Python
107,784
3,043
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """Set of interfaces that allow interaction with data. Currently available interfaces are: DataSource: Generic nifti to named Nifti interface DataSink: Generic named output from interfaces to data store XN...
874041958e6c70f956d63e375628d62416a0853cf7acad5aa0640700a0a74c16
Python
108,067
2,546
from __future__ import annotations import copy import locale import logging import os import platform import random import re import string import time import traceback from decimal import Decimal from functools import partial, wraps from logging import Logger from types import ModuleType from typing import ( TYPE...
c7ce089f92c1189195c81c5c9b9d9d88c2cf40393ea19776998049d9b7c14a9b
Python
108,077
2,293
""" This script is used for path analysis of the worm trajectory. There are several visualization helper functions. """ import numpy as np from scipy.ndimage import center_of_mass import pickle import matplotlib.pyplot as plt from matplotlib.colors import LinearSegmentedColormap from scipy.spatial.distance import eucl...
e92a2afa6638e250abfe83941d0950d177480948cfde21ec2b7b967078702ff2
Python
108,118
3,021
from keras.src import backend from keras.src import ops from keras.src.api_export import keras_export from keras.src.backend import KerasTensor from keras.src.backend import any_symbolic_tensors from keras.src.ops.operation import Operation from keras.src.ops.operation_utils import compute_conv_output_shape class RGB...
0a5ca1870b3e5be151cacf0cc23a5aa61385f864173cced7cfa6abbf9579d7cf
Python
108,159
2,229
from __future__ import annotations from typing import Dict, Tuple import logging import os import pickle as pkl import random import time import warnings from neurobench.benchmarks import Benchmark from neurobench.metrics.static import ( Footprint, ConnectionSparsity, ) from neurobench.metrics.work...
3f73cd377fe6f0926b60ca7e8be4aafb7ae12b9bee562aaa8e7d545ca1df7bb4
Python
108,202
3,288
""" Package resource API -------------------- A resource is a logical file contained within a package, or a logical subdirectory thereof. The package resource API expects resource names to have their path parts separated with ``/``, *not* whatever the local path separator is. Do not use os.path operations to manipul...
5e91817ef4bd7da7c0e9b9b9af1eef9f1771b3bcaaca873f367a73280a6427ae
Python
108,277
3,296
# coding: utf-8 """ Package resource API -------------------- A resource is a logical file contained within a package, or a logical subdirectory thereof. The package resource API expects resource names to have their path parts separated with ``/``, *not* whatever the local path separator is. Do not use os.path opera...
b5eb83c4c42ae92372c2c6adf626fb53fcd89338db68f6ee5c5cab21de46bebb
Python
108,296
2,181
# Companion to plot_auc_summary.py: instead of one AUC per dataset (pooling # every across-session unit-pair together regardless of how far apart the two # sessions were recorded), bin across-session unit-pairs by signed delta-days # (date(RecSes 2) - date(RecSes 1)) and compute AUC per bin per score, # pooling across ...
1cae454e3a2011179b64e17d25145a3b621cc454aebdb24c3e1ebdf666c2438d
Python
108,392
3,067
# -*- 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: """ Set of interfaces that allow interaction with data. Currently available interfaces are: DataSource: Generic nifti to named Nifti interface DataSink: Generic named ou...
995f7431ab9b510c22088dcd4db56aeb1e78a01ae07ae91953c2db9b446c9602
Python
108,421
2,510
# -*- coding: utf-8 -*- """ Created on Thu May 2 18:55:54 2024 @author: Hiroto """ import tensorflow as tf from tensorflow.keras.layers import AbstractRNNCell from tensorflow.python.keras import backend, activations, constraints, initializers, regularizers #from tensorflow.keras.ops import ops # Clear all previou...
e381b62e42ff9576c3ce34ee90b991e5b68b42d1374b821a15c89264f0dc38cf
Python
108,481
3,302
# coding: utf-8 """ Package resource API -------------------- A resource is a logical file contained within a package, or a logical subdirectory thereof. The package resource API expects resource names to have their path parts separated with ``/``, *not* whatever the local path separator is. Do not use os.path opera...
0221edb2a5513b54f849fbff247d96cc76bf132c0dd7e31a23110f21ed24cb48
Python
108,570
3,307
# coding: utf-8 """ Package resource API -------------------- A resource is a logical file contained within a package, or a logical subdirectory thereof. The package resource API expects resource names to have their path parts separated with ``/``, *not* whatever the local path separator is. Do not use os.path opera...
9a05c077906a3997d1edf53efef58ad1c4bfa9fa72fbb2454837a1989c00b1a2
Python
108,834
3,075
from datetime import datetime from pprint import pprint from typing import Any, Callable, Dict, List, Optional, Tuple, Union import pytest from great_expectations.core import ExpectationValidationResult from great_expectations.expectations.expectation_configuration import ( ExpectationConfiguration, ) from great_...
39d94bbf9295cfca2f749351330d1f7253d7e17d46b369dd8af9ad00722dff55
Python
109,077
2,856
from typing import ( Tuple, Union, Optional, Type, TypeVar, ClassVar, Any, List, Generator, Dict, Iterable, Sequence ) from numpy import ndarray, dtype from merit.ipd.regions import GenotypeProb try: from typing import Self except ImportError: from typing_extensions import Self from abc import ( ...
2a8befddddca0cced2e86184a9b68bb3d826ff248a8e05a7c3f6ceee4aa073d8
Python
109,390
2,837
#!/usr/bin/env python3 """Generate Python documentation in HTML or text for interactive use. At the Python interactive prompt, calling help(thing) on a Python object documents the object, and calling help() starts up an interactive help session. Or, at the shell command line outside of Python: Run "pydoc <name>" to ...
ac34e1853d29305c8b80304d9dedd7f0ef29868f43ca5a6f343cca4b75898ccb
Python
109,642
3,036
"""Tests for the correlation factory module. Tests for key helpers, VariantNotFoundError, CorrelationFactoryBase ABC, NoCacheCorrelationFactory, InMemoryCorrelationFactory, SQLiteCorrelationFactory, and persistence. All tests are written first (RED phase) before implementation (GREEN phase). Fixtures in this file are...
21f55257067964d9028dff7a2247b300f13b08784b70b7c3877b1d382d3571b5
Python
109,743
3,053
import os import mne import json import glob import logging from scipy import io import warnings import numpy as np import pandas as pd from collections import Counter from typing import Any, Dict from scipy.stats import zscore from kneed import KneeLocator import matplotlib.pyplot as plt from gedai.gedai.gedai import ...
874ece5899f0c35683b86f208cb6ca466f395795eba6c54e96805a0cd7768532
Python
110,476
1,935
import os import shelve import numpy as np import prody as pr import pandas as pd from tqdm import tqdm from pathlib import Path 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 from ...
743b5d13d7b22f40418bf3763e85265a9f065601b6a573bb6060322891341aaf
Python
110,889
3,856
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """The minc module provides classes for interfacing with the `MINC <http://www.bic.mni.mcgill.ca/ServicesSoftware/MINC>`_ command line tools. This module was written to work with MINC version 2.2.00. Auth...
87666c338f0362fa9781dfff2f1300bdcd3ae3e8f0355b532fc9bd5fd1f725c7
Python
111,208
2,300
#!/usr/bin/env python3 # Kemal Inecik # k.inecik@gmail.com import bisect import copy import itertools import logging import warnings from collections import Counter from collections.abc import Iterable from functools import cached_property from typing import Any, Callable, Optional, Union import networkx as nx impor...
6d82739412eab5eaf061a577be7d81ea4c55133aba360a2e66d435488ab73172
Python
111,569
3,898
# -*- 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 minc module provides classes for interfacing with the `MINC <http://www.bic.mni.mcgill.ca/ServicesSoftware/MINC>`_ command line tools. This module was written to work with MI...
019583d2035718c4f4781aed9faf8ee2a0f20b82430becf048dac56f903eb9f0
Python
111,672
3,378
# -*- 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: """Provides interfaces to various commands provided by FreeSurfer """ import os import os.path as op from glob import glob import shutil import sys import numpy as np from nibabel i...
2c0109fe25833c3c80452fed67914e718a6282073e2c29305f97375dfd289b71
Python
112,547
2,712
import os, warnings import time import tonic from tonic import DiskCachedDataset, RandomChoiceDiskCachedDataset import torch import torch.nn.functional as F import torch.utils import torchvision.datasets as datasets from timm.data import ImageDataset, create_loader, Mixup, FastCollateMixup, AugMixDataset from timm.da...
aa706083bfbdd0a47a799eb22deac85b77ff8acc0ae882d478a9170e09842550
Python
112,595
2,056
""" CA229.py : Reconstructed prefrontal layer V pyramidal neuron with detailed morphology and active channels --- Acker and Antic (2009) Original: https://senselab.med.yale.edu/ModelDB/ShowModel.cshtml?model=117207&file=/acker_antic/Model/CA%20229.hoc#tabs-2 Modified by : Peng Penny Gao <penggao.1987@gmail.com> Feb ...
a767ab943a096ffa3bc0995eaa2e3224ef5ea2a225bd1ed11cca090798582d92
Python
112,808
3,143
import os import pickle import warnings import matplotlib import matplotlib.pyplot as plt import matplotlib.colors as mcolors import matplotlib.gridspec as grid_spec import numpy as np import pandas as pd import scipy.stats as st import seaborn as sns import statsmodels.api as sm import nibabel as nib import plotly.gra...
6215e1afb3fcdb5444d9203a0089a100ef2285ba8bd5783b1b4c0e0f1f25a3f6
Python
113,194
2,591
""" Min-cost flow tracking using Google OR-Tools. Also includes implementations of jaqaman et al. 2008 style tracking algorithm and a hungarian tracking style algorithm for comparison purposes. Implements multi-object tracking with: - Distance-based linking - Gap closing - Birth/death handling """ from __future__ im...
94515cbc4f11a5bc4de2713987d747ebb23afb2b7190ebe2b2000982692df35c
Python
113,441
1,759
import math from collections import defaultdict import numpy as np import json import os from decimal import Decimal, ROUND_HALF_UP def new_round(_float, _len): """ Parameters ---------- _float: float _len: int, 指定四舍五入需要保留的小数点后几位数为_len Returns ------- type ==> float, 返回四舍五入后的值 """ ...
42e7eb7f92513f0fa100028716ec9a4f0c94608ae76aa29ca12327272429414e
Python
113,695
936
import pickle import io import numpy as np class CheckoutFake: def __init__(self): ## Setup the class for handling the scripting functions of CheckoutCore self._availableDatasets = {'AssayPlate_Greiner_#781956': ['test_Basic_Otsu_Threshold_Thresholded_Pixel_Area', ...
2a3421e4d7a8a852c0c1941b3da5bf820abcb2d4c5d126fbce2f7b5d4ba60eb2
Python
113,919
1,250
import google.protobuf from packaging.version import Version if Version(google.protobuf.__version__).major >= 5: # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: databricks_uc_registry_messages.proto # Protobuf Python Version: 5.26.0 """Generated protocol buffer co...
e98784f0b5caf30050287d660ac93e0bbd0d672261aa373c22f8e4cf5cdea11e
Python
114,032
2,581
from typing import List, Tuple, Union, Optional, Dict, Any, Sequence, Callable import warnings import functools import PIL from pathlib import Path import math import numpy as np import scipy.optimize import scipy.sparse import torch from tqdm.auto import tqdm import cv2 import matplotlib.pyplot as plt from .. impor...
6fbd24e79bb2af4d7fe7000509688ebb9621a106c8d77b0059a751deecc7d3ae
Python
114,439
2,334
""" Main analysis GUI @author: amandaschott """ import os from pathlib import Path import scipy import h5py import numpy as np import pandas as pd import matplotlib import matplotlib.pyplot as plt from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.backends.backend_qt5agg i...
ed290b2689b399b72ee64e55b6ff49cdff39c89b077720854a3e1989a1777454
Python
114,663
2,483
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This experiment was created using PsychoPy3 Experiment Builder (v2022.2.5), on May 18, 2023, at 12:47 If you publish work using this script the most relevant publication is: Peirce J, Gray JR, Simpson S, MacAskill M, Höchenberger R, Sogo H, Kastman E, Li...
bb3fcaba4f780e15d4fd56a09ec713729e070b6e86b5d492ec5c230006276e6c
Python
115,360
1,458
from collections import defaultdict import bisect import numpy as np import json import os def new_round(_float, _len): """ Parameters ---------- _float: float _len: int, 指定四舍五入需要保留的小数点后几位数为_len Returns ------- type ==> float, 返回四舍五入后的值 """ if isinstance(_float, float): ...
7cae5727348a760268f693adf86f961b317b7f1c2ac32c1aabce602f03565cb2
Python
115,951
2,816
"""Behavioral checks for packaged literature methods, beyond simulation coverage.""" import inspect import json import re import numpy as np import pandas as pd import pytest from scipy.signal import filtfilt, remez import ripple_detection as rd from ripple_detection import literature_methods as lm RIPPLE_TIMES = [...
a3aa287f7c44104cbd78fd0ef29bc5671688cecb97cfed86254610313bbbe0aa
Python
116,060
3,063
"""Live visualization during cross-validation experiments. This module provides real-time plotting of CV results, generating figures similar to those in make_all_figures_training_set_section.py with consistent colors and styling. """ import argparse import os import sys from pathlib import Path from typing import Dic...
40148d1b1d0b2b1034d29b8df7974ca588a58de636e7673035712aeef3e4977c
Python
116,484
2,192
"""Prototype: pial surface reconstruction by forward-integrating the DiReCT velocity field, instead of the shipped FreeSurfer / nighres pial pipeline. STATUS: research prototype, not wired into the CLI or the default pipeline. It is not imported by any other module in this package. Run it directly (see `main()` / `--h...
f10869b197fba7293447a33b61053156a70d88caee1ec5d17a7f20d1c7665a0b
Python
117,019
3,155
#!/usr/bin/env python3 """ Bump Chart / Slope Graph Visualization ====================================== Creates bump charts (slope graphs) showing individual pathway trajectories through the Early → TrajDev → Late stages. Unlike alluvial diagrams that show categorical flows, bump charts show: - Y-axis: NES value (co...
7710b57ae772e61a5896ee5ca1c28e35f3cc11442f0f7d333f11d4b52afa9b35
Python
117,052
2,041
try: from . import entrypoint_setup except ImportError: import entrypoint_setup import os import tkinter as tk import argparse import base64 import json import queue import subprocess import sys import traceback import webbrowser from types import SimpleNamespace from tkinter import ttk, messagebox, filedialog...
937c85e933076ff6e24e3526d23311f96d982a894b647183d191ffa471c654b3
Python
117,075
3,497
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """AFNI utility interfaces.""" import os import os.path as op import re import numpy as np from ...utils.filemanip import load_json, save_json, split_filename from ..base import ( CommandLineInputSpec...
5e3b05282478f2668ba707a77cf93415a4389a917864d57b5d7d2636ab8e8357
Python
117,176
3,557
"""Post-hoc extraction helpers for pipeline archives.""" from __future__ import annotations import json import math from collections.abc import Mapping from dataclasses import dataclass from enum import Enum from pathlib import Path from typing import Literal import pandas as pd from scipy.stats import chi2 from me...
00687cd9526b7cecd50cad46e8195e8aa935895911730f6d84b30ab06f3ae3c1
Python
117,274
2,897
""" Controls the bulk loading summary level data: * ``read_gwas`` - Will read in a dataset from a flat file and perform some normalisation on it. This is essentially a wrapper around `pandas.read_csv <https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_csv.html#pandas.read_csv>`__. * ``set_gwas`...
c6dca7026902a8f2c72610086ed6c2306e2e615acfaba8676bdc62be9f45fafe
Python
117,724
3,509
# -*- 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: """AFNI utility interfaces.""" import os import os.path as op import re import numpy as np from ...utils.filemanip import load_json, save_json, split_filename from ..base import ( ...
34ba4a2bfdd71c8fafd5826eb0fa6d3993700acce0c1c176b5ade5a90fdf9903
Python
117,732
3,276
from typing import Optional, Tuple, Any, Iterable, Mapping, Union, Dict from tifffile import imread, imwrite, TiffFile import numpy as np import numba as nb from numba import cuda import skimage def get_tiff_metadata(filepath: str, return_all: bool = False) -> dict: """ Read the metadata from a TIFF image. ...
7110d5d4efc8c5217cdf5acdffe087fc813cef14c380cbd9a404ab9f32728109
Python
117,795
2,164
import pandas as pd import numpy as np from sklearn.model_selection import GroupShuffleSplit import rdkit from rdkit import Chem from rdkit import Chem, DataStructs from rdkit.Chem import AllChem from rdkit.Chem.MolStandardize import rdMolStandardize from rdkit.Chem.MolStandardize import rdMolStandardize as std from rd...
3bbdb7ccced393c72af5fced560e511f6103d8b4cad9b4e6defea530b4e40624
Python
117,806
3,150
"""Functions for the basic normalisation of input files. """ # Standard Python # import pprint as pp import math import re # Standard Python from collections import Counter, namedtuple # 3rd Party packages from scipy.stats import norm # My stuff from gwas_norm import ( constants as con, columns as col, p...
6018c433712f5906a6ba19ce9debdf48d3c0174ed2449b82e007cf466182fb40
Python
118,550
3,167
"""Get useful information from live Python objects. This module encapsulates the interface provided by the internal special attributes (co_*, im_*, tb_*, etc.) in a friendlier fashion. It also provides some help for examining source code and class layout. Here are some of the useful functions provided by this module:...
652d7dc3b4230e7518a51072570b51def15ea80f097426b45825ca616d7cf05c
Python
118,751
2,981
#!/usr/bin/env python3 """ Track metrics + histograms from *_pairs_tracks.csv exports. Adds: - Fix path_length aggregation (use last, not first) """ from __future__ import annotations import argparse import os import sys import glob import re from pathlib import Path from typing import List, Dict, Optional, Tuple im...
31c6e49ba7d231e2ea7e9d989bba231ddcba90cc0a32df7a328d84f1d165ff75
Python
118,883
3,192
"""Get useful information from live Python objects. This module encapsulates the interface provided by the internal special attributes (co_*, im_*, tb_*, etc.) in a friendlier fashion. It also provides some help for examining source code and class layout. Here are some of the useful functions provided by this module:...
8398367b392eb07c618bb6f6def2bff9de8ae817c82516ea2109af43dcf81202
Python
118,963
2,791
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import with_metaclass, viewkeys import types from collections import OrderedDict from . import _inputstream from . import _tokenizer from . import treebuilders from .treebuilders.base import Marker from . import _utils from .con...
26974f47ae9db26a10735efe6f0f1ea65fc6d5671cf1a7a6b7c1af3e3bc710d0
Python
118,966
3,693
"""Commonly-used neural network operations not included in NumPy.""" import warnings from keras.src import backend from keras.src.api_export import keras_export from keras.src.backend import KerasTensor from keras.src.backend import any_symbolic_tensors from keras.src.backend import config from keras.src.backend impo...
72055701cbd4d4a0a98c8c5faa7f41f159610388e1e41efd371bdaa8dd26ea09
Python
119,067
3,348
# -*- coding: utf-8 -*- """This module defines plotting functions for protein dynamics analysis. Plotting functions are called by the name of the plotted data/property and are prefixed with ``show``. Function documentations refers to the :mod:`matplotlib.pyplot` function utilized for actual plotting. Arguments and k...
241859b697f8a55b32b5db2ec1750ba196252145b21e3a7c00b9bdc2296f8fb2
Python
119,307
3,591
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """Provides interfaces to various commands provided by FreeSurfer""" import os import os.path as op from glob import glob import shutil import sys from looseversion import LooseVersion import numpy as np ...
2b2988bd7b7b200dad2de840d924ee08544b4c466f983b1f4738c2e4216298d1
Python
119,599
3,005
""" Post-processing utilities for image and mask data in BiaPy. This module provides functions for instance segmentation refinement, watershed segmentation, morphological filtering, synapse and point detection, ensemble predictions, and other post-processing operations for 2D and 3D biomedical images. It supports adva...
ff6021b13fe0e58f254cd2888ef4c5bdf8cd5d810a2127a1a745cd2e986b3701
Python
119,826
3,377
""" Tests for the dataset module """ from merit.example_data import dummy_summary_data as dsd from merit.gwas import dataset, utils as data_tools from merit import constants as con, errors from itertools import combinations, permutations from collections import namedtuple from pathlib import Path import numpy as np imp...
5f284853ccc1eba4b38f3218528f3ca0161b6baa166d62a8df9ef37e9f80ac87
Python
119,886
3,319
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ HVG-SINDy Autoencoder for Taijiquan Public Attention Dynamics and System Evolution Modeling date: 2026\1\1 This code implements the following functions: 1.Construct a Horizontal Visibility Graph (HVG) and use the HVG degree distribution exponent λ as a criter...
fd83ebc41ddfa3b10f01844e113f6270b74be65588663a94b48b9e06acee42e9
Python
120,123
3,121
#!/usr/bin/env python3 """Prepare TACMAN-compatible homology files from external resources.""" from __future__ import annotations import argparse import gzip import re import shutil import subprocess import sys from pathlib import Path from typing import Dict, Iterable, List, Optional, Sequence, Set, Tuple pd = None...
c92c2c4bf5dcc39c606965cf380c4a715f88766d3f4cc20cda616fa67e6d1b78
Python
120,367
2,842
"""Tests for core signal processing and utility functions.""" import warnings import numpy as np import pandas as pd import pytest from scipy.signal import filtfilt, freqz from scipy.stats import median_abs_deviation, zscore from ripple_detection.core import ( _get_ripplefilter_kernel, estimate_noise_thresho...
6b3babb0f1f662f7c804c2487dfd14c44bebd52180693b15b4f12c6067fd639f
Python
120,682
2,846
"""Execution tests for the code in the agent skills bundled with ``great_expectations``. The skills teach an agent how to drive this library, and every instruction they give is carried by a code snippet. Markdown is not compiled, imported or linted by anything, so a snippet that stopped working would keep being handed...
aa3e570bd3edb359b4da142b53ebb12857e51bf58c448bb1cff2c5264392c3f5
Python
122,746
2,547
from __future__ import annotations import logging from typing import TYPE_CHECKING, Any, Dict, List, Tuple, Union, Optional, Set, Literal import gc from json import load, dump, dumps from os.path import exists from copy import deepcopy import cv2 import numpy as np import SimpleITK as sitk from mdh_app.data_build...
15d45e6b8e5b44ad10327cf96194e89a753f227e9b7ddd2f0c1820ebefdec913
Python
124,624
2,414
import numpy as np import random import tensorflow as tf from tensorflow.keras.layers import Input, Dense, Concatenate, RNN from tensorflow.keras.models import Model from tensorflow.keras import initializers from tensorflow.keras.regularizers import l2 from tensorflow.keras.initializers import GlorotUniform from sklear...
5895ae91b832edd83dc431cc83bda9329c1d6ae2216858f50f8e21cdeed3828d
Python
125,740
2,970
from __future__ import annotations import argparse import csv from functools import partial import hashlib import itertools import json import math import os import random import subprocess import time import warnings from collections import Counter, defaultdict from datetime import datetime, timezone from pathlib imp...
5e72f18214ebb9a3c16e8eddb88fc7ccf9c9edc9fca94edc4eed78768b67be6b
Python
126,034
3,314
# Copyright 2024 DeepMind Technologies Limited # # AlphaFold 3 source code is 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...
7ca296ffb07bebf4e39c31eca1417221eb2f26f7da1595aa98703b1474ef4ddd
Python
126,394
3,020
""" Classes for mapping variants """ # from time import time from merit.ensembl import variants, constants as ensc from operator import itemgetter from pyaddons import gzopen import sys import csv import re import itertools import pprint as pp # https://stackoverflow.com/questions/15063936 csv.field_size_limit(sys....
78cd544f1be3658043b0b3426dd5a5ccefb0579a9b4797cfe01dec5fbf6a5236
Python
126,425
4,613
# pylint: disable=W0611, W0612, F0401, R0914, C0302 """General tests of eFEL""" """ Copyright (c) 2015, Blue Brain Project/EPFL Copyright (c) 2025-2026 Open Brain Institute All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the followin...
2cb886633450fc6b142ce60b0256670c5e85f8406d3a049d5d26dc6cb2fdd7c3
Python
127,184
2,432
__author__ = "Simon Nilsson; sronilsson@gmail.com" import platform from typing import Dict, List, Optional, Tuple, Union import numpy as np try: from typing import Literal except: from typing_extensions import Literal import functools import multiprocessing import os from collections import ChainMap import...
b325662178bd58f244af29a98eabf1e1ee8be5c945019b9efcecfd4ecb3e1dd0
Python
128,054
1,992
import math from collections import defaultdict import numpy as np import json import os from decimal import Decimal, ROUND_HALF_UP def new_round(_float, _len): """ Parameters ---------- _float: float _len: int, 指定四舍五入需要保留的小数点后几位数为_len Returns ------- type ==> float, 返回四舍五入后的值 """ ...
7d4d83c2b29141c489bf918a6cba1e3c47dcb78513984c192997e684b4f40680
Python
128,558
4,132
import builtins import collections import functools import math import string import warnings import numpy as np import tensorflow as tf from tensorflow.python.ops.linalg.sparse import sparse_csr_matrix_ops from tensorflow.python.ops.math_ops import is_nan from keras.src import tree from keras.src.backend import conf...
4c7a893a14b189341c1dba03352739ca87dcda4a175d01471728edcae9ed51f3
Python
131,180
5,718
#!/usr/bin/env python # -*- coding: utf-8 -*- from pip._vendor.chardet.sbcharsetprober import SingleByteCharSetModel # 3: Positive # 2: Likely # 1: Unlikely # 0: Negative RUSSIAN_LANG_MODEL = { 37: { # 'А' 37: 0, # 'А' 44: 1, # 'Б' 33: 1, # 'В' 46: 1, # 'Г' 41: 1, #...
bc8ab1355aeb15683a939c39c1b475a81641a1294bb83326514296a7a2439fa1
Python
131,355
2,507
import sys from . import data, stats, models, simulations, optimize_geometry, md, md_parallel, constants, generate_initial_conditions import numpy as np import os import random import joblib from . import gap_md, namd class Sampler(): def __init__(self,sampler_function=None): if type(sampler_function) is s...
a577f344e915ece22c76e37b3bfc0416f9fb00955291c3353931b90281476a1d
Python
132,053
3,374
""" Augmentation utilities for image and mask data in deep learning workflows. This module provides a variety of data augmentation functions for images and masks, including cutout, cutblur, cutmix, cutnoise, misalignment, cropping, flipping, rotation, zoom, gamma/contrast adjustment, blurring, dropout, elastic deforma...
c5e30ae29480f813279c28d5febb5929ab2a4524163b7e882b1ba20e272bbf17
Python
132,522
3,708
import copy import inspect import json import logging import math import re from abc import abstractmethod from dataclasses import asdict, dataclass from typing import TYPE_CHECKING, Any, Literal import pydantic if TYPE_CHECKING: from mlflow.genai.utils.type import FunctionCall from mlflow.types.llm import Ch...
93f059df0acb2c1fdf0cbfefb97c69a64b6836de7d9dee0f619569beef2e5234
Python
133,446
3,295
"""Finding sharp-wave ripple events (150-250 Hz) from local field potentials. """ import functools import os import sys import warnings from collections.abc import Generator, Iterable from dataclasses import dataclass from itertools import pairwise from pathlib import Path from typing import Any, Literal, get_args im...
1d2c2664e5300ef5565aba5a8fed3d3b7360d30c59e55212c771877c20e2cfc2
Python
133,796
2,958
#!/usr/bin/env python3 """ ANO Final Model Training - ANO Framework Module 8 ================================================= PURPOSE: Module 8 trains final production models using the best configurations from Modules 4-7, then compares their performance to select the best approach. KEY FEATURES: 1. **Best Configura...
5db5b55aeca17b1de4339c4060aedc50e14e42d698c987311fdc5914faeb831e
Python
134,121
2,726
#!/usr/bin/env python3 ''' .. code-block:: !---------------------------------------------------------------------------! ! ML_NEA: ML-nuclear ensemble UV/vis spectra ! ! Implementations by: Bao-Xin Xue ! !------------------------------...
e1ba28874c57fc33d24d9b3e8f1e97004ddf4a72a07cf81fbc96fcedaf7084ed
Python
135,202
3,606
"""Classes for handling genomic regions, variants and genotypes. """ # Standard imports import re from typing import ( Any, Optional, Union, List, Tuple, TypeVar, ClassVar, Set ) from itertools import zip_longest from enum import Enum # from math import factorial from math import log from copy import deepcopy # 3r...
c7ae993255a6dc0ab4e4740cd7077c23c8c9ed9adcdcb4f33f6d34df36032cd6
Python
136,743
2,681
__author__ = "Simon Nilsson; sronilsson@gmail.com" import io import os import shutil from copy import copy from functools import lru_cache from typing import Any, Dict, List, Optional, Tuple, Union import cv2 import imutils import matplotlib #matplotlib.use('agg') import matplotlib.pyplot as plt import numpy as np imp...
2f929b18bc6afae25d6f8ee1933fa085d936a546f6de5ea3999cd32f16bce911
Python
136,958
3,428
""" Metrics and loss functions for BiaPy. This module provides a variety of metrics and loss functions for evaluating and training deep learning models in BiaPy. It includes implementations for Jaccard index (IoU), Dice loss, BCE, Cross-Entropy, contrastive losses, instance segmentation losses, detection metrics, and ...
778527b9ae2a08e84f231ebaa613dffaf42e7c357064909a7569f5b9b2fd6298
Python
137,660
3,207
"""Unit tests for gget virus module. This test module provides comprehensive validation of the virus function and all helper functions, covering downloads, filtering, parsing, and error handling for viral sequences and metadata from NCBI's virus database. Test Structure: --------------- The test suite uses a hybrid a...
1b813537dc633060764254c4bd2c31b4a43212debd3f630ae8231aa860477cb9
Python
138,415
4,210
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """Interfaces to assorted Freesurfer utility programs.""" import os import re import shutil from ... import logging from ...utils.filemanip import fname_presuffix, split_filename from ..base import ( ...
4d60221d6748ca884836b9bad8f9044bcb033dca9ba77c3203c14cac3d45a3df
Python
138,427
3,202
from __future__ import annotations import datetime import functools import logging import re import warnings from abc import ABC, abstractmethod from collections import Counter from copy import deepcopy from inspect import isabstract from numbers import Number from typing import ( TYPE_CHECKING, Any, Calla...
fcac3c9be46be34a86109b196072fc1963b8108af12cef5ea5c2bd8b71dad765
Python
139,188
4,233
# -*- 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: """Interfaces to assorted Freesurfer utility programs. """ import os import re import shutil from ... import logging from ...utils.filemanip import fname_presuffix, split_filename f...
f6be2426a6b33bd0a294de34eb79c98658b51401ec23d37cf3a426c73def3b09
Python
139,951
2,792
""" This file contains functions to edit/preprocess volumes (i.e. not tensors!). These functions are sorted in five categories: 1- volume editing: this can be applied to any volume (i.e. images or label maps). It contains: -mask_volume -rescale_volume -crop_volume -crop_volume_around_reg...
9a1785fc234a8d63ffa29cd5c0e5a21f8f4ef79b038a810818d0f6ab381b689a
Python
140,738
2,490
''' .. code-block:: !---------------------------------------------------------------------------! ! Interface_TorchANI: Interface between TorchANI and MLatom ! ! Implementations by: Fuchun Ge and Max Pinheiro Jr ! ! Defines the MS-ANI model ...
296c7fe94fd8638e8f997901f39773fe76a1c582fc281033c9f32e41d492b76f
Python
140,784
2,712
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This experiment was created using PsychoPy3 Experiment Builder (v2021.1.2), on szeptember 29, 2023, at 15:00 If you publish work using this script the most relevant publication is: Peirce J, Gray JR, Simpson S, MacAskill M, Höchenberger R, Sogo H, Kastman E, Li...
782a0d5b7ceed86414b0416182454e00341d711ce9ebf2b589c2441d052b18fe
Python
141,010
2,531
import pickle import numpy as np import os import pandas as pd import gc import re import matplotlib.pyplot as plt import matplotlib.patches as patches import seaborn as sns import math import DataParser import ET_param_manager import ET_data_extraction import itertools """ The following list is a list of participans ...
bfbfd26da6d0c31aa69f727d729b28cf2c89d4c78e6c53737d0379f26bab9850
Python
141,584
3,035
# Copyright (C) 2023 Lorenzo Posani # # 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 the License, or # (at your option) any later version. # # This ...
5d4864bcdb6188059a247281f072d26c0f2c2398e028db08bb3e1340a33ac072
Python
143,201
3,908
# 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. # #...
e84e89194e6f32f2c2a33422049bdf27a66f4236219ff41a75b03969cfbe98b5
Python
143,632
4,140
# # turtle.py: a Tkinter based turtle graphics module for Python # Version 1.1b - 4. 5. 2009 # # Copyright (C) 2006 - 2010 Gregor Lingl # email: glingl@aon.at # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from th...
a044c6d72c920c0e9cbaa3ca54882cf86c206619b1c6c9fa871d2d646b307f17
Python
143,716
4,140
# # turtle.py: a Tkinter based turtle graphics module for Python # Version 1.1b - 4. 5. 2009 # # Copyright (C) 2006 - 2010 Gregor Lingl # email: glingl@aon.at # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from th...
72f99f4f1830bda1712abaf9dbbf247d7962dcd9801ef11eae693ef08e26f4d6
Python
144,284
3,042
""" Base workflow class for BiaPy. This module defines the Base_Workflow abstract class, which provides the main structure and utility methods for building training and inference workflows in BiaPy. It handles configuration, model preparation, data loading, training, testing, metrics, logging, and post-processing for ...
a81e17eea464cbe681363e6cffeeefa6b44f396ba96546c9349fa367ca84f943
Python
144,578
3,927
#!/usr/bin/env python3 """Build the independently derived external LD reference corpus foundation.""" from __future__ import annotations import argparse import csv import gzip import hashlib import importlib.metadata import json import os import shutil import subprocess import sys import tempfile from dataclasses imp...
09857c4d304586a6032b038ee109877eaf261b1c9dba673f7384ecc2c5f7c06e
Python
144,867
2,942
__author__ = "Simon Nilsson; sronilsson@gmail.com" import time start = time.time() import itertools import multiprocessing import numpy as np import pandas as pd from numba import (boolean, float32, float64, int64, jit, njit, prange, typed, types) from numba.typed import Dict, List from numpy.lib....
8192f1dc03ab633e4ace7392d0b7bc3c65a9d80ca6491f19043aa2ddada8da38
Python
145,225
3,762
# Author: Leland McInnes <leland.mcinnes@gmail.com> # # License: BSD 3 clause from __future__ import print_function import locale from collections import deque from warnings import warn import time from scipy.optimize import curve_fit from sklearn.base import BaseEstimator, ClassNamePrefixFeaturesOutMixin from sklear...
20a412789055669915c97f47c2e80465ceff78a2167aa03f67b16784a88666d1
Python
145,464
4,084
from __future__ import annotations import argparse import sys from datetime import datetime from typing import Any import pandas as pd # Get current date and time for alphafold default foldername dt_string = datetime.now().strftime("%Y_%m_%d-%H_%M") import json # noqa: E402 import os # noqa: E402 import subproces...
3c7c67656b01a0ec0e33e130b806a8ed3fb3bc5f6c2625e5cf0d3ec8dc0c2055
Python
145,965
2,814
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This experiment was created using PsychoPy3 Experiment Builder (v2021.1.4), on május 09, 2023, at 09:51 If you publish work using this script the most relevant publication is: Peirce J, Gray JR, Simpson S, MacAskill M, Höchenberger R, Sogo H, Kastman E, Lindelø...
6618071c5af4ceff04326a7591e5622838abb73bd011b64669c66111b216f6af
Python
147,039
2,832
""" Toothy Purpose: Data ingestion (input data selection and data processing pipeline) Authors: Amanda Schott, Kathleen Esfahany Last updated: 2025-10-08 TODO - Replace icons for the probe selection widget black and white circle - TODO review probe_hanlder - TODO implement view_data_assignments better: should open...
bcbd875d75cb8482383247176a7ca401e601ac6e276960a1d6668626caa8532a
Python
147,463
4,312
# -*- 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: """AFNI preprocessing interfaces.""" import os import os.path as op from ...utils.filemanip import load_json, save_json, split_filename, fname_presuffix from ..base import ( Co...
16b3e890561ee3e137fe7d49caad555b37f55a84933b0687166514ade3c7d087
Python
147,982
3,981
import math import jax import numpy as np import pytest import scipy.ndimage import tensorflow as tf from absl.testing import parameterized from keras.src import backend from keras.src import testing from keras.src.backend.common import dtypes from keras.src.backend.common.keras_tensor import KerasTensor from keras.s...
6e3ad12109add6cc6838d7b271bfb675b90ca2dd4cb5ecb7990197bc75c3f4f9
Python
148,065
3,063
# -*- coding: utf-8 -*- __author__ = 'Carlos Ventura' __email__ = ['carlosventura@stonybrook.edu'] import tkinter as tk from tkinter import ttk, filedialog, messagebox import os import subprocess import shutil import glob import sys import ast from pathlib import Path import importlib import gzip import pickle import ...
a89f575f1ec39e57fef06f3f7726b7af0d9876a3568315de1f093aa85b11d9e7
Python
148,781
3,684
""" The ``data_tools`` module is a collection of functions that are designed to make it easier to do common data orientated operations on gwas datasets. These are the sorts of things that will often have to be done prior to an analysis taking place. Many of the functions in this module are used internally by ``read_gw...