sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
6bf1e764b9cc692bb8660f25355c61e9eb2aa83bcf957674dd4a6ce28b3bf1f4 | Python | 53,697 | 1,666 | from matplotlib import pyplot as plt
from matplotlib.axes import Axes
from matplotlib.figure import Figure
import matplotlib
import pandas as pd
import numpy as np
import networkx as nx
import math
import matplotlib.patches as patches
from numba.typed import List
import seaborn as sns
import sys
from anndata import Ann... |
87f92236813bb5654c0b79114583eb563c7669e57c3d78e45468a610965aa6ea | Python | 53,817 | 1,495 | """
paper_organization.py
This script contains functions and objects for linking analyses to the paper
structure.
Authors: Colleen Gillon
Date: January, 2021
Note: this code uses python 3.7.
"""
from collections import namedtuple
from pathlib import Path
import time
from util import gen_util, logger_util, rand_u... |
bc51fa51db13c4419c4f1670aa834dda92225964e19668abbaeff7401cf405c0 | Python | 53,980 | 1,401 | import functools
import os
from collections.abc import Callable
import numpy as np
import pytest
from absl.testing import parameterized
import keras
from keras.src import backend
from keras.src import layers
from keras.src import models
from keras.src import ops
from keras.src import random
from keras.src import savi... |
8dd22b4e042838764e2fc7812fb844d971e4e51cdaccf21bc6d8432f6db16a5e | Python | 53,983 | 1,535 | import os
from typing import Any, Dict, List, Optional, Tuple, Union
import networkx
import numpy as np
import pandas as pd
import scipy.sparse as sp
import torch
from anndata import AnnData
from numpy import ndarray
from scipy.linalg import pinv
from scipy.sparse import issparse
from scipy.special import psi
from skl... |
8db76291443a485681ac03443f42a36eb238c8c3b31640abb7fffbff455f6673 | Python | 54,108 | 1,685 | import math
import jax
import numpy as np
from jax import lax
from keras.src import backend
from keras.src.backend.common import dtypes
from keras.src.backend.common import is_float_dtype
from keras.src.backend.common import standardize_dtype
from keras.src.backend.common.backend_utils import canonicalize_axis
from k... |
e589f40c04b356090b47f20ca84569fac3081c2df4b6e3b0536713955bc30bac | Python | 54,134 | 1,309 | from __future__ import annotations
import re
import typing
from collections.abc import Callable
from collections.abc import Sequence
from itertools import pairwise
from PySide6 import QtCore
from PySide6 import QtGui
from PySide6 import QtWidgets
from .. import _locale
from .._config import RGB_CHANNEL_COUNT
from ..... |
20c894db3e05b588d5edcb0b20ccfb849a5ae1c6f3e923f782dc120e00be3428 | Python | 54,172 | 1,461 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Aaxis(_BaseLayoutHierarchyType):
_parent_path_str = "layout.ternary"
_p... |
24cc79ac86269abb51a390f2a80ab8845343bf10919518278d70a3fb969b6ae8 | Python | 54,172 | 1,461 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Caxis(_BaseLayoutHierarchyType):
_parent_path_str = "layout.ternary"
_p... |
3a35d4b3e263f6213cb91fa0f19e7062e63cf55db9ae8d7b41304a82eefad5f5 | Python | 54,172 | 1,461 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Baxis(_BaseLayoutHierarchyType):
_parent_path_str = "layout.ternary"
_p... |
099e8dea31c6b55065003cb5c62132893cb51eec9cbe648cad7ac6b97caecc19 | Python | 54,281 | 1,974 | import gc
import importlib.metadata
import re
import typing as t
import uuid
import weakref
from contextlib import nullcontext
from datetime import datetime
from datetime import UTC
from functools import partial
from platform import python_implementation
import pytest
import werkzeug.serving
from markupsafe import Mar... |
e00595093f2873a17cf0d6962372412542f427172eba055201d83332c6c46e89 | Python | 54,389 | 1,334 | #!/usr/bin/env python
# =============================================================================
# MODULE DOCSTRING
# =============================================================================
"""
Utility classes to store potential energies and CVs necessary for TFEP.
The module provides a class :class:`.TF... |
744a0d2513c6c0b05216ec42da0024a70a3ed24afa77cb5ea81968b94cf6321a | Python | 54,453 | 1,432 | # Author: Christian Brodbeck <christianbrodbeck@nyu.edu>
"""I/O for MNE"""
from collections.abc import Iterable
import fnmatch
from itertools import zip_longest
from logging import getLogger
from math import floor
import os
from pathlib import Path
import re
from typing import Any, List, Literal, Optional, Sequence, Tu... |
8b2edfe6030469685bdb0c9b320844a948f320e03742d4a96058b58a816235b0 | Python | 54,472 | 1,442 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseTraceType as _BaseTraceType
import copy as _copy
class Densitymap(_BaseTraceType):
_parent_path_str = ""
_path_str = "densitymap"
_valid_props... |
be6e88c7d9f122aa5ab29ff5946f6270af0b580e4403351b869f1330b71ca53c | Python | 54,497 | 1,249 | # Copyright (c) 2025, Jay Shah, Ganesh Bikshandi, Ying Zhang, Vijay Thakkar, Pradeep Ramani, Tri Dao.
# A reimplementation of
# https://github.com/Dao-AILab/flash-attention/blob/main/hopper/flash_fwd_kernel_sm80.h
# and https://github.com/Dao-AILab/flash-attention/blob/main/hopper/flash_fwd_kernel_sm90.h
# from Cutlass... |
5013ba3179a931566167ae5d094ed65690cf537ab9b05959ff85c8bb051b6fa2 | Python | 54,567 | 1,470 | """
Unit tests for Setup API endpoints.
Tests installation wizard functionality including system setup, user management,
incubator configuration, notifications, tunnel setup, and virtual sensors.
"""
import json
import socket
import tempfile
import unittest
from unittest.mock import MagicMock, Mock, call, mock_open, ... |
c0858286e38fe5a434358843dd6391df0f6142f161b8e94abcfc57889c2f41ea | Python | 54,656 | 1,645 | import abc
import collections.abc
from rpy2.robjects.robject import RObjectMixin
import rpy2.rinterface as rinterface
import rpy2.rinterface_lib.conversion
import rpy2.rinterface_lib.memorymanagement
import rpy2.rinterface_lib.openrlib
from rpy2.rinterface_lib import sexp
from . import conversion
import rpy2.rlike.con... |
b30b1595174320dff62bc62875723a306fac65577d35deb076b991f51c8193f3 | Python | 54,712 | 1,369 | """
Graphical reconstruction widget for OPT/CT tomography inside Napari.
This module defines a full-featured Qt-based reconstruction interface for
Optical Projection Tomography (OPT), including:
• Basic and advanced reconstruction modes
• GPU/CPU Filtered Backprojection (FBP)
• TwIST, UNet, and ToMoDL deep-le... |
160c78473cd2b79207da66cd4fbd084c33069c582803942985fbab0a211b773a | Python | 54,790 | 1,152 | """Directpose outputs"""
# pylint: disable=line-too-long, redefined-builtin, missing-class-docstring, unused-variable, consider-using-enumerate,unused-argument
import logging
import os
from typing import List
import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
from torchvision.ops impor... |
d4e9b641062c3590f0562b022ede18cacc81122a99c70d0442440018032b3079 | Python | 54,794 | 1,597 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseTraceType as _BaseTraceType
import copy as _copy
class Contourcarpet(_BaseTraceType):
_parent_path_str = ""
_path_str = "contourcarpet"
_valid... |
16a2add721345bc8b85c6d059fec2e3eafff419c9b21e3d930550f20bb5ff49a | Python | 54,857 | 1,580 | """
Helper methods used for importing data
"""
from __future__ import annotations
from collections import OrderedDict
from contextlib import contextmanager
from pathlib import Path, PurePosixPath
from typing import Any, Dict, Iterator, List, Optional, Sequence, Tuple
import glob
import os
import os.path
import re
imp... |
b6a4d2afd29245204053d5027e53f9e9b39937159a94ea20f9dbfb4389605b41 | Python | 54,899 | 1,395 | """Assemble OSM records from (possibly modified) GeoDataFrames and write them to
a PBF (issue #285).
``pyrosm.OSM.write_pbf`` is a thin wrapper over :func:`write_geodataframe_to_pbf`
here; the per-row tag extraction, the whole-dataset record assembly, and the
vertex-synthesis of new geometries (approach B) all live in... |
20729201826b1c4a2037a4cb2812c7425cc6345d40c2cab0767ffed50ef3e5be | Python | 54,972 | 1,241 | """State-metadata witness net == FULL input-net parity (r65 Cluster X) -- anti-edge pins.
Round-64 (both labs) proved the r63 state-metadata net mirrored only 5 of the input net's 20
accessors, leaving an "Nth unwitnessed state read" CLASS open (F2: zero-copy view exports leak
stride/offset with no accessor call; F3: ... |
e6df29c04d4e07843783ddcecb5af33f2683ef3a7d930b0e46945f206f4c9e09 | Python | 55,017 | 1,502 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseTraceType as _BaseTraceType
import copy as _copy
class Ohlc(_BaseTraceType):
_parent_path_str = ""
_path_str = "ohlc"
_valid_props = {
... |
b2c1222e52b2e632660970a2defc290a2de624357c055fe1d1d76097d6de23ed | Python | 55,303 | 1,016 | #!/usr/bin/env python3
"""plot_regions.py
Top level command-line interface for generating plots related to the
2D alignment and montaging of sections.
Copyright (C) 2018-2026 Max Planck Institute for Neurobiology of Behavior
This program is free software: you can redistribute it and/or modify it under
the terms of... |
424d921a1f9c1e8afba3878a57dd8592341f559797349d4f97b7eea88693f282 | Python | 55,337 | 1,552 | """Portable state rehydration for TorchLens model logs.
This module restores scrubbed portable metadata into working TorchLens object
graphs. It rebuilds eager or lazy tensor fields from ``BlobRef`` placeholders,
reconstructs accessors, and supports the expert nested-materialization flow
used by ``torchlens.load(..., ... |
ea70129cb32202ef525dffb8633ff053f20f9e768aa166bf36afe5adab33d220 | Python | 55,346 | 1,205 | import json
import logging
import time
from typing import (
Any,
cast,
NoReturn,
TYPE_CHECKING,
)
from urllib.parse import (
quote,
urlencode,
)
import jwt
from jwt import InvalidTokenError
from msal import ConfidentialClientApplication
from social_core.actions import (
do_auth,
do_comp... |
a334fbcd49b733867f28625ca4bdc0ad528ae6dba0ea1f668d99282520e0e2dc | Python | 55,383 | 1,504 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseTraceType as _BaseTraceType
import copy as _copy
class Candlestick(_BaseTraceType):
_parent_path_str = ""
_path_str = "candlestick"
_valid_pro... |
5e62b3d18ccd51865d5fc49a23269cc9a326f02b48b8f7700980913c2be862a6 | Python | 55,739 | 1,420 | """
Keeps the older BaseController security and fetching methods and also
defines a base ModelManager, ModelSerializer, and ModelDeserializer.
ModelManagers are used for operations on models that occur outside the scope of
a single model object, such as:
- object creation
- object lookup
- interactions between 2+ obj... |
6ed652e38e2ee18ad2032b1ffa05d5f1bdc863fb6b8b7381fb76f24be9484d73 | Python | 55,743 | 1,204 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# RIESLING: Rapid Identification of Enhancers Linked to Nearby Genes
#
# This is a pipeline to rapidly identify super-enhancers, stretch enhancers, or other
# interesting properties of enhancers based on ATAC-seq data. This is likely applicable to
# other similar data typ... |
baae2413c7ad1b8acf6000ef18812c50d8f52b39981b81702cc22a0811f88094 | Python | 55,785 | 1,305 | # Copyright (c) 2026, Colfax International.
"""
CuTe DSL implementation of dQ+dQv gemm for DSA backward.
Performs both dQ = dS @ K and dQv = dS @ V, where K and V are
gathered according to index tensor mIdxTopK.
This uses MQA with 1 to 128 heads and a fixed 128-row GEMM tile.
Inputs:
- dS: [batch, seqlen_q,... |
d0dddae25dd63b3aa8e217c017ea1e1cbac08be415e18d0470b5af8960fd81e8 | Python | 55,808 | 1,686 | """
Configuration and Generator classes for higher-order objects in the larvaworld package.
"""
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional
import inspect
import os
import shutil
from pathlib import Path
import numpy as np
import pandas as pd
import param
from ... import CONFT... |
c5577d8584c2b6833d2d8f207e3fcad1e69652eafce1655262e68da10d3680f6 | Python | 55,813 | 1,331 | from __future__ import print_function
import glob
import matplotlib.pyplot as plt
#from numba import jit
#from numba import njit
import numpy as np
import pickle
import random
from matplotlib import ticker
import scipy.sparse as sps
import scipy.sparse.linalg as spsl
import os
### Load files ####
def load_HILLS_2D(... |
fef324359d9fe7386b077922c869bf003475f1ba8181ad1f0802f85934439bf7 | Python | 55,852 | 1,564 | """Utils for working with SSL models"""
# Copyright (c) 2020. Lightly AG and its affiliates.
# All Rights Reserved
from __future__ import annotations
import math
import random
import warnings
from typing import TYPE_CHECKING, Dict, Iterable, List, Optional, Tuple, Type, Union
import numpy as np
import torch
import t... |
f470e92918087ecbb41800af0334f3c23239976204ee683d2ae4179aba71fe7d | Python | 55,857 | 1,352 | """Miscellaneous project utilities: FR_Module base class, config I/O, system info, batch launcher.
Contains the shared ``FR_Module`` base class (save config / run_info / run_data
for every pipeline stage), YAML helpers, matplotlib -> numpy array helpers, a
system-info collector used to snapshot the environment in run_... |
c679e243918af2638dc39507a63832760c3ee8c6d27e293e7c3049e8d92cc621 | Python | 55,922 | 1,353 | # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
45d0913d60b78c28a293ab8d90187881af6921c8a21fe552968a1e259720740c | Python | 55,923 | 1,277 | """Loaded-sparse transaction execution and allocation checks."""
from __future__ import annotations
from collections.abc import Callable, Mapping
from contextlib import nullcontext
from dataclasses import dataclass
from typing import TYPE_CHECKING, Any, cast
import torch
from . import _state
from ._runnable_state i... |
6d58a19b7ef7f3499e6974ab4c712707979716d3698ce79afc47b32727deb8c6 | Python | 56,097 | 1,173 | import os
import math
import itertools
import pytest
import torch
import torch.nn.functional as F
from torch._C import parse_schema
from einops import rearrange, repeat
try:
from flash_attn.layers.rotary import apply_rotary_emb
except ImportError:
apply_rotary_emb = None
from padding import pad_input, unpad_... |
911096916c1182b56c68abea632f083f09c5cd8f64261b00bcb75f1d152fa037 | Python | 56,196 | 1,250 | import inspect
import platform
import warnings
from keras.src import backend
from keras.src import metrics as metrics_module
from keras.src import ops
from keras.src import optimizers
from keras.src import tree
from keras.src.backend.common import is_float_dtype
from keras.src.backend.common import standardize_dtype
f... |
c9f5c42c1ae67acc2c6a7faab9029dbeadbe77bf739939ce9a6714689308433f | Python | 56,345 | 1,495 | """Tests of ts group for `pynapple` package."""
import pickle
import re
import warnings
from collections import UserDict
from contextlib import nullcontext as does_not_raise
from pathlib import Path
import numpy as np
import pandas as pd
import pytest
import pynapple as nap
@pytest.fixture
def group():
"""Fixt... |
8d2621c3ad0e758dd433150587fb5b66ad198a749691c1030110cce8ad7433c5 | Python | 56,404 | 1,321 | import math
import os
import re
from typing import List, Optional, Union
import anndata
import matplotlib as mpl
import numpy as np
import pandas as pd
import plotly.graph_objs as go
from pyvista import MultiBlock, Plotter, PolyData, UnstructuredGrid
try:
from typing import Literal
except ImportError:
from ty... |
a9c0f4dd4d9f58bac69d07ba9156f15a596825d92e8e430b20bd5ccbd18cdf61 | Python | 56,480 | 1,307 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
from __future__ import absolute_import, division
from tqdm.auto import tqdm
import torch
import torch.nn.functional as F
from trainingUtils import MultipleOptimizer, MultipleScheduler, compute_kernel, compute_mmd
from models import Decoder, SimpleEncoder,LocalDiscrimina... |
cafdd3d9c5449e38493cddcbaf354db143fa1268a6c95bddcbee608d258cf2c3 | Python | 56,482 | 1,779 | #!/usr/bin/env python
# Created on: October 7, 2013
__author__ = "Sven Kreiss, Kyle Cranmer"
__version__ = "0.1"
import optparse
parser = optparse.OptionParser(version=__version__)
parser.add_option("-i", "--input", dest="input", default="invalid.root", help="Input root model.")
parser.add_option("-w", "--wsName",... |
456540d076735dee62bf3e82a76fe873822e07488dccfe7571e75c3abf84c37d | Python | 56,512 | 1,551 | import copy
import itertools
import os
import pprint
import time
from collections import defaultdict
from typing import Optional, Union, Tuple
import numpy as np
import pandas as pd
import scanpy as sc
import torch
from torch.distributions import (
NegativeBinomial,
Normal
)
from cpa.train import evaluate, pre... |
ac5839bdb77fff2863be183c42a0167042d99270f8d6576d4af40727a601933e | Python | 56,512 | 1,359 | """Image writer utility"""
import logging
import warnings
from collections.abc import Sequence
from pathlib import Path
from typing import Any, Literal, cast
import dask.array as da
import numpy as np
import zarr
from numcodecs import Blosc
from zarr.storage import StoreLike
from . import USE_DASK_ARRAY_KWARGS
from ... |
99aee4211a63a8dbe9a9c14d7e7694faf5405054a0bf95fdea74742246f5f93a | Python | 56,535 | 1,647 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Utilities for fmriprep bids derivatives and layout.
Most of the code is copied from niworkflows.
A PR will be submitted to niworkflows at some point.
"""
import copy
import os
import warnings
from path... |
e85d5c57549ac39e83c7219d6c49f1741cc655784242cdfbbf87027a18095622 | Python | 56,571 | 1,345 | import math
import uuid
from collections.abc import Iterable
import pytest
from celery import Task
from celery.canvas import Signature, StampingVisitor, _chain, _chord, chain, chord, group, signature
from celery.exceptions import Ignore
class LinkingVisitor(StampingVisitor):
def on_signature(self, actual_sig: S... |
5db18c420b9b6f530a123752963ee53e67b7c08d2fc98baf7f34da57cee33c73 | Python | 56,613 | 1,173 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
"""Monte Carlo fuzzing of the `yolo` CLI to find bugs outside the finite test matrix.
Runs randomized/mutated `yolo` commands in subprocesses, classifies every outcome (pass, expected cfg error,
environment skip, network flake, hang, crash, bug candid... |
721c47f223ca8928493ccd227addc32ec9944de7239371614363e048830a6254 | Python | 56,673 | 1,248 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
from __future__ import annotations
import functools
import gc
import math
import os
import random
import time
from contextlib import contextmanager
from copy import deepcopy
from datetime import datetime
from pathlib import Path
from typing import An... |
3719913742315b9b489f00c5e6a7d2a48dbfd1368f6c2dda794910607c5aa57a | Python | 56,741 | 1,397 | from __future__ import print_function
from scipy import special, spatial
from sklearn.neighbors import BallTree, NearestNeighbors
from sklearn import metrics
from sklearn.preprocessing import OneHotEncoder, MinMaxScaler
from sklearn.utils.extmath import cartesian
import numpy as np
import math
import warnings
from tig... |
3f90c2a50c09a24d5129bbc288a1d133d0c7cf8c7350285a87f76343dc15ddac | Python | 56,800 | 1,382 | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/SequencePlot.ipynb (unless otherwise specified).
__all__ = ['format_uniprot_annotation', 'ptm_shape_dict', 'get_plot_data', 'plot_single_peptide_traces',
'custom_color_palettes', 'uniprot_color_dict', 'aa_color_dict', 'get_quality_category',
'get_ex... |
d24cd569251f23c70cbba51f3bda378d6ede4a87bfae98f01abbd3aac358ce7c | Python | 56,817 | 1,600 | """
Unit tests for backup helpers module.
Tests cover:
- Utility functions (get_sqlite_table_counts, calculate_backup_percentage)
- BackupStatus dataclass
- Backup file locking mechanisms
- Backup completion tracking functions
- BackupClass initialization and validation
- get_device_backup_info function
"""
import da... |
73780df6cc6557bdcef8bb3bd159a2560a968b94decd0751963b527258c1f7bb | Python | 56,883 | 1,322 | # -*- coding: utf-8 -*-
"""
Created on Fri Aug 26 10:14:33 2022
@author: LABadmin
"""
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import rc
from matplotlib import cm
import random
import sklearn
import scipy as sp
from scipy import signal
from sklearn.linear_model import LinearRegression
... |
971c72f64f868dbcb307dffa8382d402c9bc7cfe17fae5f89c85f6d4d76980a9 | Python | 56,900 | 1,275 | """Wrap-history compatibility batteries: torch meta-APIs and identity bases.
Regression batteries for the wrap-state identity class (R55/R56/R78 family):
1. ``R55.defaults`` scan — walk every loaded ``torch.*`` module for function
defaults frozen to a wrapped original at torch-import time. The class is
closed (... |
b81b83354a936cc34661c3b83e86e41e402cc886d42324411950f010439194d4 | Python | 56,994 | 1,466 | '''
Copyright 2021 Twente Medical Systems international B.V., Oldenzaal The Netherlands
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless requir... |
c1a3eafe305b4e414d42c39cafe74643b4b8a7240b0bf398e6ba8193ee8030a0 | Python | 57,015 | 1,497 | """Field-catalog lockstep ENFORCEMENT (grind r2 row 20 / matrix R11).
The recurring incident class this module exists to end: a field catalog, its
owning record class, the generated artifacts derived from it, and the version
authorities that gate its persistence drift apart between efforts. Round 81
found ~52 such dri... |
065bd2a5a3250b7a57eada457854f172cf7b7c95f0bde6e07d7fa730cc80538f | Python | 57,045 | 1,600 | import logging
import os
import re
from collections.abc import Callable
from galaxy.datatypes import metadata
from galaxy.datatypes.binary import Binary
from galaxy.datatypes.data import (
get_file_peek,
Text,
)
from galaxy.datatypes.metadata import MetadataElement
from galaxy.datatypes.protocols import (
... |
821b50117a5e068e9f92a9ae5fdf4fd19f0134f4a546ebb5b09c45ae30a5c19f | Python | 57,063 | 1,506 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseTraceType as _BaseTraceType
import copy as _copy
class Scattermap(_BaseTraceType):
_parent_path_str = ""
_path_str = "scattermap"
_valid_props... |
77c333b680eb6143f2a69ba9e663a32aeed8515ab0dc9ab91ef6699934265485 | Python | 57,079 | 1,406 | '''The class Brains is made available in the wormbrain namespace.'''
import numpy as np
import matplotlib.pyplot as plt
import mistofrutta.struct.irrarray as irrarray
from copy import deepcopy as deepcopy
import ujson as json
import re
import pkg_resources
import wormbrain as wormb
import os
import pickle
class Brain... |
3860777e97f640614b4690eecb7e2096084a77ef24de65644b11d846d7945c30 | Python | 57,097 | 1,520 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseTraceType as _BaseTraceType
import copy as _copy
class Choroplethmap(_BaseTraceType):
_parent_path_str = ""
_path_str = "choroplethmap"
_valid... |
4cc7a75ba38afe12134a1f9eaa0ef669c4c919a6e213aa872ce2de2beec98ba7 | Python | 57,270 | 1,601 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" General helper functions
"""
import warnings
import numpy as np
import pandas as pd
import random
from scipy.interpolate import interp1d
from scipy.special import comb
from scipy.stats import pearsonr, vonmises, norm, ranksums, f as fdist, fisher_exact
from scipy impo... |
64dc04b37c9ff2595f52d61f67cfe92e6316e8181392ca10bb59e9a4a5e6b257 | Python | 57,310 | 1,514 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseTraceType as _BaseTraceType
import copy as _copy
class Treemap(_BaseTraceType):
_parent_path_str = ""
_path_str = "treemap"
_valid_props = {
... |
4d38ab6eda3a16ea9639c848a2a835480b57428df953c31a7c84838b0f13cdc5 | Python | 57,330 | 1,265 | # pylint: disable=line-too-long,too-many-lines,missing-docstring,arguments-differ,unused-argument
# Code adapted from https://github.com/open-mmlab/mmaction.
__all__ = ['I3D_ResNetV1', 'i3d_resnet50_v1_kinetics400', 'i3d_resnet101_v1_kinetics400',
'i3d_nl5_resnet50_v1_kinetics400', 'i3d_nl10_resnet50_v1_kin... |
24a23bb1b0cde1d0d6e6a93b8504d8093a7ab99e8f082ef61ec1daf7f7beb1f6 | Python | 57,484 | 1,288 | # Copyright (c) 2026, Colfax International.
"""
CuTe DSL implementation of the dQ+dQv gemm of the sparse-MLA (DSA) backward for up to
64 Q heads per KV head (see AI/SPARSE_MLA_64H.md, "dQdQvGemmKernelH64"). Fewer heads pad the 64-row
tile: the head mode has the real (dynamic) extent, so TMA zero-fills the dS rows past... |
d540f78db8c46ebd74f419e2a9e0274f36ce8a8a1a9ad62933b75c070f1859f0 | Python | 57,553 | 890 | import os
# Set direct paths for the system being used
MODEL_BASE_PATH = os.path.dirname(os.path.abspath(__file__))
VISION_TURK_WEB_PATH = 'https://mcdermottlab.mit.edu/mturk_stimuli/imagerec_robust_models_v1/'
AUDIO_TURK_WEB_PATH = 'https://mcdermottlab.mit.edu/mturk_stimuli/audio_word_rec_metamers/'
from analysis_s... |
667ddf7fdc5ad1442e97f21a5bbecd5e0245110a9930f1ae55facea17cdccb90 | Python | 57,661 | 1,329 | # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
f59631adf462c7594d5427e319403c714a3e19db1d506e4a2642d18cead5c73d | Python | 57,693 | 1,531 | """Unit matrix for the C1 merge derivation over synthetic rank evidence.
Pure-function tests of ``torchlens.merged._engine.derive_merge`` (no process
groups, no torch.distributed init): the PRE-JOIN audit matrix (merge-side
rows of design-merge-ranks-c v5, 1.3), seq-delta alignment, relation and
cross-check conflicts,... |
c3ea5a30b48c7361af7c451f565d67b3e19bdd71e7f6b8ce9b17c7825ac54976 | Python | 57,970 | 1,534 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseTraceType as _BaseTraceType
import copy as _copy
class Choropleth(_BaseTraceType):
_parent_path_str = ""
_path_str = "choropleth"
_valid_props... |
2893f380ead6d1d2700e29cb5912efc2191a26f9e08b43139d06b7bb3c6ea256 | Python | 58,066 | 1,541 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseTraceType as _BaseTraceType
import copy as _copy
class Icicle(_BaseTraceType):
_parent_path_str = ""
_path_str = "icicle"
_valid_props = {
... |
fc269f0214857a4c41be95b06d742eeae5f927e8a29dd2bc060388ef263db2e2 | Python | 58,075 | 1,846 | """JAX backend capture tests."""
from __future__ import annotations
import json
from collections import OrderedDict
from collections.abc import Callable
from pathlib import Path
from types import SimpleNamespace
from typing import Any, cast
import pytest
import torchlens as tl
from torchlens.backends import Backend... |
bc8bf622265f4da7f80228703a546414d419ada174254328612df78647d41812 | Python | 58,095 | 1,535 | """Adversarial coverage for the opt-in aten completeness witness."""
from __future__ import annotations
import ast
import inspect
import textwrap
import warnings
from collections.abc import Callable, Iterator
from pathlib import Path
from types import SimpleNamespace
import pytest
import torch
import torch.nn.functi... |
a04426ce437730e9265d8e5a5740a03cbd806c7be01fb275def81c7e08b3126e | Python | 58,165 | 1,500 | """Version of multiprocessing.Pool using Async I/O.
.. note::
This module will be moved soon, so don't use it directly.
This is a non-blocking version of :class:`multiprocessing.Pool`.
This code deals with three major challenges:
#. Starting up child processes and keeping them running.
#. Sending jobs to the p... |
a1ee31ea41aba5c0444f924144fb91d004f040ef27cad97c6c317911edda7911 | Python | 58,185 | 1,268 | # Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
fc3a895701c0d4609ddb9d083d448e7582472068304358f7a34b0cff8b2c6e9d | Python | 58,327 | 1,263 | import os
import time
import math
import numpy as np
import pickle as pkl
import nibabel as nib
from os.path import join as pjoin
from sklearn.linear_model import LogisticRegression, LinearRegression
from sklearn.svm import SVC
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import GridSea... |
6d3ff8f7bb191fc05fb78e08e99fde565bbc35a6a6c23d4b25ed236ea3016790 | Python | 58,338 | 1,732 | """Aesthetic testing infrastructure for torchlens.
Generates human-inspectable outputs in tests/generated_outputs/:
- aesthetic_report.txt — comprehensive text report of all user-facing reprs/accessors
- aesthetic-models/ — visualization PDFs exercising depth, rolling, buffers, etc.
Run: pytest tests/test_o... |
edaae54f64532f4c77d5070913945ddd748deb7f4f2a53fdc83e906362a110cc | Python | 58,489 | 1,533 | # -*- coding: utf-8 -*-
"""Note that this benchmark also supports a multi-GPU setup. If you run it on
a system with multiple GPUs make sure that you kill all the processes when
killing the application. Due to the way we setup this benchmark the distributed
processes might continue the benchmark if one of the nodes is k... |
b6fffb30cc943533753640b722badcdcf80f0ae4fb034fe8e8a8645eda306d7a | Python | 58,614 | 1,523 | """Tigramite causal inference for time series."""
# Author: Jakob Runge <jakob@jakob-runge.com>
#
# License: GNU General Public License v3.0
import numpy as np
import math
import itertools
from copy import deepcopy
from collections import defaultdict
from tigramite.models import Models
from tigramite.graphs import Gr... |
791da14297189a72906db9d3587db6b8bef407c9fc845de3d45053cb25f8ff22 | Python | 58,664 | 1,044 | # pylint: disable=line-too-long,too-many-lines,missing-docstring
"""ImageNet classification dataset."""
from os import path
from mxnet.gluon.data.vision import ImageFolderDataset
__all__ = ['ImageNet', 'ImageNet1kAttr']
class ImageNet(ImageFolderDataset):
"""Load the ImageNet classification dataset.
Refer to... |
ed53e8a23574992f6d9dfce0e69a3723c193276fa27f49482bd1f9882ae83ecb | Python | 58,691 | 1,143 | import pickle
import torch
import torch.nn.functional as F
from trainingUtils import NBLoss,_convert_mean_disp_to_counts_logits #,MultipleOptimizer, MultipleScheduler, compute_kernel, compute_mmd
from models import Encoder,Decoder,GaussianDecoder,VAE,CellStateEncoder,\
CellStateDecoder, CellStateVAE,... |
f346922d02a5cbf83bcf6fde428500889b3cde6d37fcba87433a453cc6a9a58e | Python | 58,751 | 1,134 | """
Provides mapping between extensions and datatypes, mime-types, etc.
"""
import importlib.util
import logging
import os
import pkgutil
from collections.abc import Iterable
from string import Template
from typing import (
Any,
cast,
Optional,
TYPE_CHECKING,
Union,
)
import yaml
import galaxy.ut... |
b0f708c42629050f7d815b5f4abeab6deb7d4fd0090e86cc580c7e71af6c5527 | Python | 58,787 | 1,629 | import contextlib
import gc
import io
import os
import pickle
import warnings
import weakref
from collections import namedtuple
import numpy as np
import pytest
from absl.testing import parameterized
from keras.src import backend
from keras.src import layers
from keras.src import losses
from keras.src import ops
from... |
e592b273fb3193df06c12a57d6fa0c3369598c6c5ce6a7a6b94496a5476f077e | Python | 58,831 | 1,687 | """
Screen management for pygame-based simulation visualization
"""
from __future__ import annotations
from typing import Any
import math
import os
import sys
import agentpy
import imageio
import numpy as np
import pandas as pd
import param
from param import Boolean, String
from shapely import geometry
os.environ["P... |
1e67994894b38e99596b829bb6c904b5fc4e224953adbf1d0a6d8b56d040a24c | Python | 58,883 | 1,536 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseTraceType as _BaseTraceType
import copy as _copy
class Sunburst(_BaseTraceType):
_parent_path_str = ""
_path_str = "sunburst"
_valid_props = {... |
7985425e74377dd50121074211fce7573d75d6c86704888262e93235beb361b0 | Python | 59,019 | 1,180 | """
Offload jobs to a Kubernetes cluster.
"""
import json # for debugging of API objects
import logging
import math
import os
import re
from dataclasses import dataclass
from datetime import datetime
from typing import (
Any,
TYPE_CHECKING,
TypedDict,
)
import yaml
from galaxy import model
from galaxy.j... |
7824d17f7dda8f2c676f2d7fe62e78620c23845e5046dc595c9c16382a369c05 | Python | 59,059 | 1,638 | import math
from typing import List, Optional, Union
import matplotlib as mpl
import matplotlib.animation as animation
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from anndata import AnnData
try:
from typing import Literal
except ImportError:
from typing_extensions import Literal... |
b586e64c656bfc759743ead7d7814f288eb3231cd65fa68bd450e218121daedf | Python | 59,074 | 1,141 | #!/usr/bin/env python
"""Implementation of Proximal Policy Optimization Algorithm."""
import collections
import gc
import json
import os
import random
import re
import statistics
import time
from collections import OrderedDict
from glob import glob
from json import JSONDecodeError
from typing import Any
from typing imp... |
c12c15c875a869319288e7a4f628fb64f703949f46600a03dd04027ace9e1e64 | Python | 59,095 | 1,720 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Information theoretic analysis EEG microstates
# Ref.: von Wegner et al., NeuroImage 2017, 158:99-111
# FvW (12/2014)
import argparse, os, sys, time
from sys import stdout
import matplotlib.pyplot as plt
import numpy as np
from scipy.interpolate import griddata
from scipy.si... |
b3d4ac98c2eeb1f105d82e2e7b86ac47d7aded0216ef2c63a9eaa7cc5e82bec2 | Python | 59,120 | 1,363 | # coding=utf-8
# Copyright 2018 The OpenAI Team Authors and HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License... |
d21e98f0c890ad4e6bc718f5539107099bdd70ae0e540610939521f0a4355d90 | Python | 59,145 | 1,363 | # coding=utf-8
# Copyright 2018 The OpenAI Team Authors and HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License... |
000ba09a5c3e00b93580d4233ec56d327291ad0ea236b1e21b00a06c829a0876 | Python | 59,194 | 1,066 | import numpy as np
import pandas as pd
from functools import partial
import math
from Code_final_manuscript.code import parallel_processing as pp
def _lag(x, i): # Apply lag of i trials to array x.
x_lag = np.zeros(x.shape, x.dtype)
if i > 0:
x_lag[i:] = x[:-i]
else:
x_lag[:i] = x[-i:]
return x_l... |
95d4209c907ea48a009c4751151d961b3323d6787528eb82c5771c185c5a0287 | Python | 59,506 | 1,270 | import os
import pandas as pd
import numpy as np
from scipy.stats import ranksums, ttest_ind
from statsmodels.stats.multitest import multipletests
import matplotlib.pyplot as plt
from adjustText import adjust_text
from scipy.stats import f
from scipy import stats
from tqdm import tqdm
def two_sample_f_test(data1, dat... |
72eb8744b057ed8aef7df4664176f45730d1c096d7caeaee13b46387193fc263 | Python | 59,560 | 1,623 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseTraceType as _BaseTraceType
import copy as _copy
class Quiver(_BaseTraceType):
_parent_path_str = ""
_path_str = "quiver"
_valid_props = {
... |
657431b252c2f422e5a6a3c1485c1680c8b247c5f1db3cc246afbb12ef2ad632 | Python | 59,645 | 1,549 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseTraceType as _BaseTraceType
import copy as _copy
class Scattersmith(_BaseTraceType):
_parent_path_str = ""
_path_str = "scattersmith"
_valid_p... |
f7eaeec6977ba68db83db09770ef68128cca9256f73fae813c8fff2a1dbd982e | Python | 59,709 | 1,537 | """Trust-lane inventory and exception restoration for mutable module globals."""
from __future__ import annotations
import ast
import functools
import sys
import threading
from pathlib import Path
from typing import Any, cast
import pytest
import torch
from _global_state_rows import _LIFECYCLE_CLASSES, _WEAK_SUBJECT... |
6952457c368e5e19b0a832c05a66a5b38dba3238141fa9854799f004753bc807 | Python | 59,732 | 1,586 | """Tests for portable TorchLens directory bundle save/load."""
from __future__ import annotations
import json
import logging
import pickle
from collections.abc import Callable
from pathlib import Path
from typing import Any
import numpy as np
import pytest
import safetensors # noqa: F401
import torch
from torch imp... |
fa2ac9da5d4943422c2a09b0a17e8fb7760e542e58febb947d8b17893db5e8c7 | Python | 59,766 | 895 | #### Master Script 1a: Extract and prepare study sample covariates from CENTER-TBI dataset ####
#
# Shubhayu Bhattacharyay
# University of Cambridge
# email address: sb2406@cam.ac.uk
#
### Contents:
# I. Initialisation
# II. Load and prepare initial study set
# III. Load and prepare hourly changes in TIL
# IV. Load and... |
292fb92bc68a1020f5a44da6bcf2e9b2692a4d2ab14e95cf876dc7ab96b52669 | Python | 59,796 | 1,477 | # Copyright 2025 Google.
#
# 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, soft... |
f54247e84366ede44d54bfa900883c9d16a89d5114b1d97c552c503624d6b053 | Python | 59,810 | 1,781 | #!python
# external
import os
import platform
import urllib.request
import shutil
import re
import sys
import numpy as np
import pandas as pd
from io import StringIO
import pyteomics.fasta
# visualization libraries
import panel as pn
pn.extension()
import plotly.graph_objects as go
# local
from alphamap.importing impo... |
d381d306af4b7faa47c4a8c973d174bde61879c5bc61183cb9287e75f86e1f39 | Python | 60,003 | 1,506 | """Direct per-arm killers for the M1 raise-arm mutation campaign (mutants3 lane).
Continues ``test_arm_campaign_killers_mutants2.py``'s per-arm coverage: each test
below targets exactly ONE ``raise MetadataInvariantError`` arm of its checker
(mutation_driver.py's per-arm family, id ``<contract>#aNN``) with a duck-type... |
e6e4d7e5535f41383d33b756999aa9e933a3257a7ff0a61a1313bee8ec976b3a | Python | 60,008 | 1,316 | import collections
import logging
import os
import signal
import sys
import threading
import time
from collections.abc import Callable
from typing import (
Any,
)
from beaker.cache import CacheManager
from beaker.util import parse_cache_config_options
import galaxy.model
import galaxy.model.security
import galaxy... |
f61bd2f177cba6064eb52c29d5513bec7ac6cffeb78590937b3b21f5ef32d9a9 | Python | 60,271 | 1,650 | """Stage 5 sparse DAG execution and unified ``RunResult`` tests."""
from __future__ import annotations
from collections.abc import Iterator
from dataclasses import replace
from pathlib import Path
from typing import Any, NamedTuple
import pytest
import torch
from torch import nn
import torchlens as tl
from torchlen... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.