sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
40b8062f9997c85f8da4c1e6850be9df9f69ec2c84940a928e3bd3408e5b0f20 | Python | 77,327 | 2,058 | # --- 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 Scattergl(_BaseTraceType):
_parent_path_str = ""
_path_str = "scattergl"
_valid_props =... |
aeeec5df5c4fc8d453459cb5f3e35748bbbda43e2762f1b4f3617a6ecacec2d1 | Python | 77,374 | 2,043 | # --- 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 RadialAxis(_BaseLayoutHierarchyType):
_parent_path_str = "layout.polar"
... |
c6bf21cf2dce8ff2c64b864fda99f23d26e37c9847027abedd6c920290061d4d | Python | 77,417 | 1,550 | import copy
from typing import Any
from dataclasses import dataclass
import numpy as np
from mirp.settings.feature_parameters import FeatureExtractionSettingsClass
from mirp.settings.utilities import setting_def
@dataclass
class ImageTransformationSettingsClass:
"""
Parameters related to image transformatio... |
d7b1dd1490c1a892ba9f631cea5a12579ef6844dd42a82063a22f0f970922ff9 | Python | 77,547 | 1,857 | """
Unit tests for ethoscope_scanner module.
This module tests Ethoscope-specific scanner functionality including
device management, status tracking, and backup path generation.
"""
import json
import os
import subprocess
import time
from unittest.mock import MagicMock, Mock, patch
import pytest
from ethoscope_node... |
53294f5d586f4cbc4b0ba1cdad14692f37efab7400efcf39c33ab0a40a7ef18b | Python | 77,692 | 2,114 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
"""Block modules."""
from __future__ import annotations
import math
import torch
import torch.nn.functional as F
from torch import nn
from ultralytics.utils.torch_utils import fuse_conv_and_bn
from .conv import Conv, DWConv, GhostConv, LightConv, ... |
2c85f55bd6096c816e2b831c9d31eb7dc50d13d7e66597619316d9669aca9f60 | Python | 77,802 | 2,088 | # --- 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 XAxis(_BaseLayoutHierarchyType):
_parent_path_str = "layout.scene"
_pat... |
84c39669170a9c0b254248e48ac24d748336f8246db210051cf3cec0ab74f8ce | Python | 77,802 | 2,088 | # --- 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 YAxis(_BaseLayoutHierarchyType):
_parent_path_str = "layout.scene"
_pat... |
cfa9bb3f2790bb61bc114381f2d5a2ca8199d2f45c081fc8c9fbdc08140b91ec | Python | 77,802 | 2,088 | # --- 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 ZAxis(_BaseLayoutHierarchyType):
_parent_path_str = "layout.scene"
_pat... |
646560a235de698edb0b0591f6aa8ba52015aa3a6cefcfbc50883a249cdd9857 | Python | 77,803 | 2,134 | import itertools
import math
import jax.numpy as jnp
import numpy as np
import pytest
import scipy.signal
import scipy.special
from absl.testing import parameterized
from keras.src import backend
from keras.src import testing
from keras.src.backend.common import dtypes
from keras.src.backend.common import standardize... |
02fb61f37728749afdf8adea239173917bcc624f49d7042a229de09bdd6985d7 | Python | 78,032 | 1,834 | """
Compute cell classifications based on IV data
uses Linear Discriminat analyis (supervised) or PCA (unsupervised)
Aug 2018-July 2019
Requires:
matplotlib 3.x
python 3.6+
scikit-learn
pylibrary.PlotHelpers (clone from https://github.com/pbmanis/pylibrary)
pandas
Data to be analyzed is held in pickled Pandas databa... |
1202f0d9387c8526916d6f11601599646db0b3797b4f948f17b92ac477c63c0c | Python | 78,053 | 1,795 | import datetime
import json
import logging
import os
import subprocess
import time
import urllib.error
import urllib.parse
import urllib.request
from collections.abc import Iterator
from typing import Any
from ethoscope_node.notifications.manager import NotificationManager
from ethoscope_node.scanner.base_scanner impo... |
09263b46982eb8b44e006f81f36e09f4ce083fa17a12c8f1b38b51b4c40ea1e6 | Python | 78,904 | 2,239 | import operator
from unittest.mock import Mock
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 models
from keras.src import ops
from keras.src import optimizers
from keras.src import r... |
3394479f4a43d3fced3a7e44d8069d920c4392104b971f52c7023d3eaf594714 | Python | 79,085 | 1,809 | """ROI selection, point-grid generation, and image warping / registration.
Provides the ``ROIs`` class (choose face regions via GUI, file, or explicit
dict), the ``ImageAlignmentChecker`` and registration helpers used by the
alignment module, and the interactive ``_Select_ROI`` Plotly/ipywidgets GUI.
"""
from pathlib... |
c006336b22339ee7ccece60de81c7b9d17585b7ee415f64f1fbf37445ce423aa | Python | 79,420 | 1,968 | """
logreg.py
This module contains functions to run and analyse logistic regressions
to predict stimulus information from ROI activity for 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.
""... |
e9e20e4d0eb8e60a1706ce9318083918ecc57529ac1c2db884c4bdf84490d6aa | Python | 79,487 | 1,633 | """Single-sourced model-input boundary traversal (r65 Cluster Y, the normative dispatch).
Every walker of the MODEL-INPUT boundary tree routes through
:func:`walk_input_boundary`:
* W1 -- capture literal-leaf walker
(``torchlens.capture.trace._record_runnable_input_literal_leaves``),
* W2 -- capture metadata-read-s... |
f73db50cb968c93aab2662992418183d808aa7887766ed6ea82e425a3f363721 | Python | 80,795 | 2,350 | #!/usr/bin/env python
# Vendored code from pypng https://github.com/drj11/pypng
# png.py - PNG encoder/decoder in pure Python
#
# Copyright (C) 2006 Johann C. Rocholl <johann@browsershots.org>
# Portions Copyright (C) 2009 David Jones <drj@pobox.com>
# And probably portions Copyright (C) 2006 Nicko van Someren <nicko@... |
6f1840787cdc4944be767e4ccdde0d551339c3bbe0e1d9ce29dcbedd5c3b0ac7 | Python | 81,246 | 2,124 | """Tests for Keras python-based idempotent saving functions."""
import json
import os
import warnings
import zipfile
from io import BytesIO
from pathlib import Path
from unittest import mock
import h5py
import numpy as np
import pytest
from absl.testing import parameterized
import keras
from keras.src import backend... |
ae5af33508da574e3e8d7fe6d123df46928b0ac27de68fc23387a3157f853e9d | Python | 81,343 | 1,531 | """
Performs RSA analysis.
"""
import sys # TODO: this is a bit hacky TODO: remove with installation script.
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import pandas as pd
import matplotlib
from matplotlib.lines import Line2D
from scipy.stats import wilcoxon
from scipy.io ... |
2eabd51d10af1cb26733b24180f76e29de7ef7bf243ea4ea9a37f7099c5c5513 | Python | 81,399 | 2,165 | # --- 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 Funnel(_BaseTraceType):
_parent_path_str = ""
_path_str = "funnel"
_valid_props = {
... |
c591cf7203e711a627dc314482dc8a037273659bc6185abc1626c613c97538f1 | Python | 81,529 | 1,662 | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from ovseg.networks.blocks import StochDepth, SE_unit
from ovseg.networks.custom_normalization import no_z_InstNorm, my_LayerNorm
import os
import pickle
def get_padding(kernel_size):
if isinstance(kernel_size, (list, tuple, np.n... |
c0caf4205d12887763d83015d0d6d00fd1fa3f76ebec14d8e6bfd3aa1241aa4e | Python | 82,179 | 2,118 | # 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... |
b37c62b268f199bd969338dcc6b9f7166cf8fae416db02aadc6fbda0ded4eda9 | Python | 82,670 | 1,848 | """
Interval datatypes
"""
import logging
import sys
import tempfile
from urllib.parse import quote_plus
import pysam
from bx.intervals.io import (
GenomicIntervalReader,
ParseError,
)
from galaxy import util
from galaxy.datatypes import metadata
from galaxy.datatypes.data import DatatypeValidation
from gala... |
20470515da94ba4a96915a96b22650dab04c7d6edc9d5797b4f40c4e97fcdf7d | Python | 82,673 | 2,192 | import socket
import tempfile
from datetime import datetime, timedelta
from unittest.mock import ANY, MagicMock, Mock, patch, sentinel
import pytest
from kombu import Queue
from kombu.exceptions import EncodeError
from celery import Task, chain, chord, group, uuid
from celery.app.task import _reprtask
from celery.can... |
c5fdeee43020b2460e5c7a8d553e6207845dde72555f0afd87bd428ac0090748 | Python | 83,030 | 1,827 | """
Dotplot class adapted from https://github.com/scverse/scanpy with modifications for suitability to cell-cell
communication and interaction analyses
Development notes: some of the methods mention dendrograms/other extra plots and there is currently no capability to
generate those- coming in future update...addition... |
78024b7a48d4e07704175405d8c8766d0a2211a88d9dc2459a1036c73deb1546 | Python | 83,133 | 2,125 | """
Tabular datatype
"""
import abc
import binascii
import csv
import logging
import os
import re
import shutil
import subprocess
import tempfile
from json import dumps
from typing import (
cast,
TYPE_CHECKING,
)
import pysam
from markupsafe import escape
from galaxy import util
from galaxy.datatypes import ... |
01fbee546452ac935726b483770e265dc17dc6b78e384b316556c25cc9139273 | Python | 83,219 | 2,165 | # --- 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 Mesh3d(_BaseTraceType):
_parent_path_str = ""
_path_str = "mesh3d"
_valid_props = {
... |
5469e20156be7c5678d239fc814e40df9c7fc877246f782bfa4b34ff3a74f75b | Python | 83,692 | 2,278 | # --- 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 Bar(_BaseTraceType):
_parent_path_str = ""
_path_str = "bar"
_valid_props = {
"... |
b0c250fedcb1cf1d35d252385ce4f442f465fd12cbbbba35effcc01aec80ad23 | Python | 83,995 | 2,124 | import math
import os
import numpy as np
import pytest
from absl.testing import parameterized
from keras.src import backend
from keras.src import constraints
from keras.src import dtype_policies
from keras.src import export
from keras.src import layers
from keras.src import models
from keras.src import ops
from keras... |
a7ce44bdfa383b60dd4212a771e9f23465935d6ac814626e8b28de88d3658cc6 | Python | 84,033 | 2,097 | """Portable state scrubbing for TorchLens model logs.
This module converts a live ``Trace`` object graph into portable metadata
plus a list of tensor blob specs. It is the save-side counterpart to
rehydration: every class-specific ``PORTABLE_STATE_SPEC`` is applied here so
tensor payloads become ``BlobRef`` placeholde... |
bb5d56d8f675c3a57a61cbb76cc5379d947f821ff79e7526c1592dc3250bdca0 | Python | 84,182 | 2,212 | # --- 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 Histogram2d(_BaseTraceType):
_parent_path_str = ""
_path_str = "histogram2d"
_valid_pro... |
ebfde1cc2e59dc28fc64ce5f2baf66e6d65913156dd071c4119e34e014d10f08 | Python | 84,184 | 2,224 | import json
import pathlib
import re
from typing import Any
import dask.array as da
import numpy as np
import pytest
import zarr
from dask import persist
from numcodecs import Blosc
from ome_zarr_models.v04 import HCS as Models04HCS
from ome_zarr_models.v04 import Image as Models04Image
from ome_zarr_models.v04 import... |
59110b8533ceab5ced35256755ad1fbf3abaf307ed20ba7f9a91762b94c0225e | Python | 84,242 | 1,872 | """
Contains implementations of the Public facing API: EmissionsTracker,
OfflineEmissionsTracker, context manager and decorator @track_emissions
"""
from __future__ import annotations
import dataclasses
import json
import os
import platform
import re
import threading
import time
import uuid
import warnings
from abc i... |
b44177c65b7b894ab566928b3fd370e0c12587e494ad018c03f1e67f84b6af43 | Python | 84,309 | 1,819 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed May 12 13:26:24 2021
@author: yihaoy
"""
import matplotlib.pyplot as plt
from scipy.spatial import distance
from scipy import signal
import numpy as np
import math
from numpy.fft import fft, ifft
# Constants
DEFAULT_NEURONUM = 1000
DEFAULT_NEURO... |
83e740e80b63ff3614bff1a6a92b1860388e71016df98f42b9e6ec8f48c69ee2 | Python | 84,398 | 2,271 | # --- 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 Waterfall(_BaseTraceType):
_parent_path_str = ""
_path_str = "waterfall"
_valid_props =... |
52a0a1b6ce7fbbe481a8483b2647c022f4d4f46acb10c0ba1db3957d10c3eaa9 | Python | 84,592 | 2,237 | # --- 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 Histogram(_BaseTraceType):
_parent_path_str = ""
_path_str = "histogram"
_valid_props =... |
4039b3ea6a98d48f5dde5e2c70eba6a08424ead38f7cfc3c9be78fa87cdc8f42 | Python | 84,695 | 1,973 | ##########################################################################
## ##
## Copyright (c) 2019 Philipp Lösel. All rights reserved. ##
## ##
## This file is par... |
2a1483797c09aeed46000b77c215cd899b0954df84bd48521c659283acfeac5c | Python | 84,789 | 1,635 | #####################################################################
############# PROTEIN SEQUENCE DIFFUSION SAMPLER ####################
#####################################################################
import sys, os, subprocess, pickle, time, json
script_dir = os.path.dirname(os.path.realpath(__file__))
sys.p... |
ba95f60613589640db398a6f643fab308f64eff7d0194478763f5fc17eb88277 | Python | 84,969 | 2,092 | # Asteroid Impact (c) Media Neuroscience Lab, Rene Weber
# Authored by Nick Winters
#
# Asteroid Impact is licensed under a
# Creative Commons Attribution-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-... |
fbaa22dba40230f5a04a0609e551a5bbbfaf48d157864432473f73398ee30e5f | Python | 85,022 | 2,083 | # Asteroid Impact (c) Media Neuroscience Lab, Rene Weber
# Authored by Nick Winters
#
# Asteroid Impact is licensed under a
# Creative Commons Attribution-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-... |
7f60b43187786cbd2f6603dcc82707eb2d8534125f657a607cf11b2539ba2f7c | Python | 85,099 | 2,324 | # --- 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 Heatmap(_BaseTraceType):
_parent_path_str = ""
_path_str = "heatmap"
_valid_props = {
... |
edaa1bffed4b00b9b64be30c1227ce7c9aaa7949536b070c386545731d37d290 | Python | 85,407 | 1,788 | # SM100 swap-AB single-token decode, adapted from NVIDIA CUTLASS gqa_decode_opt
# (examples/python/CuTeDSL/cute_ext/blackwell/attention/gqa_decode_opt.py).
# It computes S^T = K Q^T and O^T = V^T P^T, so KV tokens fill the 128-row MMA M dimension
# and the query heads of one KV head fill the small N dimension.
#
# Core... |
1618855871e71db8fa8e17efb5406ef4503c594bfdac69247fc8cdeb762399c8 | Python | 85,521 | 2,359 | import pickle
from unittest import mock
import numpy as np
import pytest
from absl.testing import parameterized
from keras.src import Input
from keras.src import backend
from keras.src import dtype_policies
from keras.src import layers
from keras.src import metrics
from keras.src import models
from keras.src import o... |
1701971e026bb026c27f799b9173262c8f334d255a2dfca9c3e4d370b6dfa561 | Python | 85,769 | 2,150 | import dbm
import errno
import pickle
import socket
import sys
import time
from contextlib import ExitStack
from datetime import datetime, timedelta, timezone
from pickle import dumps, loads
from threading import Event
from time import sleep
from unittest.mock import MagicMock, Mock, call, patch
import pytest
from ce... |
6497eda65cdfd8c26af5a54e0e7d80c2019a3bca3ec79955f09a79400edb543d | Python | 86,065 | 2,347 | """Internal model state, cache, and input helpers for public trace capture."""
from __future__ import annotations
import collections.abc
import copy
import dataclasses
import hashlib
import inspect
import json
import os
import types
import warnings
import weakref
from collections import OrderedDict
from collections.a... |
92b5cd7d53fbc818b5a612f7336c62e65dc837f44a84a991e76da7ea0dfd7390 | Python | 86,155 | 2,339 | import numbers
import os
import signal
import socket
from datetime import datetime, timedelta, timezone
from time import monotonic, time
from unittest.mock import ANY, Mock, patch
import pytest
from billiard.einfo import ExceptionInfo
from freezegun import freeze_time
from kombu.utils.encoding import from_utf8, safe_r... |
ee25fae8a41799b9589ba4565b2a3a67e6128f4815b14286223e4da848dab0e9 | Python | 86,378 | 2,122 | """Round-41 witness-completeness hardening -- pinned regressions + immunizer suite.
Closes the round-40 findings as CLASSES (see round41-plan/PLAN_AGREED.md):
* hon1_1 -- a pre-window HELD REFERENCE to a module-patched host-nondeterminism
builtin (``from time import time`` / ``from os import urandom``) bypassed eve... |
e662429afbf8937253faec94a9c56eecd7d7c683d14db74eb2434ed43e3020c2 | Python | 86,674 | 2,277 |
# Version: 0.29
"""The Versioneer - like a rocketeer, but for versions.
The Versioneer
==============
* like a rocketeer, but for versions!
* https://github.com/python-versioneer/python-versioneer
* Brian Warner
* License: Public Domain (Unlicense)
* Compatible with: Python 3.7, 3.8, 3.9, 3.10, 3.11 and pypy3
* [![... |
da6aa8d1c24f9032865ce44e6801008707cb6a20534a9b5b1c0f148693c56fe4 | Python | 86,681 | 1,990 | """
Neural Network implementation for image segmentation
For more information about autotune:
https://www.tensorflow.org/guide/data_performance#prefetching
Copyright (c) 2022 Giansalvo Gusinu
Copyright (c) 2021 Emil Zakirov and others
Copyright (c) 2020 Yann LE GUILLY
Code adapted from fo... |
503804c883c952a876205044b3a345303c16864731d4abbf77858311a68309aa | Python | 86,809 | 2,471 | # 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... |
33fa040f2bb7dd1630ee10c064ada38e82803ae4bae896bd390d620b7c883361 | Python | 87,465 | 2,257 | """Tigramite causal inference for time series."""
# Author: Jakob Runge <jakob@jakob-runge.com>
#
# License: GNU General Public License v3.0
from __future__ import print_function
from copy import deepcopy
import json, warnings, os, pathlib
import numpy as np
import sklearn
import sklearn.linear_model
import networkx
... |
e550c2c50b59f7577d948785888915b573aaffb24e042caa5dc309fe98cdddc5 | Python | 87,515 | 2,270 | # --- 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 Histogram2dContour(_BaseTraceType):
_parent_path_str = ""
_path_str = "histogram2dcontour"
... |
c639797010dbd3b440dbf5d43d73fc8e4b0f2c460e9d32052675d32b3add9140 | Python | 88,013 | 2,747 | import base64
import numbers
import textwrap
import uuid
from importlib import import_module
import copy
import io
import re
import sys
import narwhals.stable.v1 as nw
from _plotly_utils.optional_imports import get_module
# back-port of fullmatch from Py3.4+
def fullmatch(regex, string, flags=0):
"""Emulate pyth... |
0bc060e0bdb32f60f62d0316bbe7dc6faa01f440a130978dfab7f16e0d1f9c5f | Python | 88,178 | 1,398 | """Lifecycle-class row ledger for the global-state inventory census.
Pure data, split out of ``test_global_state_inventory.py`` at the seam its
ratchet ledger row named (2026-08-26): the lifecycle-class frozensets carry
most of the line count and are append-per-new-global, while the census
machinery and the assertions... |
3a8146d79078385ba567f804bade032bd0650f74ad19d6526219f6437860bd2e | Python | 88,397 | 2,027 | from __future__ import annotations
from typing import Any, Generic, Literal, Sequence, TypeVar, cast
import numpy as np
from numpy.lib.mixins import NDArrayOperatorsMixin
from numpy.typing import NDArray
from typing_extensions import override
from ._layout import RaggedLayout, RecordLayout, _level_bounds, validate_l... |
221c2a9aa081e0f90736500e11a74c4e829c653eb5a51642bb740a557bfc22f0 | Python | 88,827 | 2,612 | """Regression tests for validation exemption hardening."""
from __future__ import annotations
import inspect
from types import SimpleNamespace
from typing import Any
import pytest
import torch
from torch import nn
import torchlens as tl
from torchlens.validation import backward as backward_validation, core
from tor... |
667a5dc59e89d7a6f042fb94f50cf36456eae4b8e044a867dac9bfb41a5f62ad | Python | 89,110 | 1,994 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
"""Model head modules."""
from __future__ import annotations
import copy
import math
import torch
import torch.nn.functional as F
from torch import nn
from torch.nn.init import constant_, xavier_uniform_
from ultralytics.utils import LOGGER
from ul... |
25e4213a1b2c68fac9bf418b022dca6ca008bd350eb16857f438a202b76d8a12 | Python | 89,135 | 2,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 Contour(_BaseTraceType):
_parent_path_str = ""
_path_str = "contour"
_valid_props = {
... |
d668bf3969158ce714ba27cf88aa698d83c6fea23d8bd03e5cebf3c5cc6c8bbe | Python | 89,223 | 1,566 | """wafer_solver.py
Helper class for wafer class that solves slice ordering and gross rotation
and translation amounts (using further downsampled thumbnails of regions).
These are the components of the "rough alignment", order solving and computing
rigid or affine transformations for each slice, imporoving dramatic... |
9143bdd7b53f7bb4d456f26aeb797125d4c81d351fd7501a932dbcf66e377208 | Python | 89,492 | 2,090 | import contextlib
import logging
import math
import warnings
from pathlib import Path
import pandas as pd
from pyrosm._log import log_event, logged, timed
from pyrosm.config import Conf
from pyrosm.config.osm_filters import get_osm_filter
from pyrosm.filter_compiler import CompiledFilter, dict_as_bracket_filter
from p... |
543b7d3252c69a7d45384a7fea737f799ed57268bde3cd33e8a8c75ebb8edb37 | Python | 89,632 | 2,397 | #!/usr/bin/env python
"""
Easy Install
------------
A tool for doing automatic download/extract/build of distutils-based Python
packages. For detailed documentation, see the accompanying EasyInstall.txt
file, or visit the `EasyInstall home page`__.
__ https://setuptools.readthedocs.io/en/latest/easy_install.html
""... |
3f3840cce88f02e7a518f93160fc8d5ebf32c2a9e61d71e33953fc61ca4955d0 | Python | 89,755 | 2,206 | # Copyright (c) 2025, Tri Dao, Siyu Wang, Shengbin Di, Yuxi Chi, Johnsonms, Linfeng Zheng, Haoyan Huang, Lanbo Li, Yun Zhong, Man Yuan, Minmin Sun, Yong Li, Wei Lin.
from enum import IntEnum, auto
from typing import Optional, Tuple, Protocol, runtime_checkable
from dataclasses import dataclass
try:
from typing im... |
0414a9f5d3a93f4c79fd6093b7d7c83bce1f20dd343804a48317a05d763d5aff | Python | 89,959 | 2,060 | import math
from typing import Callable, Optional, Type
from functools import partial
import cuda.bindings.driver as cuda
import cutlass
import cutlass.cute as cute
import cutlass.utils.hopper_helpers as sm90_utils_basic
from cutlass.cute.nvgpu import cpasync, warpgroup
from cutlass.cute import FastDivmodDivisorV2
fr... |
70f7277a00825b0a8d1d53176b169c969266eed7eab42e864f4482469e5391d2 | Python | 89,963 | 3,057 | # 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... |
01d3474d5b8bf377f00f3174f4b92145a6e52c080c45e28b249bf3f796c845c4 | Python | 90,082 | 2,014 | # 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... |
dfc125bbe55155a473367957ccb25ac66de645ba10e4460124cedbff8eb81d75 | Python | 90,207 | 2,316 | import errno
import logging
import socket
from collections import deque
from time import monotonic
from types import SimpleNamespace
from unittest.mock import MagicMock, Mock, call, patch
import pytest
from amqp import ChannelError
from billiard.exceptions import RestartFreqExceeded
from kombu import Queue
from kombu.... |
aabae5820f476a0ebeef5a31c8e41594848ba1b5def11ffb7e5d931f1608cb5b | Python | 90,246 | 2,395 | import math
import os
import re
import numpy as np
import pytest
from absl.testing import parameterized
from keras.src import backend
from keras.src import constraints
from keras.src import export
from keras.src import layers
from keras.src import models
from keras.src import ops
from keras.src import optimizers
from... |
734d91889c519364a3e6062cd6f04bec27a9cb83cda2ee789129e677b7d9d7b1 | Python | 90,449 | 1,800 | """
This module contains the Flamelet class that provides a high-level interface for nonpremixed flamelets,
namely setting up models and solving both unsteady and steady flamelets
"""
# Spitfire - a Python-C++ library for building tabulated chemistry models and solving differential equations
# Copy... |
15caa5769fc543fab32d6ff15e219bef3ab85c99695bd927e2ae96fd81e3bfa7 | Python | 90,927 | 2,130 | """
mini_analysis plugin - UI handling and loading
Must be loaded from the base UI system.
Use the plugin to find mini synaptic events.
SimplyFire - Customizable analysis of electrophysiology data
Copyright (C) 2022 Megumi Mori
This program comes with ABSOLUTELY NO WARRANTY
This program is free software: you... |
4f7eb2fa5d405aa75c950a190ef237af61022e8b72c973d8cfa7fd5acb75a769 | Python | 91,044 | 2,152 | """Multi-session (cross-session) image alignment.
Ported from ROICaT (https://github.com/RichieHakim/ROICaT,
``roicat/tracking/alignment.py`` and ``roicat/helpers.py``).
Both projects (C) Rich Hakim — released under the face-rhythm LICENSE
alongside the rest of the package. The ROICaT source is GPL-3.0-only;
because R... |
8fcb2dd009f986837108379504deae9af26c43c5b111dead6fb77d3fae134cd0 | Python | 91,267 | 2,602 | """Tests for metadata in IntervalSet, TsdFrame, and TsGroup"""
import inspect
import re
import warnings
from contextlib import nullcontext as does_not_raise
from pathlib import Path
import numpy as np
import pandas as pd
import pytest
import xarray
import pynapple as nap
from pynapple.core.metadata_class import _Met... |
b4929f3dd2c6ee8ee5c4f1744911f076c826c5d892f8ddf413ed550d7957be39 | Python | 92,340 | 2,087 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
"""Model validation metrics."""
from __future__ import annotations
import math
import warnings
from collections import defaultdict
from pathlib import Path
from typing import Any
import numpy as np
import torch
from ultralytics.utils import LOGGER,... |
62fc96e010299de8d1b7469f0fe1f61b81e92a899d1de502f465237cd87d4545 | Python | 92,464 | 2,810 | from __future__ import annotations
import dataclasses
import math
import weakref
from collections.abc import Callable
from typing import Final
from unittest.mock import Mock
import numpy as np
import osam
import pytest
from PySide6 import QtCore
from PySide6 import QtGui
from PySide6.QtCore import QPointF
from PySide... |
a65373de72da13eb34bb6553b54a4fd8b1c75b9ed1e60e52bb43bf271848c9a7 | Python | 92,538 | 2,560 | import functools
from collections import OrderedDict
from collections import defaultdict
from collections import deque
from collections import namedtuple
import numpy as np
import pytest
from absl.testing import parameterized
from keras.src import backend
from keras.src import ops
from keras.src import testing
from k... |
efc9fdbdfe785dd2da2f6281b9d07965257f3df7935498464cc8ddbcab6be530 | Python | 92,746 | 2,101 | #!/usr/bin/python3
##########################################################################
## ##
## Copyright (c) 2019 Philipp Lösel. All rights reserved. ##
## ##
#... |
cff31a926bf30477d49ed5fd999c23f7c9204122f524ab5898b93de3be09b194 | Python | 92,780 | 2,386 | from __future__ import annotations
import collections
import dataclasses
import enum
import typing
from collections.abc import Callable
from collections.abc import Sequence
from typing import Any
from typing import Final
from typing import Literal
from typing import cast
import numpy as np
from loguru import logger
f... |
d266b6c9e2c9708fca5346de100770fd323bfd6b925fcd4bf3436effea7422e0 | Python | 94,293 | 1,597 | # -------------------------------------------------------------------------------------
# Code with functions to plot photometry data
# Marta Blanco-Pozo, 2023
# -------------------------------------------------------------------------------------
import numpy as np
from scipy import interpolate
from scipy import stat... |
945ba8d61bb0c5b7cc3fa11d28a125cb16bac11bb440590dd265d2551127d44e | Python | 95,075 | 1,907 | """
monitor.py — Songbird vocalization monitor.
Runs embedded in pyoperant, via pyoperant.behavior.lights.Lights:
from pyoperant.song_recording.monitor import SongMonitor
monitor = SongMonitor(cfg, audio_input, gate, extractor, smoother, stop_event)
monitor.run() # blocks until stop_event.set()
... |
23961dec9b5205d079dc17747df77f74fc228caad854770ece82b75f8789c638 | Python | 96,336 | 2,521 | # --- 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 Scatter(_BaseTraceType):
_parent_path_str = ""
_path_str = "scatter"
_valid_props = {
... |
873decb839c287c8918d753a9f91f58b4206ba520e2079acf6a6b1260618e55d | Python | 96,350 | 2,403 | """Layer is an Operation with state.
Takes care of:
- Weights / variables (and tracking thereof)
- deferred build
- trainable argument value inference
- masking
- autocasting
And some more magic:
- add_loss
- metric tracking
- RNG seed tracking
- activity regularization
"""
import collections
import functools
impo... |
c758743c0e188de35175b6306a0c793a350b2a9538e61fb5d2b99f9a27331ebf | Python | 96,402 | 2,366 | # 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... |
1c48c0f4fce24f580b05d55ec5390ccec8e65042b3eb56117bcb3baba1d82331 | Python | 96,632 | 2,611 | # --- 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 Box(_BaseTraceType):
_parent_path_str = ""
_path_str = "box"
_valid_props = {
"... |
82785f69087f8cde2325b7a9ccc1b2459e96c84722f947877ea7fc3a2cce6791 | Python | 96,744 | 3,107 | # -*- coding: utf-8 -*-
"""
Multi-lib backend for POT
The goal is to write backend-agnostic code. Whether you're using Numpy, PyTorch,
Jax, Cupy, or Tensorflow, POT code should work nonetheless.
To achieve that, POT provides backend classes which implements functions in their respective backend
imitating Numpy API. As... |
df2bc12fe954da8d17513e56fc37b11a9bc83b8a1f8b69bdda11127f25241769 | Python | 97,287 | 2,399 | from collections import OrderedDict
from copy import deepcopy
from enum import auto
from io import StringIO
import json
import logging
from pathlib import Path
import sys
from tempfile import TemporaryDirectory
from typing import Literal
from urllib.request import urlretrieve
from configargparse import ArgumentError, ... |
9e43cc033eaa1f6e63e0ba5c5655ffa689d5b10b703f95553280fed014679920 | Python | 97,608 | 2,841 | """
The model inspector app.
Shows a larva model's modules and parameters, compares model variants, and
previews the behaviour a configuration produces.
"""
from __future__ import annotations
import copy
import io
import json
import time
from collections.abc import Mapping
from html import escape
from pathlib import... |
2ff8c561050744542b77596d7105b8dd4bb2f90156546f08a1b913c96177d36f | Python | 97,886 | 1,650 | """mfov.py
Class representation and alignment / stitching procedure for single Zeiss
multi-SEM fields of view (MFoVs).
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 ... |
e5dedaa37c780360b2386150ae2f015f6a599e663767ce411f83cc3dd37deabf | Python | 98,186 | 2,451 | """Smoke tests for first-class backward-pass capture."""
import dataclasses
import warnings
from types import MethodType
from unittest import mock
import pytest
import torch
from torch import nn
import torchlens as tl
import torchlens.validation as tl_validation
import torchlens.validation.backward as backward_valid... |
7e36ce26867d436beb35738d4c466f397a5fa34d85613ab8635dd4e9789c9687 | Python | 99,442 | 2,561 | import math
import pytest
import torch
import torch.nn.functional as F
from einops import rearrange, repeat
from flash_attn import (
flash_attn_func,
flash_attn_kvpacked_func,
flash_attn_qkvpacked_func,
flash_attn_varlen_func,
flash_attn_varlen_kvpacked_func,
flash_attn_varlen_qkvpacked_func,
... |
0078ded8e6cc49b1a3342cd47869f8bd0ec431f131457a51e6ee02023a69caa0 | Python | 99,618 | 2,187 | """
roi_analysis_plots.py
This script contains functions to plot results of ROI analyses on specific
sessions (roi_analys.py) from dictionaries.
Authors: Colleen Gillon
Date: October, 2018
Note: this code uses python 3.7.
"""
import copy
import warnings
from pathlib import Path
from joblib import Parallel, delay... |
454ab5129d23e11ed7cf6271a703cf9314c2e5d0b999065c9e8f97f06a3e9d9a | Python | 99,677 | 2,040 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
"""
Export a YOLO PyTorch model to other formats. TensorFlow exports authored by https://github.com/zldrobit.
Format | `format=argument` | Model
--- | --- | ---
PyTorch ... |
1550537e8a5176f512c427300f53a69950478b50571569d544a006f0f8d83ec2 | Python | 99,940 | 2,374 | # 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... |
696e65978286a788972f6b8fe110c690b0d60937372268c8b7a6584f180a17dd | Python | 100,743 | 1,823 | # FUNCTIONS
import os
import pandas as pd
import numpy as np
import ssm
from ssm.util import one_hot
import re
import copy
from numpy.linalg import norm
import scipy.stats
from scipy.stats import multivariate_normal
from scipy.stats import mannwhitneyu
from scipy.stats import fisher_exact
from statsmodels.stats.proport... |
39030dcb8e730c7e7b0ce50f68b51d6444adbc4429133180b7e072a0c77d6614 | Python | 101,336 | 2,561 | import asyncio
import copy
import re
from contextlib import contextmanager
from unittest.mock import ANY, MagicMock, Mock, call, patch, sentinel
from uuid import UUID
import pytest
from kombu.serialization import prepare_accept_content
from kombu.utils.encoding import bytes_to_str, ensure_bytes
import celery
from cel... |
993bc0eb4a5c7ab016714b76267230c7db6138b00422920125b011a21c7080c8 | Python | 101,520 | 1,717 | """region.py
Class representation and alignment / stitching procedure for Zeiss multi-SEM
regions. Regions contain multiple contiguous mFOVs within a single section
(i.e., from a single z-plane of the original tissue block).
Copyright (C) 2018-2026 Max Planck Institute for Neurobiology of Behavior
This program i... |
a408cfd538b57fd38d99216676c70a508c30a300549f4d8d5b2fbbcf64363816 | Python | 101,820 | 2,722 | import os
import torch
import torchaudio
from torch import nn
from torch.nn import functional as F
from torch.nn.parameter import Parameter
import numpy as np
import utils.lreq as ln
import utils.lreq_causal as ln_c
from utils.registry import *
from modules.Swin3D_blocks import *
device = 'cuda' if torch.cuda.is_avail... |
adb5e80bc31dba867a2210aa7852c70b3d11c54531fca905cba0d0e49243f778 | Python | 102,694 | 2,427 | """Test suite for the ODESystem class.
"""
# imports
import os
import re
import pytest
from pycobi import ODESystem, Continuation, parse_point_diagnostics
from pycobi.automated_continuation import (
codim2_search,
continue_period_doubling_bf,
_bif_series_contains,
_resolve_param_for_extract,
)
from py... |
180e03957a8eba36cae9baa997789e78ef7fc52f9b91076c3b8c268792bde0b5 | Python | 103,096 | 2,964 | from unittest import mock
import jax
import numpy as np
import pytest
from absl.testing import parameterized
import keras
from keras.src import backend
from keras.src import initializers
from keras.src import layers
from keras.src import losses
from keras.src import metrics
from keras.src import models
from keras.src... |
031ca73f3fa0210188e643f93b2272bcf2d0f97435d732d5a6ce4cbb431c2caf | Python | 103,664 | 2,395 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
from __future__ import annotations
import contextlib
import importlib
import pickle
import re
import threading
from copy import deepcopy
from pathlib import Path
import numpy as np
import torch
from torch import nn
from ultralytics.nn.autobackend i... |
93e04b6b87ac570d107a47603826c62b7691bd7fe493d2de6ade811c0d119ad0 | Python | 104,273 | 2,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... |
54d8433fe8ee47d9fb962108ef2c6e9ca03aa292e0ff196145d9721696284d06 | Python | 104,736 | 2,463 | # 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... |
911757df431f63a3d4065d3ed1f583cbd1516a2931401982b5fc9315485e7cee | Python | 106,565 | 2,473 | from networks import *
import numpy as np
from torch.nn import functional as F
from losses import CosineLoss
from metrics.torch_stoi import NegSTOILoss
def compdiff(comp):
return ((comp[:, :, 1:] - comp[:, :, :-1]).abs()).mean()
def compdiffd2(comp):
diff = comp[:, :, 1:] - comp[:, :, :-1]
return ((diff... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.