sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
8d3553816a6e4b783d68b7736ea9e2792f2ffc2cf532943eae2cf9a7771c8d97 | Python | 36,398 | 983 | # -*- coding: utf-8 -*-
# (C) Copyright 2020, 2021, 2022, 2023 IBM. All Rights Reserved.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... |
534a404befe851649c9c3198b9f78fdf29da7f1768eec43c2bcca149b85b9182 | Python | 36,588 | 1,207 | # pylint: disable=too-many-lines
"""Utilities for data generation."""
import gc
import multiprocessing
import os
import string
import zipfile
from concurrent.futures import ThreadPoolExecutor
from dataclasses import dataclass
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
Generator,
L... |
d2a42644f6c1da7a0d63479e52d339eb00114f13d91eea2029293765ee79cfe6 | Python | 37,127 | 827 | # MODIFIED version of https://raw.githubusercontent.com/cocodataset/cocoapi/8c9bcc3cf640524c4c20a9c40e89cb6a2f2fa0e9/PythonAPI/pycocotools/cocoeval.py
# Copyright (c) 2014, Piotr Dollar and Tsung-Yi Lin
# All rights reserved.
# License for this file can be found in "pycocotools_license.md" file.
# Modified by Deserno,... |
9a3ccb2056bdbb2953de67e67f61191a682a260a95c7aa0acd774eaa2f93fe0d | Python | 37,178 | 1,121 | import hashlib
import io
import os
import re
import tempfile
import numpy
import pytest
import skimage.io
from cellprofiler_core.constants.measurement import COLTYPE_FLOAT
from cellprofiler_core.constants.measurement import COLTYPE_INTEGER
from cellprofiler_core.constants.measurement import COLTYPE_VARCHAR_FORMAT
fro... |
6a89fcb07333079d832927be1c47b659511b75d0e8456731cbf6fc877773c204 | Python | 37,276 | 693 | import os
import pandas as pd
import numpy as np
from sklearn.preprocessing import StandardScaler
import matplotlib.pyplot as plt
from matplotlib import gridspec
import matplotlib.transforms as transforms
import seaborn as sns
import statsmodels.api as sm
from statsmodels.formula.api import ols
import scipy.stats as st... |
fb31ba79f16179b05770c8bda2d68da6c28fabdf6850f7467ca035e8b2e22121 | Python | 37,406 | 960 | """ MobileNet-V5
The MobileNet-V5 vision encoder from Google's Gemma 3n. Built from MobileNet-V4 blocks (Universal Inverted
Residual, Mobile MQA) with a Multi-Scale Fusion VLM adapter. There is no dedicated MobileNet-V5 paper at the time of
writing, the MobileNet-V4 paper describes the building blocks.
Papers:
* `Mob... |
64df4392909d9b13791677c4677c2f1a8b3d2bd8258a2cde8795ef75a4afe68f | Python | 37,932 | 936 | """
CalculateStatistics
===================
**CalculateStatistics** calculates measures of assay quality (V and Z’
factors) and dose-response data (EC50) for all measured features made
from images.
The V and Z’ factors are statistical measures of assay quality and are
calculated for each per-image measurement and for... |
85196aa629f7323afc528dd1e8e1e1365a7e2872ec4a1820d2274f53fdc4cf04 | Python | 38,000 | 1,046 | import io
import json
import logging
import logging.config
import argparse
from argparse import RawTextHelpFormatter
import os
import os.path
import sys
import tempfile
import urllib.parse
import h5py
import matplotlib
import numpy
from cellprofiler import __version__ as cellprofiler_version
from cellprofiler_core.c... |
9a93476154cfadb2a748685ff754d21ba3ea67b0683bb5ad554b950f6015b817 | Python | 38,017 | 960 | from copy import deepcopy
import functools
import json
import logging
import operator
import re
from tempfile import gettempdir
from urllib import parse
from urllib.parse import parse_qs, urlparse
from numpy import mean, median, std
from tabulate import tabulate
from nidm.core import Constants
from nidm.experiment impo... |
444e4784bc8c1463ce8ebd3b8d85dafb1bdda2a0982b4b7f1ec965311a6347f6 | Python | 38,039 | 929 | # Copyright (c) MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... |
51260feb51fed6b49f4c7c5d2684ffd3624c00bb8fc98602d6cb5fcd05fd1957 | Python | 38,088 | 914 | import os
import yaml
import torch
import math
import pytest
import shutil
from pathlib import Path
import pandas as pd
import numpy as np
import lightning.pytorch as pl
from GANDLF.models.lightning_module import GandlfLightningModule
from GANDLF.losses.loss_calculators import (
LossCalculatorFactory,
LossCalcu... |
6d9117ba4b12b2a9bf28f2fbecb62942be47581ada0ce27053a869f6a0662e5e | Python | 38,121 | 841 | ## General imports (also for subsequent analysis notebooks)
import sys, os
import json
from popoff import loadpaths
print(loadpaths.__file__)
USER_PATHS_DICT = loadpaths.loadpaths() # automatically use current PC user name
path_to_vape = USER_PATHS_DICT['vape_path']
print(path_to_vape)
sys.path.append(str(path_t... |
e7282faee2ee4e83e11f77bd83bab7b478b65510f8434e6d0ee3f8e7272950f2 | Python | 38,194 | 1,041 | """
An implementation of GhostNet & GhostNetV2 Models as defined in:
Papers:
* `GhostNet: More Features from Cheap Operations` - https://arxiv.org/abs/1911.11907
* `GhostNetV2: Enhance Cheap Operation with Long-Range Attention` - https://arxiv.org/abs/2211.12905
* `GhostNetV3: Exploring the Training Strate... |
3fb82ce0324387ae4bc8d8103e668043c7163b734d4a7e3c4669a06d2b55e281 | Python | 38,209 | 1,038 | # This code implements the Bistritzer-MacDonald continuum model for twisted double bilayer graphene Supports heterostrain and displacement field Can output cuts of the band structure, full DOS, and LDOS images See end of file for example code Simon Turkel References:
# [1] Bistritzer-MacDonald model: Bistritzer and Ma... |
49ff9b31749598d03c7bd85df7ff68c3d8f766cf70d9b2ec3e89bad98508d1f2 | Python | 38,233 | 954 | """
Author: "Keitaro Yamashita, Garib N. Murshudov"
MRC Laboratory of Molecular Biology
This software is released under the
Mozilla Public License, version 2.0; see LICENSE.
"""
from __future__ import absolute_import, division, print_function, generators
import gemmi
import numpy
import pandas
import scipy.sparse
... |
b9b85abcb0c109900456f2f3c6ba1f6d3bf91ee2ed5887efc5d2ffd525eebe91 | Python | 38,289 | 973 | import logging
import sys
import uuid
import docutils.core
import numpy
from ..constants.pipeline import BATCH_STATE
from ..constants.pipeline import MODULE_NAMES
from ..constants.pipeline import MODULE_NOTES
from ..constants.pipeline import MODULE_REVISION_NUMBERS
from ..constants.pipeline import NUMBERS_OF_VARIABLE... |
99b2017092fdd82c2b13a42de9200104acdccccac575a3462586a9029228689b | Python | 38,293 | 858 | """Qwen3 Vision Transformer
Vision encoder of the Qwen3-VL / Qwen3.5 / Qwen3.8 multimodal models from Alibaba Qwen team, and of the
driving-domain Qwen-Drive-1.0 built on that same tower.
Papers:
* `Qwen3-VL Technical Report` - https://arxiv.org/abs/2511.21631
* `Qwen-Drive-1.0: An Initial Step towards a Vision-Langu... |
c05640256e0b99a1bcff84d4ba3ece3d8a92898f275b7a839d1ab32ca7e59815 | Python | 38,297 | 1,046 | import glob
import os
import pickle
import re
import sys
from functools import partial
import warnings
import h5py
import numpy as np
from tqdm import tqdm
import pdb2sql
from deeprank import config
from deeprank.config import logger
from deeprank.generate import MinMaxParam, NormalizeData, NormParam
from deeprank.to... |
f76a1b4bd2747a1bc069460894164401a411d61d9ac4ca4a9adc2992a043cc3b | Python | 38,336 | 1,038 | """EfficientViM
Efficient Vision Mamba with Hidden State Mixer based State Space Duality (CVPR 2025)
Papers:
* `EfficientViM: Efficient Vision Mamba with Hidden State Mixer based State Space Duality` - https://arxiv.org/abs/2411.15241
Code: https://github.com/mlvlab/EfficientViM
Hidden State Mixer based State Space... |
07beb24a2a294c69d75216aa3f9a273de4ee10b61494d1635641bd22cc13a5cd | Python | 38,502 | 982 | """
FlagImage
=========
**FlagImage** allows you to flag an image based on properties that you
specify, for example, quality control measurements.
This module allows you to assign a flag if an image meets certain
measurement criteria that you specify (for example, if the image fails a
quality control measurement). Th... |
7bcdadaf979e1f68f2e0648d41fa15fcf7278fc227915957d89d5611cfd81876 | Python | 38,538 | 906 | """
Created on Mon Jan 31 11:07:27 2022
@author: claudia
"""
#IO
import sys
import os
import csv
import pickle
#Math
import numpy as np
import scipy
from scipy.interpolate import LSQUnivariateSpline
import scipy.io
import math
import vg
#Plot
import matplotlib.pyplot as plt
from matplotlib import cm
#Time-frequ... |
d0a25c719f9a07ee7c4ddb95e6faf31cdb319fc0df06c7bb3aa970080efdbc20 | Python | 38,609 | 754 | """
Program description: This program will load in a CSV file made during simple-2
brain volumes experiment which has the following organization::
source FSL FSL FSL
participant_id left nucleus accumbens volume left amygdala volume left caudate nucleus volume
sub-0050002 796.4723293 ... |
634b2db20bda914e70a7d0bad910b11085f440f36a69c60a9d6f5254e7d4ed03 | Python | 38,712 | 802 | """
Author: Mingjian He <mh1@stanford.edu>
Amanda Beck <ambeck@mit.edu>
osc module contains Matsuda oscillator specific methods used in SOMATA
"""
from somata.basic_models import StateSpaceModel as Ssm
import numpy as np
import numbers
from math import atan2, sin, cos, sqrt
from scipy.linalg import block_diag... |
ad0c97ff515c92e2434e9f7bb5f87fffeabfd4c0a65534cb6853b2c087b88171 | Python | 38,713 | 1,063 | from __future__ import annotations
import copy
import importlib.util
import json
import os
import shutil
from pathlib import Path
from typing import Any
import pytest
import yaml
ROOT = Path(__file__).resolve().parents[3]
TOOL = ROOT / "tools" / "dm_index.py"
SPEC = importlib.util.spec_from_file_location("dm_index",... |
debf8091fedbfdd13e6dfc92b2ae80c783fe96fb93600562ffb7eb05897e0d45 | Python | 38,834 | 938 | """Tests for bowtie2-build and bowtie2-inspect.
Most expected values are derived without bowtie2: the references are the
fixed random `genome` (with N runs, IUPAC codes, a gap and lowercase pasted
over known stretches), reads are cut from them at known places, and the
MANUAL's descriptions give what bowtie2-inspect pr... |
feadba088b1cbbe71e90ac525855570cde3e4824160789761fc2565c7dbade55 | Python | 38,850 | 990 | """
CoaT architecture.
Papers:
* `Co-Scale Conv-Attentional Image Transformers` - https://arxiv.org/abs/2104.06399
Official CoaT code at: https://github.com/mlpc-ucsd/CoaT
Modified from timm/models/vision_transformer.py
"""
from typing import List, Optional, Tuple, Union, Type, Any
import torch
import torch.nn ... |
41512893d1533420160ed6f3a21e621128a73c35c1ead6a5569228122b90a97e | Python | 38,883 | 472 | #### Master Script 1: Extract and prepare study sample timestamps from CENTER-TBI dataset ####
#
# Shubhayu Bhattacharyay
# University of Cambridge
# email address: sb2406@cam.ac.uk
#
### Contents:
# I. Initialisation
# II. Load and filter CENTER-TBI dataset
# III. Characterise ICU stay timestamps and fill in missing t... |
f2ec75b0d0842a709dc2fc6d4d2ca66c08293b984975eaeafd09b0f898790e1a | Python | 38,883 | 1,150 | from typing import Dict
import matplotlib.cm
import numpy
import numpy.ma
from cellprofiler_core.constants.measurement import COLTYPE_FLOAT
from cellprofiler_core.image import Image
from cellprofiler_core.module import Module
from cellprofiler_core.preferences import get_default_colormap
from cellprofiler_core.setting ... |
5553752d5f848af814874969e309c1bab13ba55167726d790c06d16c5dbf4e2e | Python | 38,897 | 777 | from typing import List, Optional
import torch
import hydra
from omegaconf import DictConfig
from pytorch_lightning import (
Callback,
Trainer,
seed_everything,
)
import matplotlib.pyplot as plt
import seaborn as sns
from pytorch_lightning.loggers import LightningLoggerBase
import xgboost as xgb
from catboo... |
e690843b7120ec99b71b9d907aaf15a242198ba4fc4aa4dfb9c0237e537720b5 | Python | 38,989 | 1,016 | import numpy as np
from scipy.stats import qmc
from scipy.stats import special_ortho_group
from scipy.optimize import minimize
from nengo.dists import Distribution, UniformHypersphere, ScatteredHypersphere
from scipy.special import gammainc
import warnings
from nengo.utils.numpy import is_integer
class SPSpace:
r... |
7bbe7a75f85d664125a680d75f91f6c4e01f50d2ac38860ed092da993a3f1f55 | Python | 39,119 | 912 | import base64
import bz2
import io
import centriole.outline
import numpy
import numpy.testing
import numpy.testing
import pytest
import skimage.measure
import cellprofiler_library.functions.segmentation
import cellprofiler_core.image
import cellprofiler_core.image
import cellprofiler_core.object
import cellprofiler_c... |
c3204c85f9e0e1e4ffe918a802e4543ad674b918631864e06aa1e536108cea35 | Python | 39,129 | 1,118 | # study: .sqlite3
# features: .features
# MZ_TOLERANCE: 15.0
# RT_TOLERANCE: 0.2
# RT_WINDOW: 0.5
# output: .quantified
import sys
import time
import sqlite3
import actions
import formula_actions
import nist_ion_descriptions
import formula
import columns
# Used to produce these here:
#
# \tRT Start (min)\tRT End (min)... |
964b5d4d8915c37bcc39ec2475300c5bcd00137b8ca86c15e0dbe6182395f262 | Python | 39,197 | 1,036 | """
pysteps.nowcasts.sseps
======================
Implementation of the Short-space ensemble prediction system (SSEPS) method.
Essentially, SSEPS is a localized version of STEPS.
For localization we intend the use of a subset of the observations in order to
estimate model parameters that are distributed in space. The... |
b790e9a13c7daa9b709faff0cb1c092daf7906f0b2fc3c2b30551e25a166bccd | Python | 39,232 | 936 | import os
import os.path as op
from tempfile import mktemp
from subprocess import Popen, PIPE, check_output
import gzip
import numpy as np
import shutil
import traceback
try:
import nibabel as nib
from nibabel.spatialimages import ImageFileError
import nibabel.freesurfer as nib_fs
except:
print('No nib... |
597cd2f1a8d9916f650232266f90b2cfe3be2e8a92dd3902461b4bd0f18de174 | Python | 39,330 | 1,063 | """ An PyTorch implementation of Hiera
Papers:
* `Hiera: A Hierarchical Vision Transformer without the Bells-and-Whistles` - https://arxiv.org/abs/2306.00989
* `Window Attention is Bugged: How not to Interpolate Position Embeddings` - https://arxiv.org/abs/2311.05613 (abswin)
Adapted for timm from originals at https:... |
7184b7e75c7feffeb215979c24893a48fc0dddba7316fd1b236a4354160be853 | Python | 39,505 | 1,239 | import io
import numpy
import numpy.random
import numpy.testing
import scipy.ndimage
import cellprofiler_library.opts.measureimageoverlap
import cellprofiler_core.image
import cellprofiler_core.measurement
import cellprofiler_core.module
import cellprofiler_core.object
import cellprofiler_core.pipeline
import cellpr... |
281ca1188bb8ad47c072b24381640ee68063df79365f0c9aa17bfcea0f943aa2 | Python | 39,623 | 911 | # -*- coding: utf-8 -*-
import logging
import os
from configparser import ConfigParser
import time
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.patches import ConnectionPatch
import matplotlib.textpath
import matplotlib.colors
import matplotlib.gridspec
import matplotlib.cm
impo... |
e628455952bb331dc5f995582c286473d3932282b1564ebdc3f9cf6b98040f7a | Python | 39,849 | 833 | import os
import h5py
import numpy as np
from sortedcontainers import SortedList
from tqdm import tqdm
import pandas as pd
import copy
import scanpy as sc
import torch
from torch.utils.data import DataLoader, Dataset
import random
SAMPLE_ID_TEST = "13_1226_SMTG"
SAMPLE_ID_VAL = "13_0038_SMTG"
#MIXTUREFIX = "_pseudobu... |
5e2856754809188fc8fec84b00e024827421b34c9c25b852e0639a6ea3821433 | Python | 39,879 | 843 | import math
import pandas
import numpy
from pepars.utils import DNA
from pepars.analysis import confidence
from pepars.analysis import Label_Type
from pepars.utils import Sequence_Trie
from . import coverage
from ..workspace import Workspace as ws
from ..workspace import Database as db
from .Sequence_Library import... |
08205f5de8d6dbe6fea0d3021c929d50990a6379098359a1aab6c4315808d851 | Python | 39,997 | 1,221 | # -*- coding: utf-8 -*-
"""
pysteps.timeseries.autoregression
=================================
Methods related to autoregressive AR(p) models.
.. autosummary::
:toctree: ../generated/
adjust_lag2_corrcoef1
adjust_lag2_corrcoef2
ar_acf
estimate_ar_params_ols
estimate_ar_params_ols_localized
... |
78b18d97b560cbfdd8230b703948f17cf1239dad9a7b857a770c2bc344bdfefc | Python | 40,193 | 844 | import nengo
import numpy as np
from sspslam.utils import sparsity_to_x_intercept
import collections.abc
## Path integration network
# Continuously updates a SSP S (shape d) representing x(t) (shape n) given dx/dt.
#
# Contains:
# velocity_input: shape n. A node that receives dx/dt over time
# input: shape d. A node ... |
0882b08a23fc3aa8a794153f0a340eee189e05a19f713f35bc086ac604691742 | Python | 40,220 | 673 | """
Gets (1) tuning peak locations, (2) occupancies, (3) computes inter-session stability
@author: bartulem
"""
import io
import os
import re
import sys
import json
import numpy as np
import scipy.io as sio
from tqdm import tqdm
from numba import njit
from scipy.stats import spearmanr
import select_clusters
import neu... |
e0719c0e0b7f4341aacaf0240f51e43c25396ffa6335a6b2da8b3ed162e45070 | Python | 40,472 | 995 | """Validate registry sources and build deterministic immutable indexes."""
from __future__ import annotations
import argparse
import hashlib
import json
import sys
from collections.abc import Mapping, Sequence
from functools import lru_cache
from pathlib import Path
from typing import Any, cast
import yaml
from json... |
a4f3e7599df9f90e43fe161eb07d82c5ea78fbbd759aff76b89dae7311ae8ce0 | Python | 40,525 | 918 | """
This program will convert a NIDM-Experiment RDF document to a BIDS dataset.
The program will query the NIDM-Experiment document for subjects, MRI scans,
and associated assessments saving the MRI data to disk in an organization
according to the BIDS specification, the demographics metadata to a
participants.tsv file... |
8a892d0bb270e7700b45927cb7c0099b0c4ba01ac8da95264596bbd8702ad261 | Python | 41,210 | 989 | """ demixed Principal Component Analysis
"""
# Author: Wieland Brendel <wieland.brendel@neuro.fchampalimaud.org>
#
# License: BSD 3 clause
from __future__ import print_function
import numpy as np
from collections import OrderedDict
from itertools import combinations, chain
from scipy.sparse.linalg import svds
from s... |
0f0f5618a0f1bbe789026e03e6943465e0ff016e35d4422a338c5fd929977e8a | Python | 41,250 | 991 | ## General imports (also for subsequent analysis notebooks)
import sys, os
import json
import mrestimator as mre
import math
#from help_functions import fit_tau, oasis_deconvolve_Fc
from scipy.optimize import curve_fit
from IPython.core.debugger import Pdb
ipdb = Pdb()
sys.path.append('/home/loidolt/Projects/OASIS')
... |
04dfbb74d00dc6ed480a62788aabf2f1dbd92704c6bec42740f238e1a694edc8 | Python | 41,698 | 1,002 | """
Performs rotations on tracking data.
@author: Benjamin Adric Dunn
@modified: JingyiGF
"""
# import library
import os
from scipy import *
import scipy.ndimage.filters
import scipy.io
import scipy.stats
import scipy.linalg as linalg
import numpy as np
import math
import pickle
import pandas as pd
from scipy.optimize... |
a76b999f7a4ac96c58cf29d4119e61f553c4d20f028b2daf1de65f9cd399ba64 | Python | 41,719 | 1,093 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 26 11:56:59 2019
@author: Nikolai M Chapochnikov
This plots all the connectivity related plots in the paper
External files that are read and used for this plotting:
in plots_paper_import:
f'results/cons/cons_full_{k}.hdf'
'results/act3.hdf' FROM p... |
c6805bbffd754f72c494fcee230c71c78e049708de02f3e4e7483239cb527890 | Python | 41,982 | 1,150 | """ HRNet
Papers:
* `Deep High-Resolution Representation Learning for Visual Recognition` - https://arxiv.org/abs/1908.07919
* `Beyond Self-Supervision: A Simple Yet Effective Network Distillation Alternative to Improve Backbones` - https://arxiv.org/abs/2103.05959
Copied from https://github.com/HRNet/HRNet-Image-Cla... |
37daace6bd708494a2c4e1b5200b89c56cb01eef42c773eab30e759c4d12601d | Python | 42,118 | 1,219 | """
Poolformer from MetaFormer is Actually What You Need for Vision https://arxiv.org/abs/2111.11418
IdentityFormer, RandFormer, PoolFormerV2, ConvFormer, and CAFormer
from MetaFormer Baselines for Vision https://arxiv.org/abs/2210.13452
Papers:
* `MetaFormer Is Actually What You Need for Vision` - https://arxiv.... |
3e193695bfb3062e96911c052da1ca27abcb11ad3ee5de418e9bd41c4d471206 | Python | 42,126 | 895 | """test_align.py - test the Align module
"""
from io import StringIO
import numpy as np
from cellprofiler_core.constants.measurement import COLTYPE_INTEGER
from cellprofiler_core.measurement import Measurements
from cellprofiler_core.modules.align import Align
from cellprofiler_core.object import ObjectSet
from cellp... |
b3b3f0c9f985e9ef3a83b90e80576713c72e97c4a130b37db9a4af88cd3abec6 | Python | 42,178 | 1,177 | """ LeViT
Papers:
* `LeViT: a Vision Transformer in ConvNet's Clothing for Faster Inference` - https://arxiv.org/abs/2104.01136
@article{graham2021levit,
title={LeViT: a Vision Transformer in ConvNet's Clothing for Faster Inference},
author={Benjamin Graham and Alaaeldin El-Nouby and Hugo Touvron and Pierre S... |
cb8280d1ad4efae0d9dbcbc2c0a85749efcdf17a041bde1c99131cb488053aeb | Python | 42,272 | 1,169 | """ Multi-Scale Vision Transformer v2
Papers:
* `MViTv2: Improved Multiscale Vision Transformers for Classification and Detection` - https://arxiv.org/abs/2112.01526
@inproceedings{li2021improved,
title={MViTv2: Improved multiscale vision transformers for classification and detection},
author={Li, Yanghao and Wu,... |
ebd74d652bac2cd7e7c8b5f49dd3a58c1cf483213af32119c395ad2a1c44c72f | Python | 42,368 | 1,072 | """ Muon Optimizer
Improved Muon optimizer implementation with flexible handling of high-dimensional tensors.
Combines PyTorch-style structure with options for:
- Batched spatial processing for convolutions in addition to flatten
- Optional spatial normalization
- Selectable coefficient presets
- Automatic fallback t... |
b6b8faef63a36a9b7f1a75d519c1ff9bed702114f7489f2ef39292e06cf85975 | Python | 42,438 | 1,124 | from os import getcwd, makedirs
from os.path import basename, dirname, join, exists
from shutil import copyfile, copytree, rmtree
from tempfile import TemporaryDirectory
import nibabel as nib
import numpy as np
from traitlets import Dict, Instance, Unicode, Bool, Enum
from traitlets.config.loader import ArgumentError
... |
81e062ad6487be89778a77be669c1d1aeff53b67a9cf25dd038fe9fc80867f7e | Python | 42,548 | 1,121 | import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import scipy
import functools
import operator
from sklearn.cluster import KMeans
from collections import defaultdict
from pathlib import Path
# Data download URLs.
urls = {
'library1.csv': 'https... |
f98a64b1fda273f12baf42906ef76c3fba380331d81083f0dceb8376c5762127 | Python | 43,041 | 1,016 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
Wrapper classes for Cif input and output from Structures.
"""
import math
import os
import re
import textwrap
import warnings
from collections import OrderedDict, deque
from functools import partial
from i... |
8b9c63fe7eb872275eae9f8823414af39f04fb2321a9f988955406d747c4854d | Python | 43,070 | 1,129 | """
This file is subject to the terms and conditions defined in
file 'LICENCE', which is part of this source code package.
Author: Leo Guignard (leo.guignard...@AT@...univ-amu.fr)
"""
from qtpy.QtWidgets import QTabWidget, QVBoxLayout, QWidget
from magicgui import widgets
from ._umap_selection import UmapSelection
fro... |
f7144aa240b1b534ba48868fee5f587998aace9d77cc14833fc3594974653b9b | Python | 43,121 | 1,237 | # -*- coding: utf-8 -*-
# (C) Copyright 2020, 2021, 2022, 2023 IBM. All Rights Reserved.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... |
2eaf48b24eb2ad5a8170701e792e3617d570717c7af889821aa0b530f522cf97 | Python | 43,179 | 1,251 | import io
import centriole.propagate
import numpy
import scipy.stats
import cellprofiler_core.image
import cellprofiler_core.measurement
import cellprofiler_core.module
from cellprofiler_core.constants.measurement import COLTYPE_FLOAT
import cellprofiler.modules.measureobjectintensitydistribution
import cellprofile... |
f4ace4eb3cd9fa3d1ed09e3c7ec73bc74645189a50036e335017072e5bd0bbd6 | Python | 43,522 | 1,123 | # -*- coding: utf-8 -*-
# (C) Copyright 2020, 2021, 2022, 2023 IBM. All Rights Reserved.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... |
848afe553e31e58a4f876bde95399071b42f7c33ef40b108074175423324bc92 | Python | 43,555 | 1,130 | """
SaveImages
==========
**SaveImages** saves image or movie files.
Because CellProfiler usually performs many image analysis steps on many
groups of images, it does *not* save any of the resulting images to the
hard drive unless you specifically choose to do so with the
**SaveImages** module. You can save any of th... |
d754140357280176de8ce0f7172b402e67227dc89b7c29d934bcc02fe45bcc3d | Python | 43,867 | 1,369 | import fnmatch
import functools
import io
import ntpath
import os
import posixpath
import re
import sys
import weakref
try:
import threading
except ImportError:
import dummy_threading as threading
from collections.abc import Sequence
from collections import defaultdict
from contextlib import contextmanager
fro... |
085cad964f5d50dc12b03b63208abffd38bf84eedfc5774ce63f002ec8565b1c | Python | 43,950 | 1,170 | # -*- coding: utf-8 -*-
# (C) Copyright 2020, 2021, 2022, 2023 IBM. All Rights Reserved.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... |
5f4a8eeafee681f5d225b4364da710a9e17acf3167dd50235b7351f57628d9e1 | Python | 43,999 | 995 | """Input formats and read preprocessing.
Covers the read input formats (-q, --tab5, --tab6, --12, --qseq, -f, -r, -F,
-c, --interleaved, -b with --align-paired-reads and --preserve-tags), which
reads are aligned and how they are trimmed (-s, -u, -5, -3, --trim-to),
quality encodings (--phred33, --phred64, --solexa-qua... |
356c69f32544f9be07f6f4a046949f6b4e84c41f1be5931488e16551337a9a51 | Python | 44,294 | 930 | """
Author: "Keitaro Yamashita, Garib N. Murshudov"
MRC Laboratory of Molecular Biology
This software is released under the
Mozilla Public License, version 2.0; see LICENSE.
"""
from __future__ import absolute_import, division, print_function, generators
from servalcat.utils import logger
from servalcat.refmac imp... |
1519be3a005f77e702c782c43da0d0921b19a61ee8b7981261625b37e67beb69 | Python | 44,328 | 684 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Oct 10 18:30:46 2021
@author: fearthekraken
"""
import AS
import pwaves
import sleepy
import pandas as pd
#%%
### FIGURE 1C - example EEGs for NREM, IS, and REM ###
ppath = '/home/fearthekraken/Documents/Data/photometry'
AS.plot_example(ppath, 'ha... |
dc375bad1157ccf986c6be159b0687756a57cc24a61719d5d861d38d70db5afd | Python | 44,467 | 1,321 | """ EfficientViT (by MIT Song Han's Lab)
Papers:
* `EfficientViT: Multi-Scale Linear Attention for High-Resolution Dense Prediction` - https://arxiv.org/abs/2205.14756
Adapted from official impl at https://github.com/mit-han-lab/efficientvit
"""
__all__ = ['EfficientVit', 'EfficientVitLarge']
from typing import List... |
cccae7605aba9da78f373a8311ad7f12c1fda962e6de4e622dd8cf7437f5a3d4 | Python | 44,861 | 1,004 |
import json
import os
from datetime import datetime
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import Functions.globalFunctions.ExtracellularField as eF
import Functions.setup as stp
from Functions.globalFunctions.utils import Dict, MyEncoder
from Model import Cells
def _main_first_data... |
b84d440b00d39320b8f0d993a134667d5ffa10beefcb799add091393165b3531 | Python | 44,951 | 1,184 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import random
import pickle
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow import keras
from matplotlib import rc
import matplotlib
import matplotlib.ticker
import math
import scipy
rc("font", family="serif", serif="cm... |
ba1ecbb93d8e7ceb95f8971731fc6f3d249f351147d213b66d06487ee434cdfc | Python | 44,980 | 1,095 | """ Cross-Covariance Image Transformer (XCiT) in PyTorch
Papers:
- `XCiT: Cross-Covariance Image Transformers` - https://arxiv.org/abs/2106.09681
Same as the official implementation, with some minor adaptations, original copyright below
- https://github.com/facebookresearch/xcit/blob/master/xcit.py
Modificat... |
3a781da177b12d5f3ba6e7a2d5855617e31d7e66a51fdbc7601ee6256f532c54 | Python | 45,086 | 911 | """
Author: Mingjian He <mh1@stanford.edu>
dmap_em module contains dynamic source localization codes used in SOMATA
"""
import torch
import mne
import numpy as np
import numbers
from collections.abc import Iterable
from copy import deepcopy
from joblib import cpu_count
from somata.basic_models import StateSpaceModel
... |
71422bda4e23830a8983c92cf447bfd1aaf44365f0f856315c75fb046378352f | Python | 45,267 | 1,273 | #!/usr/bin/env python3
import re
import json
import argparse
import os
import sys
import csv
from copy import deepcopy
currentDirectory = os.getcwd()
# defines valid filetypes users can enter as an argument. As more files are supported,
# new filetypes must be added here.
fileTypes = {
"picard_alignment_su... |
3377484ac344e5665a0c2c1f502d015ae2ab86d165c62b5bbedef1ce2cd2f79a | Python | 45,456 | 1,189 | """CPUBone
CPUBone: Efficient Vision Backbone Design for Devices with Low Parallelization Capabilities
Moritz Nottebaum, Matteo Dunnhofer, Christian Micheloni
Conference on Computer Vision and Pattern Recognition (CVPR) Findings, 2026
Papers:
* `CPUBone: Efficient Vision Backbone Design for Devices with Low Paralleli... |
f115a9599cbb0cfc1d6eb86f246acb62feef0065a8759c2170c12b198161a419 | Python | 45,477 | 1,604 | """Graphical abstract for the AFIDs-Validator education paper.
A single composed figure, laid out like a journal page — reads top to bottom,
the way the paper argues:
01 THE DATA how the ground truth was made — 132 images, 492 expert
annotations, per-subject consensus, and the per-landmark... |
eb26c3927ee6bdcb824d07b9be8d4ef97e6019412ce3ae156796b8b068782c86 | Python | 45,480 | 1,307 | # coding=utf-8
"""artist.py - Specialized matplotlib artists for CellProfiler
"""
import centriole.cpmorphology
import centriole.outline
import matplotlib
import matplotlib.artist
import matplotlib.cm
import matplotlib.collections
import matplotlib.colors
import matplotlib.image
import numpy
import scipy.ndimage
impor... |
546d9851dcbdf913b122ebccf265b9c3024eece9d7661d265aac940f1aac7f1c | Python | 45,752 | 1,469 | import io
import centriole.filter
import centriole.otsu
import centriole.threshold
import numpy
import numpy.testing
import skimage.filters
import skimage.filters.rank
import skimage.morphology
import cellprofiler.modules.threshold
import cellprofiler_core.image
import cellprofiler_core.measurement
import cellprofile... |
b536cb58d73a37e2b23de2aec915a4bf593063d99c8d85318942416da65829c5 | Python | 45,954 | 1,038 | # coding=utf-8
"""ParameterSampleFrame.py - a window for specifying sampling options.
Author: AJ Pretorius
University of Leeds
a.j.pretorius@leeds.ac.uk
"""
import os
import traceback
import numpy
import skimage.io
import wx
import wx.lib.agw.floatspin
from cellprofiler_core.image import ImageSetLis... |
d807ae234b2b20545697781d8479934311f8c98b2aaf727a93f61b9c28e456e1 | Python | 46,187 | 1,501 | #!/usr/bin/env python3
"""
Runs all posible ciftify functions on some test data
Usage:
ciftify_intergration_tests [options] <testing_dir> <fixtures-dir>
Arguments:
<testing_dir> PATH The directory to run the tests inside
<fixtures-dir> PATH The directory with the csv to test the results against
Opti... |
592474a531fc9392f757c23c1c3687323c2e7682c0b3d87fc3af0935d61021ee | Python | 46,476 | 968 | import torch
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.colors import ListedColormap
from skimage import color, measure
from skimage.exposure import exposure
from torch_geometric.data import Data, Batch
from hausdorff import hausdorff_distance
from .losses import DiceCoeff, calculate_opt... |
a7785b509804792eaa3444bb7305b36f900f1005745fb10f611d8dea220f8ac0 | Python | 46,719 | 1,791 | # -*- coding: utf-8 -*-
import matplotlib as mpl
mpl.use('agg')
from matplotlib.testing.compare import compare_images
from tempfile import NamedTemporaryFile
import os.path
import pygenometracks.plotTracks
from pygenometracks.utilities import InputError
ROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)),
... |
73b4a51c0662dafb7f3f81779567aed8f86553166b9c6e22237c8f505832c252 | Python | 47,158 | 1,231 | """
DefineGrid
==========
**DefineGrid** produces a grid of desired specifications either
manually, or automatically based on previously identified objects.
This module defines the location of a grid that can be used by modules
downstream. You can use it in combination with **IdentifyObjectsInGrid**
to measure the si... |
3b674d6779bff2c37f6010269f8a6f631404a8503abb1ad49cedde3529fbdd8d | Python | 47,251 | 1,214 | """Pre-Activation ResNet v2 with GroupNorm and Weight Standardization.
A PyTorch implementation of ResNetV2 adapted from the Google Big-Transfer (BiT) source code
at https://github.com/google-research/big_transfer to match timm interfaces. The BiT weights have
been included here as pretrained models from their origina... |
06a1876d48e299cdbf608b2de07800845b5292d84d69d6572768b352c846fc75 | Python | 47,285 | 1,300 | """PyTorch CspNet
A PyTorch implementation of Cross Stage Partial Networks including:
* CSPResNet50
* CSPResNeXt50
* CSPDarkNet53
* and DarkNet53 for good measure
Papers:
* `CSPNet: A New Backbone that can Enhance Learning Capability of CNN` - https://arxiv.org/abs/1911.11929
* `YOLOv3: An Incremental Improvement` - ... |
7d7d04bf4e2e3f5e2e44a2491b00c8893fa1f889dcf98abb8490de69db763eeb | Python | 47,379 | 1,151 | """test_worker.py - test the analysis client framework"""
import io
import queue
import time
import os
import pytest
import pickle
import tempfile
import threading
import traceback
import unittest
import uuid
import zlib
import numpy
import zmq
import cellprofiler_core.analysis
import cellprofiler_core.analysis.reply ... |
7dc58c86db99b354ed98688e0048bb0e59dd520bca000604c4a94bf4b52e91c1 | Python | 47,789 | 1,179 | """Alignment, scoring, reporting and effort options of bowtie2.
Reads are cut from fixed random references at known positions, with
substitutions, Ns, insertions and deletions placed at known offsets, so the
expected POS, strand, CIGAR, MD, NM, XM, XO, XG and AS of each alignment are
computed here from the MANUAL's sc... |
7567e216fd94cf45060130e0088f53666cad797e1c57422027f1670dcafe6012 | Python | 47,929 | 1,056 | """Paired-end alignment tests for bowtie2.
Every pair is cut from the fixed random `genome` (conftest.py) at a known
position, orientation and fragment length, so the expected FLAG, POS, RNEXT,
PNEXT, TLEN and YT:Z of both mates are derived here before bowtie2 runs. The
same applies to the classification of overlappin... |
363b60d77c825daacd307e4312416007e904d201fd40def33b225eaafca7b5d1 | Python | 47,954 | 1,156 | """
Contains functions and classes that are olfactory-specific.
@author: Nikolai M Chapochnikov
"""
# ################################# IMPORTS ###################################
import copy
import itertools
import sys
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
i... |
d59c0c36219c0781b040f95f17b180adf32e6946ac6ab66890fc41b22a997246 | Python | 48,209 | 1,172 | """ BEiT: BERT Pre-Training of Image Transformers (https://arxiv.org/abs/2106.08254)
Papers:
* `BEiT: BERT Pre-Training of Image Transformers` - https://arxiv.org/abs/2106.08254
* `BEiT v2: Masked Image Modeling with Vector-Quantized Visual Tokenizers` - https://arxiv.org/abs/2208.06366
Model from official so... |
08f672f879a4330e4154ea709d1aac3873c203588786a25bf8f5a629d58f0945 | Python | 48,224 | 1,140 | """
CorrectIlluminationCalculate
============================
**CorrectIlluminationCalculate** calculates an illumination function
that is used to correct uneven illumination/lighting/shading or to
reduce uneven background in images.
This module calculates an illumination function that can either be saved to the
hard... |
8074b0aecf44608032dcc40b73238e56a345865f67cbb0764a4f3250fdbb5c75 | Python | 48,451 | 1,179 | # SEP 8 version
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import init
import functools
from torch.optim import lr_scheduler
import numpy as np
from util.util import noisy
###############################################################################
# Helper Functions
##########... |
5245c4e10bc21add17400291d46e7c7a563a20d0c30bf0111268ef6753f3c039 | Python | 48,525 | 1,162 | """Topic modeling with generalized correspondence latent Dirichlet allocation."""
import logging
import os.path as op
import nibabel as nib
import numpy as np
from nilearn.image import load_img
from numba import njit, prange
from nimare.base import NiMAREBase
from nimare.utils import _mask_img_to_bool, get_template
... |
f478cca716c2cc8dcd056450833832c73d8217a4c8bcbfbac5aaafafe63c16f9 | Python | 48,652 | 1,226 | import numpy
import pytest
from six.moves import StringIO
import cellprofiler_core.image
import cellprofiler_core.measurement
import cellprofiler.modules.correctilluminationcalculate
import cellprofiler_core.modules.injectimage
import cellprofiler_core.object
import cellprofiler_core.pipeline
import cellprofiler_core.... |
2669658874482572bf585ebb3b23d14d639e1ce262ca674bd013768c72ba7dfb | Python | 48,975 | 1,365 | """Miscellaneous spatial and statistical transforms."""
import logging
import os
import os.path as op
import warnings
import nibabel as nib
import numpy as np
import pandas as pd
from nilearn.reporting import get_clusters_table
from scipy import special, stats
from nimare.base import NiMAREBase
from nimare.studyset ... |
6953fe4a10d7642387b77cf22b045541ffc9bd68cc2551f3865403b3ebc23c5b | Python | 48,986 | 1,179 | import os, warnings
import tonic
from tonic import DiskCachedDataset
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.data import create_transform
from torchvisi... |
0fab2d2b69408c172d419076c964e8cf29e2afa0920315bf69a644ca96979c6a | Python | 49,011 | 1,502 | """
pysteps.nowcasts.linda
======================
This module implements the Lagrangian INtegro-Difference equation model with
Autoregression (LINDA). The model combines extrapolation, S-PROG, STEPS, ANVIL,
integro-difference equation (IDE) and cell tracking methods. It can produce
both deterministic and probabilistic... |
a676d6713d076227287becbf589804648fe9cec7fa4dd001a87af542f9f65c6d | Python | 49,066 | 1,305 | from __future__ import absolute_import
from __future__ import division
import base64
import sys
import numpy as np
from scipy.ndimage import binary_dilation, binary_erosion, convolve
import unittest
import pytest
import centriole.filter as F
"""Perform line-integration per-column of the image"""
VERTICAL = "vertical... |
ee2538aec6066acd844ce2d7ff8ccc5f505ab2e76ef04d8e3c9afbb5ef23a1d9 | Python | 49,094 | 1,069 | import torch
import torch_geometric.transforms as T
import torch.nn.functional as F
from torch_geometric.utils import normalized_cut, scatter_
# from torch_scatter import scatter as scatter_
from torch_geometric.data import Data, Batch
from torch_geometric.nn import graclus, max_pool, avg_pool, fps, radius, knn_interpo... |
ee95facc4686d948e193c408b41cf126ec8466de7cceed1f0d41c03ec8ff08ae | Python | 49,119 | 718 | #### Master Script 05d: Compile TimeSHAP values calculated in parallel ####
#
# Shubhayu Bhattacharyay
# University of Cambridge
# email address: sb2406@cam.ac.uk
#
### Contents:
# I. Initialisation
# II. Compile TimeSHAP values and clean directory
# III. Create bootstrapping resamples for calculating feature robustnes... |
390581b78d5d5637f1e8b7668cb638187570187e999d6b64f870356101018ae2 | Python | 49,423 | 1,019 | import argparse
import time
import timm.models
import yaml
import os
import random as buildin_random
import logging
from collections import OrderedDict
from contextlib import suppress
from datetime import datetime
from braincog.base.node.node import *
from braincog.utils import *
from braincog.base.utils.criterions i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.