sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
5fed7a1565d93315d26327a77090bafe56a11f9d562a1e80d10f0ca831fb0af1 | Python | 48,196 | 1,475 | """
Data preparation behind the dataset replay app.
Builds the catalog of replayable sources and turns a chosen one into the
per-frame render state the browser draws.
"""
from __future__ import annotations
from dataclasses import dataclass
from pathlib import Path
from typing import Any, Iterable
import numpy as np... |
a402ac2f59ca3cf4a5839c950d05b319050e618249c23e9a23b5497444b761f1 | Python | 48,206 | 1,218 | import collections
import numpy as np
import six
import tensorflow as tf
import pdb
from dcCustom.data import NumpyDataset, pad_features
from dcCustom.feat.graph_features import ConvMolFeaturizer
from dcCustom.feat.mol_graphs import ConvMol
from dcCustom.metrics import to_one_hot
from dcCustom.models.tensorgraph.grap... |
3cdaa17089b272bc742c7d3cf80efe1c03db09d6f8efb5528d96ed4f4bfc7704 | Python | 48,257 | 1,349 | ### -------------------------------- ###
### Classes for sequences of frames ###
### -------------------------------- ###
# a/b will always return float
import sys
import os
import re
import glob
import itertools as itt
import inspect
import zipfile
#import fnmatch
from skimage import io as skio
#from skimage.ext... |
eb0f21c1a248306d194fd2bb420e95af81bf9efb23535351d48c9e8b9db4d8be | Python | 48,303 | 963 | """_template_match.py
Implements image template matching using normalized cross corrrelations.
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 the GNU General Public License as published by the Free S... |
089144e221b8fcc6c0f6ba709021fc5a8c56883384631a8a16f814d294b331f8 | Python | 48,323 | 1,528 | import datetime
import glob
import logging
import os
import re
import subprocess
import time
from uuid import uuid4
import git
import netifaces
from ethoscope.utils.rpi_bad_power import powerChecker
PERSISTENT_STATE = "/var/cache/ethoscope/persistent_state.pkl"
def ensure_dir_exists(file_path):
"""
Ensures... |
f3ae19979365707f02f79470d96db28cd8278bc1a807614f079340c62d80e6e1 | Python | 48,326 | 1,099 |
import argparse
import logging
import math
import os
import re
import sys
from datetime import datetime
import pytz
import requests
import yaml
from reportlab.lib import colors
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import c... |
30667655f1f5f78fbc6c07d96682995215f897dc7357c7758e2664a86479952b | Python | 48,367 | 1,173 | """
Manager and Serializer for histories.
Histories are containers for datasets or dataset collections
created (or copied) by users over the course of an analysis.
"""
import json
import logging
from typing import (
Any,
cast,
Literal,
TYPE_CHECKING,
Union,
)
from uuid import UUID
from sqlalchemy... |
da5a928a25a99fd971c0bbaa86d8f93f95475fc81ca5fcdb2d32539d852a0424 | Python | 48,379 | 1,145 | import collections
import numpy as np
from keras.src import backend
from keras.src.layers.layer import Layer
from keras.src.saving import serialization_lib
from keras.src.utils import argument_validation
from keras.src.utils import numerical_utils
from keras.src.utils import tf_utils
from keras.src.utils.module_utils... |
37b646b9c3c0be1e8e62ebdd7c8b458009ec0b3b0112bdb7c81d3a5c214393fa | Python | 48,540 | 1,399 | import json
import os
import shutil
import sys
import tempfile
import time
import unittest
from pathlib import Path
from unittest import mock
import pandas as pd
import requests
import responses
from codecarbon.core import electricitymaps_api
from codecarbon.core.units import Energy, Power
from codecarbon.emissions_t... |
860966a7aa93f68c807100e3eb1c2d89f6f4b8e41e4a20c729c45722022bf3c4 | Python | 48,581 | 1,396 | import warnings
from joblib import Parallel, delayed
import numpy as np
from sklearn.base import (
BaseEstimator,
TransformerMixin,
clone,
is_classifier,
is_regressor
)
from sklearn.decomposition import PCA
from sklearn.metrics import accuracy_score, r2_score
from sklearn.pipeline import Pipeline
... |
7cfcd373d285489e9eb8b2ca068cefb1da89b1e3f68a62297d86c3f2632b063e | Python | 48,698 | 1,249 | """Boosting as described by David et al. (2007).
Versions
--------
Stored in ``algorithm_version`` attribute
-1. Prior to storing version
0. Normalize ``x`` after applying basis
Profiling
---------
ds = datasets._get_continuous()
y = ds['y']
x1 = ds['x1']
x2 = ds['x2']
%prun -s cumulative res = boosting(y, x1, 0,... |
9e16305f744183097a24a1aacaa2996d898ce7bac24f83cb5d9e41e6295e2936 | Python | 48,703 | 899 | import copy
import numpy as np
import torch
import torch.distributed
import torch.nn.functional as F
import torch.utils.data
import torchmetrics
import torchvision
from losses.distillation import distillation_loss
from models import DeepLearningRelayModel
from models.stylegan2_ada_spade.augment import AugmentPipe, au... |
8c3ee1743b850a7cd7bae2f6107e22affca2a17be8051d894a18678049bab884 | Python | 48,745 | 1,047 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
from __future__ import annotations
import os
import random
import subprocess
import time
import zipfile
from pathlib import Path
from tarfile import is_tarfile
from typing import Any
from uuid import uuid4
import cv2
import numpy as np
from PIL impo... |
7cae5a1a4b335cb0fbf30f24ab51f4ca80b38baa381c63065b6428ea434f7b28 | Python | 48,777 | 1,307 | from __future__ import annotations
import warnings
from abc import abstractmethod
from collections.abc import Sequence
from dataclasses import dataclass, field
from pathlib import Path
from typing import Any, Literal, cast
import dask.array as da
import numpy as np
import zarr
from ome_zarr_models.common.image_label_... |
6aa243626bb3a3729d1dc8302a1d00f56fccbf64ae7451d2b46d85c2662a1781 | Python | 48,854 | 1,004 | import torch
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
import os
import glob
import random
import numpy as np
import re
import pickle
from copy import deepcopy, copy
from train_lib import seed_all, display_input_output, list_remap
import matplotlib.pyplot as plt
from sklearn import utils
DE... |
0d656cfa0a2fdef65c501997c7e0c5d8cddad32e59a7d72098ff87cd7ae240a5 | Python | 48,977 | 1,177 | """Per-entry audit ledger for the two declared exemption registries (finding B1-06).
``STRUCTURAL_ARG_POSITIONS`` and ``CUSTOM_EXEMPTION_CHECKS`` both settle under the
single ``pre_perturbation_exemption`` code of the exemption ledger
(``test_validation_exemption_ledger.py``), which can only see that the tables are
no... |
05f2a59140d3f4c16af5ce4eddcfb21c835529577d3cf18e9da07b970db801e1 | Python | 49,043 | 966 | """Tigramite causal discovery for time series."""
# Authors: Wiebke Günther <wiebke.guenther@dlr.de>, Urmi Ninad, Jakob Runge <jakob@jakob-runge.com>
#
# License: GNU General Public License v3.0
from __future__ import print_function
import numpy as np
from tigramite.pcmci import PCMCI
from copy import deepcopy
import... |
99560168335016799e48869a10140ed55656537190fe9289139fb48ed6bb0806 | Python | 49,103 | 1,873 | import numpy as np
from keras.src import tree
from keras.src.backend import config
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 keras.src.b... |
9d96229172b1a7615140608ce9a6c000f1367a8f10d378a79079448d563edfdf | Python | 49,147 | 1,456 | #!/usr/bin/env python
# fiducialreg.py
"""Generate transformation matrices from arrays of fiducial markers for
image registration.
:Author:
`Talley Lambert <http://www.talleylambert.com>`_
:Organization:
Cell Biology Microscopy Facility, Harvard Medical School
Acknowledgements
----------------
* David Baddele... |
3199f7335e0c730c58067462e8ecd3dd18a7f9f68fd94c9ecef918db0fa659f1 | Python | 49,154 | 1,555 | # Author: Christian Brodbeck <christianbrodbeck@nyu.edu>
"""Statistical tests for univariate variables"""
from functools import partial
import itertools
from typing import Dict, Literal, Sequence, Union
import numpy as np
import scipy.stats
from .. import fmtxt
from .._celltable import Celltable
from .._data_obj impo... |
a6d5e2893d1b96c9e14c0578361640a283c9b092e78bf8741b79020997737845 | Python | 49,159 | 1,921 | # Copyright 2023 DeepMind Technologies Limited
#
# 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 agree... |
f5dcd67a5a938b251ab758c9cdce01cf188e36700832c55a88bb545e9255b5b4 | Python | 49,295 | 1,006 | '''Pure PyTorch engine for LDDMM and LDDMM_3D_to_slice.
This engine runs on any torch device and dtype. It is the fallback when the compiled engine
is missing or declines a problem. It computes the same iteration as the original STalign
code, with the corrections listed in CHANGES.md and the optional affine step con... |
c80f1cc4742df14c7bdadd1d4fa393afac09144da6dade187296f238abe1fcd9 | Python | 49,353 | 989 | """SlowFast, implemented in Gluon. https://arxiv.org/abs/1812.03982.
Code adapted from https://github.com/r1ch88/SlowFastNetworks."""
# pylint: disable=line-too-long,too-many-lines,missing-docstring,arguments-differ,unused-argument
__all__ = ['SlowFast', 'slowfast_4x16_resnet50_kinetics400', 'slowfast_8x8_resnet50_kin... |
96b3782690f8e8194a359904fb96b0df5843a67c96993f2af6b652777de792cd | Python | 49,365 | 1,242 | """Wave-0 distributed capture-fidelity census: rows, ZI gate, reds, report.
The L8 census plan (sec 1) wave-0 merge: the topology-row registry with the
full-conjunction ``row_green`` gate, the dual-channel bare ground truth, the
zero-interference gate (ZI-1..ZI-5 + arm-parity), Group A control rows at
their wave-0 obl... |
9bca17879e3a42b709784597a5fbfea766fab508a2ff57b36969e29c67f67271 | Python | 49,367 | 1,387 | import math
import pytest
import torch
import cutlass
import cutlass.cute as cute
from cutlass._mlir.dialects import math as mlir_math
import operator
from torch.nn.attention.flex_attention import create_block_mask, flex_attention
from flash_attn.cute.cache_utils import JITCache
from flash_attn.cute.interface import (... |
69364c1fcf3fd9cb0622ffd2a5a3dba5e512f92c564db2b4f5ddbe226d915d51 | Python | 49,383 | 998 | #!/usr/bin/env python3
"""
File: run_picalo_with_multiple_start_pos.py
Created: 2021/11/30
Last Changed: 2022/03/25
Author: M.Vochteloo
Copyright (C) 2020 University Medical Center Groningen.
A copy of the BSD 3-Clause "New" or "Revised" License can be found in the
LICENSE file in the root directo... |
c1af49a505c8e34f0ac7d65fb34c13e2c9ba208008ec3e2da0e32d4d01a2f9c8 | Python | 49,450 | 1,100 | """Tests for the torch version-compatibility shim (torchlens/utils/_torch_compat.py).
The shim lets TorchLens run on torch 2.1+ by routing the two torch-2.4-only
autocast-query APIs (``is_autocast_enabled(device_type)`` /
``get_autocast_dtype(device_type)``) through version-neutral wrappers.
On the CI/dev torch (>=2.... |
19ac6c940076894f3f0953c8644aff0660d734351290893e3802316e7169a1c4 | Python | 49,574 | 1,111 | """
Manager and Serializer for Users.
"""
import hashlib
import logging
import random
import string
import time
from collections.abc import Callable
from typing import (
Any,
Protocol,
TYPE_CHECKING,
)
from markupsafe import escape
from sqlalchemy import (
and_,
exc,
false,
select,
tru... |
d5c4e0c96e9c3019cdd0b863726a00891e95b9f307effb1391446c60c42af0c1 | Python | 49,582 | 1,021 | CLASS_DICT = {
'CIFAR': {-1: 'noise', 0: 'airplane', 1: 'automobile',
2: 'bird', 3: 'cat', 4: 'deer',
5: 'dog', 6: 'frog', 7: 'horse',
8: 'ship', 9: 'truck'},
'H2Z': {-1: 'noise', 0: 'horse', 1: 'zebra'},
'A2O': {-1: 'noise', 0: '... |
c297f5c86dfe284e3381e4d7bd400ff3d963edeaf0babf231d5f7758a9e0f666 | Python | 49,594 | 1,349 | """
The dataset replay app.
Plays a recorded dataset back in the browser, with the arena and the tracked
animals rendered from the stored coordinates.
"""
from __future__ import annotations
from collections import defaultdict
from html import escape
from pathlib import Path
import re
from typing import Any
import p... |
bea94f0fe6862248d01a5030cbcf03a75f9837178d68aad6a822797d00f9f2c7 | Python | 49,633 | 1,206 | # TODO: revisit ignoring type and write some tests for this, the multi-inheritance in this
# this file is challenging, it should be broken into true mixins.
"""
Constructive Solid Geometry file formats.
"""
import abc
import logging
import re
from typing import (
TYPE_CHECKING,
)
from galaxy import util
from gala... |
5089b1525f1a3732a2d5ab4427c3b94518645631b0d9540094e8ca3cb07bd042 | Python | 49,679 | 1,006 | """
Functions pertaining diagnostics which was run in 2021/22.
"""
from plot_utils_AUD import *
#### DIAGNOSTICS FUNCTIONS ####
def loop_through_diagnostics(output_folders_paths, DIAGDIR, source_model, target, randnetw='False',
inv_std=True, inv_nan_constant_warning=False):
"""
Lo... |
5faf1a0af54e4f4946bbdf230d3eba748b90e13378cd6e265eb2fc32b5bc98e2 | Python | 49,831 | 1,193 | """
roi_analys.py
This script runs ROI trace analyses using a Session object with data generated
by the Allen Institute OpenScope experiments for the Credit Assignment Project.
Authors: Colleen Gillon
Date: October, 2018
Note: this code uses python 3.7.
"""
import copy
import warnings
from joblib import Paralle... |
6697bf1d7ebe22de39e6a3445bc31beac10b34eabba68157669c8baf03da83d4 | Python | 49,860 | 1,267 | """
Database Writers for Ethoscope Experiment Data Storage
This module provides various classes for storing experimental tracking data from the Ethoscope
behavioral monitoring system. The classes support multiple database backends (MySQL/MariaDB, SQLite)
and different output formats (database tables, numpy arrays).
C... |
7f38271073305e0290cc3a4e0dbb6dd899e423d6e30772f884647adad4bfdf80 | Python | 49,911 | 1,513 | """Commonly used math operations not included in NumPy."""
import math as python_math
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.com... |
bb570290a95271f520ac5ff588eeb003160092b25ea5b2e0e8a6ae3047c72e76 | Python | 49,972 | 1,223 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
from __future__ import annotations
import ast
import functools
import glob
import inspect
import math
import os
import platform
import re
import shlex
import shutil
import subprocess
import sys
import time
from importlib import metadata
from pathlib ... |
2dfccfaa09146b0e2c04a6495b0f81204139556d650620c562973aba29871924 | Python | 50,141 | 1,189 | import math
import pytest
import torch
import torch.nn.functional as F
from einops import rearrange, repeat
from flash_attn.ops.layer_norm import (
DropoutAddLayerNorm,
dropout_add_layer_norm,
dropout_add_layer_norm_parallel_residual,
dropout_add_layer_norm_subset,
)
from flash_attn.ops.rms_norm import... |
82199c612bdce7c974e6e24b3900c5ce7b2cc853908a50e5dba5614a18f38fa3 | Python | 50,184 | 1,285 | # -*- coding: utf-8 -*-
__all__ = ['Distribution']
import io
import sys
import re
import os
import warnings
import numbers
import distutils.log
import distutils.core
import distutils.cmd
import distutils.dist
from distutils.errors import DistutilsOptionError
from distutils.util import strtobool
from distutils.debug im... |
034ce343d0f04a37e6372f7ccda0f16132d47cddb1a8a45af38db19c4883b242 | Python | 50,250 | 835 | """
Python implementation of __torch_function__
While most of the torch API and handling for __torch_function__ happens
at the C++ level, some of the torch API is written in Python so we need
python-level handling for __torch_function__ overrides as well. The main
developer-facing functionality in this file are handle... |
b22a420fa6c0c00656c090eef0703e3e45cc8449f385162c12f8b2e970b81e63 | Python | 50,274 | 1,352 | import torch
from networkx.classes.reportviews import NodeView
from torch.nn import Module
from typing import Union, Iterator, Callable, Tuple, Optional
from .nodes import RateNet, SpikeNet, InstantNode, SpikeResetNet
from .edges import RLS, Linear, LinearMasked, LinearMemory, LinearFilter, LinearMemoryFilter
from .uti... |
e477f6325afa286011090bf9784620db70367f49ae3db617157a3f75b5ead57e | Python | 50,296 | 1,064 | import torch
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
import os
import glob
import random
import numpy as np
import pickle
from copy import deepcopy, copy
from sklearn import utils
from train_lib import seed_all, display_input_output, list_remap, score_grammar
from interpret_grammar import... |
1f68e6fe7c564109e4d7c1a0ec1eeb8fc4ebc7c222c539ddc76f83b42df6d47a | Python | 50,336 | 1,296 | # a/b will always return float
import itertools as itt
import os
from functools import partial
from io import IOBase
import numpy as np
import scipy.io
from scipy import ndimage
import matplotlib as mpl
from matplotlib import pyplot as plt
from matplotlib import widgets as mw
from matplotlib import path
impor... |
555f9649934787d459ff9b72697fc674a2820a11c1bbc68c27923a06aa2be657 | Python | 50,358 | 1,128 | from typing import Any, List, Tuple, Union, Dict
import logging
import numpy.typing as npt
import numpy as np
from scipy.linalg import eigh as scipy_eigh
from collections import defaultdict
from ase import data as ase_data
from pymatgen.core.structure import Molecule
import tqdm
import random
from coeffnet.pre... |
b3352f7aa6f297683aa76792244eba4b5784beace88c3effb395b441ced1d5b8 | Python | 50,415 | 1,360 | import collections
import os
import pickle
import threading
import time
import logging
import numpy as np
import tensorflow as tf
import math
import pdb
import csv
from tensorflow.python.pywrap_tensorflow_internal import NewCheckpointReader
from tensorflow.python import debug as tf_debug
from dcCustom.data import Num... |
efad3a1b619d7897bb770bbb9507ddfb09ce60ff637768b194fa8f4670b2dba0 | Python | 50,447 | 1,259 | """
Create transformers
"""
import os
import time
import numpy as np
import subprocess
import h5py
import matplotlib.pyplot as plt
import sys
import random
import json
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, GRU, Dro... |
f2d48c2cb1625a4482bcfd9ecdd545a3074f9ab97031fedb3dd72de5077c477d | Python | 50,538 | 1,592 | # Original code from PythonOT: ot.backend
# Source: https://github.com/PythonOT/POT/blob/master/ot/backend.py
# Copyright (c) 2016-2023 POT contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in t... |
5201293f81f52fcb5ba054b3128f48b09e7322b813527286f9aebfebaf3bb9ce | Python | 50,547 | 1,529 | from __future__ import annotations
import abc
import atexit
import collections
import contextlib
import contextvars
import csv
import enum
import functools
import inspect
import logging
import os
import math
import platform
import signal
import subprocess
import tempfile
import textwrap
import threading
import typing
... |
b2c07b22e7fd94ecc595969681b8b58d54ed2d5655a341f15c1d1ebddf87d3b9 | Python | 50,710 | 1,357 | import torch
from networkx.classes.reportviews import NodeView
from torch.nn import Module
from typing import Union, Iterator, Callable, Tuple, Optional
from .nodes import RateNet, SpikeNet, InstantNode, SpikeResetNet
from .edges import RLS, Linear, LinearMasked, LinearMemory, LinearFilter, LinearMemoryFilter
from .uti... |
8b4496625f1c66c1aa33485953e9f703772b3a58c577974aac8e56bb47857370 | Python | 50,779 | 804 | """File-size ratchet: god files may shrink, never grow unnoticed.
R43 (4th pass): 42 files in ``torchlens/`` exceeded 2000 lines, the top five
all GROWING through fix waves (+996 lines on ``data_classes/op.py`` in ~200
commits), and no size ceiling existed anywhere — no ruff rule, no test, no
hook. This ratchet freeze... |
e644f9535b8e8b14df4cfbdbd1353d6e61aac54fb80cb02cf92b7bb4bba79efb | Python | 50,788 | 1,228 | import re
import warnings
from keras.src import backend
from keras.src import initializers
from keras.src.optimizers.schedules import learning_rate_schedule
from keras.src.saving import serialization_lib
from keras.src.saving.keras_saveable import KerasSaveable
from keras.src.utils import tracking
from keras.src.utils... |
2cf3e42bc681a64cdd41d5ef9fbc2f28ca6c8842f4f22944a7a4d98ef3847050 | Python | 50,851 | 1,620 | """
Larvaworld parameter database
"""
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional
import numpy as np
import param
from .. import reg, util, funcs
from ..util import AttrDict, SuperList, nam
if TYPE_CHECKING:
from .data_aux import LarvaworldParam
__all__: list[str] = [
... |
80705e7ecd592ae5e96cdda131d25272f45d0fcf4d9bbba7a3fbe83345fe4a07 | Python | 50,871 | 1,295 | """Tigramite causal discovery for time series."""
# Author: Jakob Runge <jakob@jakob-runge.com>
#
# License: GNU General Public License v3.0
from __future__ import print_function
import warnings
import math
import abc
import numpy as np
import six
from hashlib import sha1
@six.add_metaclass(abc.ABCMeta)
class CondI... |
1284e6abc408313c728b550343e121374bf818a76513d1376bf63eceff4dc8fd | Python | 51,098 | 1,390 | """r67 C2 -- complete input-boundary snapshot spine (per-node structure honesty).
The r66 C2 findings shared one root: the structure witness recorded ROOT kind only and
the walkers disagreed on vocabulary, so nested kinds, exact classes, empty-dataclass
arity, grammar mapping keys, hidden instance state, and registere... |
0789a33052ff723becbf4753916a3dfe58b7a8bb95ad82827dd2196ac372f472 | Python | 51,144 | 1,228 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
"""Configuration handling and command-line interface (CLI) entrypoint for Ultralytics YOLO."""
from __future__ import annotations
import ast
import os
import shutil
import subprocess
import sys
from pathlib import Path
from types import SimpleNamespa... |
211db9a511236dc5e50d023b51a87f6517341e6a9dad4b8f077667b569ae000a | Python | 51,180 | 1,195 | # 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... |
7a2d6f848020691b103da354978c991db283e61ba1cd9065b6fc831aa5c32907 | Python | 51,209 | 1,577 | import importlib
import math
import sys
from typing import (
Any,
Optional, # Special
)
import matplotlib
import matplotlib as plt
import matplotlib.axes as plt_axis
import matplotlib.figure as plt_figure
import matplotlib.patches as patches
import networkx as nx
import numpy as np
import pandas as pd
from an... |
bb52282270cff09d6e134f57163e70af84f0909e82026bdba40d6b327edbac7d | Python | 51,269 | 1,520 | import pytest
import torch
from torch.nn.attention.flex_attention import flex_attention
from flash_attn.cute.interface import (
_flash_attn_fwd,
_flash_attn_bwd,
flash_attn_varlen_func,
)
from test_score_mod import _generate_block_kvcache
from score_mod_definitions import (
# TensorSSA-based score mods
... |
e45190d0317d6b5d990c4cfcefdee831c22d8cfb327634dacc97b6bd6d9abb1f | Python | 51,313 | 1,410 | from unittest.mock import ANY, Mock, PropertyMock, patch
from uuid import uuid4
import pytest
from billiard.einfo import ExceptionInfo
from kombu.exceptions import EncodeError
from celery import group, signals, states, uuid
from celery.app.task import Context
from celery.app.trace import (TraceInfo, build_tracer, fas... |
676616f24ab66b552298198c82febd2725b052b9418b479f0ebdfae6d139f7a6 | Python | 51,367 | 843 | import subprocess as sp
import os
import pandas as pd
import glob
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
import argparse
from matplotlib.ticker import AutoMinorLocator
from plip.structure.preparation import PDBComplex
from plip.basic import config
from war... |
bb94bb3fd8e87c2b0b9a57dd8cd0c5bf011ac0e7ede1d90a199b78f1b28d1de0 | Python | 51,387 | 1,333 | # --- 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 Shape(_BaseLayoutHierarchyType):
_parent_path_str = "layout"
_path_str ... |
70f38c74bfb8dd5d699deb64c80410516691419776a99bb731895f4552b29043 | Python | 51,395 | 1,014 | import six
import functools
import tensorflow as tf
from packaging import version
from tensorflow.keras import activations
from tensorflow.keras import backend
from tensorflow.keras import constraints
from tensorflow.keras import initializers
from tensorflow.keras import regularizers
from tensorflow.keras.layers impor... |
448d91163b9ac844af8b44d12e27816bea74ccf07dc70333eb34f3cff46d65ce | Python | 51,400 | 1,348 | # --- 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 Splom(_BaseTraceType):
_parent_path_str = ""
_path_str = "splom"
_valid_props = {
... |
880d2f29a95e538f78382d7756d1b481282f68a945fc1957849132687b66eef5 | Python | 51,420 | 2,025 | """
Shared Panel components for the portal's chrome.
Provides the header, footer, cards and lanes that give every app the same
frame.
"""
from __future__ import annotations
import base64
import importlib.metadata as im
from html import escape
from pathlib import Path
import panel as pn
from larvaworld.portal.about... |
122ee9225a72cc9c09b5ef2383cac2204c8ae1d619f404571d4558be1e1758c6 | Python | 51,425 | 1,282 | #!/usr/bin/env python
# =============================================================================
# MODULE DOCSTRING
# =============================================================================
"""Base ``LightningModule`` class to implement TFEP maps."""
# ===================================================... |
2d6ef3791d9288f0da2bf38cccb36f5bf4b56c77ecf31ac7209311d5c081f6a3 | Python | 51,465 | 1,549 | import datetime
import json
import logging
import os
import shutil
import socket
import subprocess
from pathlib import Path
from typing import Any
# Configuration validation constants
USERS_KEYS = [
"name",
"fullname",
"PIN",
"email",
"telephone",
"group",
"active",
"isAdmin",
"crea... |
d2eb4e69096f2170a9f3704a1387e1911cd754cbe069852c7013a2ed50e5d30d | Python | 51,487 | 999 | """zimages.py
Base class for the msemalign package. Implements much of the mSEM tile
and acquisition parameter file loading and also tile montaging.
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 t... |
95f2fda4ce41983208425ca450444278c2bce8fb1bed1b21b2352191fe83a222 | Python | 51,768 | 1,235 | """
Renderer Module
This module defines the PlotlyRenderer class and a single function,
fig_to_plotly, which is intended to be the main way that user's will interact
with the matplotlylib package.
"""
import math
import warnings
import matplotlib.patches as mpatches
from matplotlib import lines as mlines
from matpl... |
58d2958a0b2b1d140c1e8c1eb9a2a28d61cd5c076acb2ab3a80ef7b1859077f5 | Python | 51,798 | 1,198 | import numpy as np
import matplotlib.pyplot as plt
import glob
import os
import sys
import scipy.integrate as integrate
import matplotlib.colors as colors
import time
import plumed
from scipy import interpolate
from matplotlib import ticker, cm
import subprocess
from mpl_toolkits.axes_grid1 import make_axes_locatable
f... |
99e327bb73342129e387415c907a1ece266add2b7525ceb999f830230d38d026 | Python | 51,921 | 1,355 | # Copyright 2022 Deepfold Team
#
# 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 writin... |
fddfbe5d69280249bdabc52f4a41c1a25009e115f763b00287e772716df69b63 | Python | 51,941 | 1,166 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 24 17:01:58 2021
@author: emilia
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import pycircstat
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
import src.vec_operations as vops
from scipy.... |
35fe8da8d0db1bfcf28a87d2ad7db87107b56fa1df4e15b530df554e1d037295 | Python | 51,961 | 1,312 | import copy
import fnmatch
import hashlib
import itertools
import os
import os.path
import re
import warnings
import numpy as np
from typing import Any, Self, Generator
from mirp._images.base_image import BaseImage
from mirp._images.generic_image import GenericImage
from mirp._masks.base_mask import BaseMask
from mi... |
c822871c91892e0e95f46a2ce045d5ee5566c6f9fbb77e4aa9c160f1db49a664 | Python | 52,007 | 1,355 | """GUI for selecting topographical components"""
# Author: Christian Brodbeck <christianbrodbeck@nyu.edu>
# Document: represents data
# ChangeAction: modifies Document
# Model: creates ChangeActions and applies them to the History
# Frame:
# - visualizaes Document
# - listens to Document changes
# - issues comma... |
ee52b621a491f8eb21440d2e528aaa429a9b986103ebe2cd9e1d90a8917ff531 | Python | 52,043 | 1,250 | """Static governance lint over the golden/oracle test infrastructure.
Four tripwires (b10 R78 round-3), each with a red-capable scanner unit test:
1. **Flag arming** — every read of a golden update/regen/record flag
(``TORCHLENS_UPDATE_*``, ``TORCHLENS_REGEN_*``, ``TORCHLENS_ORACLE_RECORD_ENV``,
``TORCHLENS_ORA... |
02c602ca7ccb91973b0172b700d8c5f9d36258ea7d380573bef3d4794ba50c5c | Python | 52,099 | 1,319 | import os
import time
import gzip
import subprocess
import numpy as np
import pandas as pd
import pickle as pkl
import nibabel as nib
from os.path import join as pjoin
from scipy.stats import zscore
from scipy.spatial.distance import cdist, pdist
from sklearn.metrics import pairwise_distances
from magicbox.io.io import... |
5cf339619079cbb7f8fed7c613fb81ed1455bb3497962aef77407fbe8e721eee | Python | 52,120 | 1,217 | """Tigramite causal discovery for time series."""
# Author: Jakob Runge <jakob@jakob-runge.com>
#
# License: GNU General Public License v3.0
from __future__ import print_function
import warnings
import itertools
from collections import defaultdict
from copy import deepcopy
import numpy as np
import scipy.stats
import... |
fbf7a4384c35f5cd9ffdcca01de6a836d7743e633c31f8366971c8b44807e4a3 | Python | 52,135 | 1,329 | import itertools
from unittest.mock import create_autospec
import numpy as np
import pytest
from absl.testing import parameterized
from keras.src import backend
from keras.src import initializers
from keras.src import ops
from keras.src.backend.common import dtypes
from keras.src.backend.common import standardize_dty... |
3809e1cf15bcf7c438e8225c40ce24e0e2954596ca8ce6c9a2950bd4f15721d5 | Python | 52,208 | 1,167 | # 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... |
3e9a99167ec7e9b25bb0b281bf45c2e92cc3452608fb8eb1959da14f8f47e62a | Python | 52,329 | 1,433 | # Author: Christian Brodbeck <christianbrodbeck@nyu.edu>
"""Plot univariate data (:class:`~eelbrain.Var` objects)."""
import inspect
from itertools import chain
import logging
from typing import Any, Callable, Dict, Literal, Sequence, Union
import numpy as np
import scipy.linalg
import scipy.stats
import matplotlib.ax... |
4281176e9945da7b2918c0ce29f0254e884618bd770df45db2b259b206f5bd99 | Python | 52,369 | 1,218 | """The pyfiber.behavior module define two classes: Behavior and MultiBehavior,
that extracts behavioral events from raw files. They possess a number of methods that are useful when dealing
with complex experimental paradigm. Intervals corresponding to periods between specified timestamps can be
automatically calculate... |
f4a23586342dd2bd0e63c4271582da94e4ffbab66ea0e97a96654e3f54eb211c | Python | 52,437 | 1,307 | import os
import time
import numpy as np
import pickle as pkl
import nibabel as nib
from os.path import join as pjoin
from scipy.stats import variation, sem
from matplotlib import pyplot as plt
from cxy_visual_dev.lib.predefine import LR_count_32k, proj_dir, get_rois,\
Atlas, mmp_map_file, s1200_midthickness_R, s12... |
0c253d44c3e78a96a1ebcdbef2e0149f428cbf02e3af0f473ad1f9eb4d8b514a | Python | 52,489 | 1,265 | import os
import tempfile
from collections.abc import Iterable, Mapping, Sequence
from datetime import datetime
from functools import reduce
from time import strftime
from types import MappingProxyType
# from scanpy.neighbors import _compute_connectivities_umap
from typing import Any, Literal
from warnings import warn... |
cbf2dc2d6e581ce967e7c27a0dc99d04f5fd1be747a77844f0f29ce9ee4302da | Python | 52,669 | 1,178 | # 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... |
132871c377275302830ad976d9c11107f19e842e9ad1ff784e6362182fe38580 | Python | 52,701 | 1,249 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
from __future__ import annotations
import asyncio
import hashlib
import json
import math
import os
import random
import shutil
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor, as_completed
from pathlib import Pat... |
4de9dd21dffb89dc549ddc3693a5aca8a5b5ca62a7f75af0d28541ff4b3b63da | Python | 52,762 | 1,326 | """Visualization utils"""
# pylint: disable=line-too-long, redefined-builtin, missing-class-docstring, unused-variable
# adapted from https://github.com/facebookresearch/detectron2/blob/master/detectron2/utils/visualizer.py
import colorsys
import logging
import math
from enum import Enum, unique
import numpy as np
impo... |
426253f90b783707621ae2b859f99940c5b7ab52da22ec614c70550e7df449da | Python | 52,846 | 1,471 | # Author: Christian Brodbeck <christianbrodbeck@nyu.edu>
from collections import defaultdict
import difflib
from functools import reduce
from glob import glob
from itertools import chain, product
import operator
import os
import re
import shutil
import subprocess
from time import localtime, strftime
import traceback
i... |
9fead7b1cf1c7e278d0083c38b1fd171a22e281eba22888d292ada481421d0a4 | Python | 52,943 | 1,113 | """ Vision Transformer (ViT) in PyTorch
A PyTorch implement of Vision Transformers as described in:
'An Image Is Worth 16 x 16 Words: Transformers for Image Recognition at Scale'
- https://arxiv.org/abs/2010.11929
`How to train your ViT? Data, Augmentation, and Regularization in Vision Transformers`
- https://a... |
97e3ecdeeb2b073555ebec27df321c8bb18abedf82d7d7601b3293b9616b308e | Python | 52,944 | 1,415 | # --- 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 Funnelarea(_BaseTraceType):
_parent_path_str = ""
_path_str = "funnelarea"
_valid_props... |
c6a3c42563b6b59b7c8be4d972734abda5a4b5fc344f4702ab449b2342ad1aec | Python | 53,044 | 1,348 | """Task implementation: request context and the task base class."""
import inspect
import sys
import types
from billiard.einfo import ExceptionInfo, ExceptionWithTraceback
from kombu import serialization
from kombu.exceptions import OperationalError
from kombu.utils.uuid import uuid
from celery import current_app, st... |
a5a8a497546434e71514bfd16c5a077b744f4c3c99895ccf70f6c2bd192a6e8c | Python | 53,098 | 1,327 | """Hardening tests for param-free ops at loop boundaries (rounds 22-25).
Locks the round-25 TOPOLOGICAL REDESIGN of bare (unanchored, parameter-free)
op grouping. A bare op's layer membership is no longer guessed from context-set
heuristics (the r22 disjoint-context veto, r23 any-inequality veto plus
entry adoption, r... |
4aa42529a100b9b762ab474cd5b549a73fff2e3a374f054c1eee59edfeb13c80 | Python | 53,131 | 1,187 | """
Base classes for job runner plugins.
"""
import datetime
import errno
import json
import os
import string
import subprocess
import sys
import threading
import time
import traceback
import uuid
from queue import (
Empty,
Queue,
)
from typing import (
Any,
ClassVar,
Generic,
Literal,
TYPE... |
934bf0e9c1d69c8a840722285189c79db389913be751a55f27e295da3d71e9db | Python | 53,272 | 1,556 | # Constants
# ---------
# Subplot types that are each individually positioned with a domain
#
# Each of these subplot types has a `domain` property with `x`/`y`
# properties.
# Note that this set does not contain `xaxis`/`yaxis` because these behave a
# little differently.
import collections
_single_subplot_types = {"... |
c79a909ee65048b4af4a1a9f5eb55856656cb3f702589823e9263f977d2a445b | Python | 53,279 | 1,229 | import random
import numpy as np
import ot
import torch
from anndata import AnnData
try:
from typing import Any, Dict, List, Literal, Optional, Tuple, Union
except ImportError:
from typing_extensions import Literal
from typing import List, Optional, Tuple, Union
from spateo.logging import logger_manager as ... |
6222884254499df4406180ef4c141f90487d4ec487d8bdfc007ff6efd2f22c3c | Python | 53,324 | 1,069 | import torch
import torch.nn.functional as F
from torch.distributions import NegativeBinomial
from torch.distributions.gamma import Gamma
import math
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split,cross_validate,KFold
from sklearn.neighbors import KNeighborsClassifier
from s... |
6081f44f0b30a520c4c94806efe93294d339af2b1fe34dc3481fd5533d7232bf | Python | 53,376 | 1,189 | # 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... |
9c892cdc8068d70dc412f0d212daf2842fb4deea8f55f5bfc90042977dfd3b65 | Python | 53,390 | 1,299 | import os
import matplotlib.pyplot as plt
import numpy as np
from pandas import DataFrame, MultiIndex, Series
from mpl_toolkits.mplot3d import Axes3D
from pyrates import CircuitTemplate, clear
from matplotlib.collections import LineCollection
from mpl_toolkits.mplot3d.art3d import Line3DCollection
from typing import Un... |
c7dfe1121deedbc71cf824f1d68dce445a197a014577a790a20769a8cb7fbb33 | Python | 53,439 | 1,481 | """
seq_analys.py
This script contains functions for sequence analysis.
Authors: Colleen Gillon
Date: January, 2021
Note: this code uses python 3.7.
"""
import numpy as np
import pandas as pd
import scipy.stats as scist
from util import gen_util, logger_util, math_util, rand_util
from sess_util import sess_ntuple... |
624855aca54f0bd455914ac1caa30855257421889c6b0dfb2d26ec843da55917 | Python | 53,511 | 1,257 | # Copyright (c) 2025, Jay Shah, Ganesh Bikshandi, Ying Zhang, Vijay Thakkar, Pradeep Ramani, Tri Dao.
"""Host-only forward config selection and validation.
FwdConfig uses exact split counts: 1 disables SplitKV. Explicit configs are
validated, not normalized. Selection must not read tensor contents, synchronize
CUDA, ... |
396bfdc18a6d7b0d5fcfe0398e61180be2975256fa9756c637e56e5e31c096dd | Python | 53,538 | 1,229 | """
This module contains time stepping methods that represent distinct methods of taking a single step in the time integration loop.
Some are explicit, some are implicit.
Some allow adaptive time stepping via control of embedded temporal error estimates while most do not.
Consider a general purpose explicit ODE,
.. m... |
ec0479e372573cd0cfacbc85f848bfc307f41ae5e5ff78f40438d151d73e359a | Python | 53,582 | 1,308 | import inspect
import json
import typing
import warnings
from collections.abc import Callable
from keras.src import backend
from keras.src import utils
from keras.src.api_export import keras_export
from keras.src.layers.core.input_layer import InputLayer
from keras.src.layers.layer import Layer
from keras.src.models.v... |
5916330b78d48975bb96db87f8c0b6e39c31b0b84a1625cf8bec0aa6a8f0bab6 | Python | 53,669 | 1,750 | """PYTEST_DONT_REWRITE
End-to-end coverage for the remaining Phase 8 conditional integration matrix.
"""
from __future__ import annotations
import importlib.util
import sys
from collections.abc import Callable, Sequence
from dataclasses import replace
from pathlib import Path
import pytest
import torch
import torch... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.