sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
14c0cd4d15d40df0cc6f6a904d845d4a78560b005ea50912229673dac5a2e40d
Python
24,975
672
import struct import sys import types import unittest from unittest import mock from codecarbon.core import windows_emi from codecarbon.core.units import Time from codecarbon.core.windows_emi import ( EMI_VERSION_V1, EMI_VERSION_V2, WindowsEMI, clear_emi_cache, find_mirrored_channels, is_emi_av...
914e179abf83026d580ba139bc15195407d334b4987068dab904ff56d1588ba9
Python
24,987
833
""" Building blocks shared by the configuration widgets. Turns ``param`` objects into form sections -- nested class attributes, class dictionaries, collapsible families and documentation panes -- so that the individual widgets compose these rather than laying out fields by hand. """ from __future__ import annotations...
ad39321ff8cea561e0608d8eb2c1630a7be72c3637c8428cabff907b7437868a
Python
24,989
508
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license from __future__ import annotations import glob import math import os import random import shutil from copy import copy, deepcopy from multiprocessing.pool import ThreadPool from pathlib import Path from typing import Any import cv2 import numpy as n...
8f8c6c628618c36441d4f2d86719487e8952ce98dc8c7bedd93694cdc41dd205
Python
24,998
498
''' Date: 09/09/22 @author: Kaan Karas & TMSi TMSiSDK: Real-time filter that can be applied to incoming data ''' import sys import os from .. import sample_data_server from ..device import ChannelType import numpy as np import queue from copy import deepcopy import threading import time from datetime import datetime...
ad4e8fb5235cc845791d5c510b4a17fa21a5684f313a4eeb730a3e37f34345b1
Python
24,999
663
#!/usr/bin/env python from itertools import repeat import multiprocessing import istarmap import tqdm import time import tempfile import subprocess import statsmodels.formula.api as smf import statsmodels.api as sm import scikits.bootstrap as boot import pysam import pandas as pd import os import numpy as np import mat...
d958f612b1daf184a9798e7e4d6e7360293362cfe85385686f047667247a0bf2
Python
25,005
659
import json import logging import os import shutil import sys import tarfile import numpy as np from qtpy import QtCore import llspy import llspy.gui.exceptions as err from llspy.gui.helpers import byteArrayToString, newWorkerThread, shortname logger = logging.getLogger(__name__) # set root logger try: _CUDAB...
9b6a2d229034ccfe32fe386e6bbd66440cdeda89462a64753574a85e8f053874
Python
25,007
629
""" sess_data_util.py This module contains functions for processing data generated by the Allen Institute OpenScope experiments for the Credit Assignment Project. Authors: Colleen Gillon Date: August, 2018 Note: this code uses python 3.7. """ import copy import numpy as np from util import data_util, gen_util,...
e60e552febba4ddb4266d2069688b93ef643d0796862849b5860b11891dd2234
Python
25,007
704
import logging import os import shutil import signal import sys import tempfile import time import traceback import bottle from ethoscope_node.api import ( AuthAPI, BackupAPI, BugReportAPI, DatabaseAPI, DeviceAPI, FileAPI, NodeAPI, ROITemplateAPI, SensorAPI, SetupAPI, Tunne...
0654e254a57b885c7908d161faded16011d9828de621a579ff7eaaec404894d1
Python
25,017
645
"""Shared capture-honesty facts and preamble for report/export surfaces. ONE source of truth for the honesty facts every human report, machine dump, tabular export, and file export must carry: the settled capture outcome, the verification ceiling, the rescue disclosure, structure-only hypothesis status, sparse-run poi...
f0ef62199c4f007ba8114280d3309be31ba6b1c9a4157f9c37cfb06630e02e61
Python
25,048
640
#!/usr/bin/env python """ Unit tests for the email notification service. """ import datetime import smtplib import time from email.mime.application import MIMEApplication from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from unittest.mock import MagicMock, Mock, call, patch import ...
21c61f99fdec573fc456855249ba9a7d35f7fcb1c2d9a4480ed1d7c48d71d186
Python
25,050
463
""" Runs audio metamer generation on all of the layers specified in build_network.py Removes additional layers from saving to reduce the file size You can either make a copy of this file into the directory with the build_network.py file and run it from there directly, or specify the model directory containing the buil...
0451df97e6ee82d254b842bdc7e1a1953bf7b987b91dbe9a214e472db2bf4e8d
Python
25,054
524
import numpy as np import os import sys import time import tensorflow as tf import tensorflow.keras from tensorflow.keras.models import Sequential import random import pandas as pd #import matplotlib.pyplot as plt import matplotlib.ticker as ticker import matplotlib matplotlib.use('Agg') # Must be before importing mat...
b820c2a503210d69071e1400c7d1a79915c3a96424fd93e645e2ff051ddc2209
Python
25,059
720
from types import SimpleNamespace from unittest.mock import MagicMock, patch import pytest from codecarbon.core.resource_tracker import MODE_CPU_LOAD, ResourceTracker def make_tracker(**overrides): tracker = SimpleNamespace( _force_ram_power=None, _tracking_mode="machine", _conf={"cpu_ph...
97ea93378e036b6a5b0a09b933139462bb6c93ccea8dcdfbcbb2ad4853823942
Python
25,060
573
#!/usr/bin/env python3 """ File: fast_eqtl_mapper.py Created: 2023/05/19 Last Changed: 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 directory of this source tree. """ ...
900c37dcd5ef1bf177bcc58cc4c1d831557dace32dbaaccf5c04216aca7a74b4
Python
25,077
646
import locale locale.setlocale( locale.LC_ALL, 'en_US.UTF-8' ) import re import pandas as pd import camelot import pdfminer from pdfminer.high_level import extract_pages import pdb try: from local_extractor.utils import common_utils except ImportError: import sys, os, pathlib path = pathlib.Path(__file__...
5e3607278d3ba2dba5cf4cd25ffe41237a16b8bbb3a73eebecb46cc7d89765d5
Python
25,080
491
#!/usr/bin/env python3 """Журнал протокола B («Когда выгодно учиться»): статистика и HTML-секция. Читает runs/daily/protocol_b.jsonl (суточный прогон runs/daily_b.py), считает по всему накопленному то, что объявлено в PREREGISTRATION_B.md, и отдаёт машинное состояние (docs/journal_b.json) плюс HTML-фрагмент, который r...
d9c4a7f5ae409c35cee644aa4499ce8732e86705c2fd40dca2dbf3bf5959c14d
Python
25,086
718
""" An R frontend """ import os, sys import pygtk pygtk.require('2.0') import gtk import rpy2 import rpy2.robjects as robjects import itertools import gobject class FunctionPanel(gtk.VBox): _as_list = robjects.r['as.list'] def __init__(self, rfunction): super(FunctionPanel, self).__init__() ...
8eb490161b8b04d4875a0e31b31d29e6ef540547cd5e349d75785bb6d6d05e29
Python
25,094
824
""" misc_analys.py This script contains miscellaneous analysis functions. Authors: Colleen Gillon Date: January, 2021 Note: this code uses python 3.7. """ import warnings import numpy as np import pandas as pd import scipy.stats as scist from util import gen_util, math_util from sess_util import sess_ntuple_util...
9b02297c8e827f71c3b4d53e60260edde0d2d1ecb8e9f76021ede3f9dac316f1
Python
25,096
524
import numpy as np import os import sys import time import tensorflow as tf import tensorflow.keras from tensorflow.keras.models import Sequential import random import pandas as pd #import matplotlib.pyplot as plt import matplotlib.ticker as ticker import matplotlib matplotlib.use('Agg') # Must be before importing mat...
98a275b9a43aeb39259e7a1429d3cb000d4bae1a81a87fa79c978d46b9e5a722
Python
25,109
582
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,...
a96b310d16adf31de3ad44c48766b11b16961564b446f9eb08ac7cc7ee6c8e0d
Python
25,131
642
import os import csv import copy import datetime as dt from pyoperant.behavior import base, shape from pyoperant.errors import EndSession, EndBlock from pyoperant import components, utils, reinf, queues # New trial class that allows for early responses # Saves the response, time, and whether it was correct # Most chan...
af9d8e9410d2ca7e975619f7cc51ecb51bb471a9c0f55d58f894fe98f5d7b372
Python
25,135
719
import numpy as np import torch from scipy.special import softmax import logging from tqdm import tqdm import matplotlib.pyplot as plt from itertools import combinations def calc_KS(strat_obj, dataframe, which_highest, network_name, temperature=1): nb_parties = 1000 arr_proba = np.zeros((nb_parties)) arr_...
f496ac0ab20fe8bc64399221539d479a58292ba27e18c57c5e70f992ac0f3f32
Python
25,149
529
#!/usr/bin/env python3 """ File: cluster_pic_eqtl_genes.py Created: 2022/02/23 Last Changed: 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 directory of this source tree....
f72f33f9b02b2542a5f3d8ca3c393ae7e9a11af238e4080289f6d4e09b07b27d
Python
25,154
595
"""Tier-(b) collective boundary capture: gloo sims. Single-process pins for boundary-node shape, C0 payload content, nesting suppression, tensorless journaling, and typed refusals; then 2-rank ``spawn`` gloo sims proving rank-local graph completeness and cross-rank correlation-key agreement (merge-ranks tier (b), scop...
8b26685463bf2cf39f2364d06f1d7874167be12b2bd30704b8aa8812bf490c0b
Python
25,164
604
# pylint: disable=arguments-differ,unused-argument,line-too-long """R2Plus1D, implemented in Gluon. https://arxiv.org/abs/1711.11248. Code adapted from https://github.com/pytorch/vision/blob/master/torchvision/models/video/resnet.py.""" __all__ = ['R2Plus1D', 'r2plus1d_resnet18_kinetics400', 'r2plus1d_resn...
c51539cebf1e2f449e740b55c08e549515aee456cc451d375a08b4544e456130
Python
25,172
655
#!/usr/bin/env python # ============================================================================= # MODULE DOCSTRING # ============================================================================= """ Train the normalizing flow potential. """ # ==================================================================...
a2119841c7c1742db0aca1b0f8c282df07a7e60d6cd450fdb38fc3bce29e830d
Python
25,176
535
import numpy as np import os import sys import time import tensorflow as tf import tensorflow.keras from tensorflow.keras.models import Sequential import random import pandas as pd #import matplotlib.pyplot as plt import matplotlib.ticker as ticker import matplotlib matplotlib.use('Agg') # Must be before importing mat...
da44ffc68a620271a902eea8560d70c417f4afa1961f56660b4fc9f3e15d5890
Python
25,176
535
import numpy as np import os import sys import time import tensorflow as tf import tensorflow.keras from tensorflow.keras.models import Sequential import random import pandas as pd #import matplotlib.pyplot as plt import matplotlib.ticker as ticker import matplotlib matplotlib.use('Agg') # Must be before importing mat...
d1020108c356036b00d4eab254e4b1736f0c355762cc8763a0740ad9ee9d4579
Python
25,183
647
"""Lane F01 regions checkpoint: derived admissibility on the existing verbs. Surgery memo 3.4 / foldA D12: a region is a user-selected contiguous chunk of the executed graph treated as ONE unit. Covered here: derived complete exits (user list leak refusal), convexity (``between(R, R) <= R`` with an offending path prin...
253214004b1fe70cf62537f7899aeaa86d529b4e3c3e70b339181877f12e4a7e
Python
25,186
756
#!/usr/bin/env python # Created on: August 2, 2013 __author__ = "Sven Kreiss, Kyle Cranmer" __version__ = "0.1" import ROOT from PyROOTUtils import interpolate from scipy.optimize import minimize import math from pprint import pprint container = [] import re, pickle import numpy from multiprocessing import Poo...
48aa57ba24ebf64e0c34ec8a753c553f417b8d6f829a96b6ea7890d552d355a8
Python
25,192
595
from typing import Optional import mujoco import numpy as np from gymnasium import utils from scipy.spatial import transform import angorapy.tasks.utils from angorapy.common.const import N_SUBSTEPS from angorapy.common.senses import Sensation from angorapy.tasks.envs.dexterity.consts import DEFAULT_INITIAL_QPOS from ...
109bd94fcb8fa275b3f532fd99bb72510a396afaf39283d34fe6da0afd3c500d
Python
25,199
561
import torch import torch.nn as nn import torch.nn.functional as F from functools import partial from timm.models.layers import DropPath, to_2tuple, trunc_normal_ from timm.models.registry import register_model from timm.models.vision_transformer import _cfg import math from model import common from model import acb ...
0d1351fd859d9166f81270230a8256693b605beed919b9bf60799cc830478209
Python
25,220
522
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ @author: Pramod Bharadwaj Chandrashekar, Li Liu @email: pchandrashe3@wisc.edu, liliu@asu.edu """ import sys import tensorflow as tf from tensorflow.contrib import rnn class CnnBilstm(object): """ A CNN for gene expression prediction. Uses a convolution la...
c68a39e0ebdf9817c68fd3a778aba5a663cba28829af64f7d0f28a069c083466
Python
25,230
602
# -*- coding: utf-8 -*- import matplotlib.pyplot as plt import numpy as np __all__ = [ 'Task' ] class Task(object): def __init__(self, trial_type='DMS', dt=100, # ms tau=100, # ms batch_size=1024): self.dt = dt self.dt_sec = dt / 1000 se...
149085ca36d8ac64b530a5aa4a98cda0de1015caab3f734b17d697546a5d9853
Python
25,234
498
"""CziMsem.py Implements full affine and optimally constrained affine fitting with the same interface as required by scikit-learn. 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 Pub...
896732d30789956a71b4270ae96b5d64f12258ae065b07f9cc0a3c43414da381
Python
25,245
488
"""Predefined Mask RCNN Model.""" from __future__ import absolute_import import mxnet as mx from mxnet.gluon import nn from mxnet.gluon.contrib.nn import SyncBatchNorm from ..mask_rcnn import get_mask_rcnn from ....nn.feature import FPNFeatureExpander __all__ = ['mask_rcnn_resnet50_v1b_coco', 'mask_rcnn_f...
ae5c14d126553ee8a6450466e7fc8ef942c9ba63e6cbccbc16ef8b724a09fbef
Python
25,246
881
"""Generate formatted strings for printing out information in report format.""" import numpy as np from specparam.utils.select import list_insert from specparam.utils.array import compute_arr_desc from specparam.utils.properties import compute_presence from specparam.version import __version__ as MODULE_VERSION from ...
2d2c7e726ace80e1522b91809e8ddb34acfa6e40bf863074ec14df3fc76badd5
Python
25,249
836
"""Means of SPD/HPD matrices.""" from copy import deepcopy import numpy as np import warnings from .ajd import ajd_pham from .base import sqrtm, invsqrtm, logm, expm, powm from .distance import distance_riemann from .geodesic import geodesic_riemann from .utils import check_weights def mean_ale(covmats, tol=10e-7, ...
f53d09b4fb36fd243119465fb5132098013c68681888aaf1a04b5c3ae916d35a
Python
25,249
558
import os import re import math import random import resampy import numpy as np from multiprocessing import Queue, Process from .audio import gain_db_to_ratio, max_dbfs, normalize_audio, AUDIO_TYPE_NP, AUDIO_TYPE_PCM, AUDIO_TYPE_OPUS from .helpers import LimitingPool, int_range, float_range, pick_value_from_range, tf...
339ed51934d42f3a0b4e5538267553f3eb42a9877f4638b6be5098919d1c360b
Python
25,252
706
"""Tests for serialization_lib.""" import json import numpy as np import keras from keras.src import ops from keras.src import random from keras.src import testing from keras.src.saving import deserialize_keras_object from keras.src.saving import object_registration from keras.src.saving import serialization_lib d...
8e1b85f15ed1db1bafdb5a09718da2c9d294a526071bb2e658039717eba23a7a
Python
25,253
636
#!/usr/bin/env python # -*- coding: UTF-8 -*- __author__ = "Bjoern Gruening" __version__ = "0.1" __date__ = "" __license__ = "GLP3+" """ These script converts a Blast XML Output to the NCBI Feature Table format, required for submission of Serquence data. http://www.ncbi.nlm.nih.gov/WebSub/index.cgi?tool=genbank TODO:...
5829adc4a93d279415e69c337053eb099a19c4896eee1ca4593aad78fdbdf358
Python
25,265
618
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license from __future__ import annotations from collections.abc import Callable from types import SimpleNamespace from typing import Any import cv2 import numpy as np from ultralytics.utils import LOGGER, RANK, TESTS_RUNNING, env_bool, ops from ultralytics...
9e9914ad8a536e77c3d7e21037a9c653dfde03d2d6114697fcb5e14347574b3e
Python
25,282
548
#!/usr/bin/env python # -*- coding: utf-8 -*- """ 20_analysis.py — 路线 A 主分析 ================================================================== 在完全公开的纵向人血浆蛋白组数据上,复现英矽智能 rentosertib 研究 (Nature Biotechnology 2026, DOI 10.1038/s41587-026-03286-y)的分析链: 药物干预前后配对血样 → Olink 蛋白质组 → 蛋白质组衰老时钟 → 预测年龄位移 数据集:GSE169148(GEO, 完全公...
ac0f339d7d337d98622b802bab2cb4fa5754a69b97757262193e3759bb49352d
Python
25,290
693
"""Artifact detection.""" import numpy as np from scipy.stats import combine_pvalues, norm from sklearn.base import BaseEstimator, TransformerMixin from .classification import MDM from .geometry.geodesic import geodesic from .geometry.mean import gmean from .utils._base import SpdClassifMixin from .utils._check import...
4b2eaca03e20cfa800740049dbad46d395bbef7007f596c18f55cb4360676345
Python
25,291
688
''' This code provides with an easy way to avoid boilerplate for training and validating results. author: obanmarcos ''' ''' This code provides with an easy way to avoid boilerplate for training and validating results. author: obanmarcos ''' import sys sys.path.append('~/DeepOPT/') import torch from . import modl impo...
3b99f3c79f5881db4d9cedb948c914830d38cc751cdbd5cf05ca8de44126befc
Python
25,300
659
"""r65 Cluster Y: input-boundary walker container parity (single-sourced dispatch). The three input-boundary walkers -- W1 (capture literal-leaf), W2 (capture metadata-read-site), W3 (runtime literal-path) -- witness the SAME physical input tree for different fact families, so a container kind handled by one walker bu...
5b40dac1ba212e788063d30d8b753d2d00549d6059c9cfd85d45b9879348c21e
Python
25,310
693
import numpy as np import scipy import brian2.only as br from tqdm import tqdm import matplotlib as mpl import matplotlib.pyplot as plt import pandas as pd import seaborn as sns import network import analysis import fig2 from functools import partial from multiprocessing import Manager, Pool import sys...
e4def0fc93af8776b34714e181318d364bf078b6a864efd8342cb25accbb1bae
Python
25,317
509
import argparse, time, logging, os, math import numpy as np import mxnet as mx from mxnet import gluon, nd from mxnet import autograd as ag from mxnet.gluon.data.vision import transforms import gluoncv as gcv gcv.utils.check_version('0.6.0') from gluoncv.data import imagenet from gluoncv.model_zoo import get_model fr...
1dcb000bcc89e9ee1bb6accae43a36b7488652bb137a3ff97e38e1bd1dcdea3c
Python
25,330
773
""" Reusable groups of related configuration parameters. Each class bundles the parameters that belong together -- framerate, spatial resolution, simulation timing, runtime paths and output options -- so that the datasets, simulations and portal apps share one definition of them. """ from __future__ import annotation...
0ef31880a9f0d0c2665798e26507c874abf63789ca5ffd2393e0b0dfe29f22cf
Python
25,333
629
# -*- coding: utf-8 -*- import os import io import csv import json import tarfile from pathlib import Path from functools import partial from .helpers import KILOBYTE, MEGABYTE, GIGABYTE, Interleaved, LenMap from .audio import ( Sample, AUDIO_TYPE_PCM, AUDIO_TYPE_OPUS, SERIALIZABLE_AUDIO_TYPES, ge...
b89b314070e46c629b0fa6fa6559440ed1d4cf37062b2d98683c5a8059968f59
Python
25,345
657
import numpy as np import pandas as pd import nibabel as nib from scipy.io import loadmat from os.path import join as pjoin from magicbox.io.io import CiftiReader proj_dir = '/nfs/z1/userhome/ChenXiaYu/workingdir/study/visual_dev' meas2color = { 'Myelination': 'cornflowerblue', 'Thickness': 'limegreen', 'PC1...
7efc382c277bae206997d2442d8dffd8c78cde4e3bd4139034aaf7879df09e63
Python
25,361
590
import argparse import random from mxnet import gluon, image,autograd from mxnet.gluon.data.vision import transforms from mxnet.base import numeric_types import gluoncv as gcv gcv.utils.check_version('0.6.0') from gluoncv import utils as gutils from mxnet.gluon.data import DataLoader from mxnet.gluon import nn import m...
2f5738abb6580ac2d719594817c32017fa112e49f107706a7beff3cefb4451d3
Python
25,366
649
import os import shutil import sys import tempfile from argparse import ( ArgumentParser, Namespace, ) from collections.abc import Callable from io import StringIO from pathlib import Path from textwrap import TextWrapper from typing import ( Any, NamedTuple, ) import yaml from boltons.iterutils import...
7d18d2da916d6a28ac6c5703d8148e015a5b16265ac38b24cc7acb6a533c5030
Python
25,374
591
"""Numeric attestation and nondeterminism checks.""" from __future__ import annotations from collections.abc import Iterable, Mapping, Sequence from typing import TYPE_CHECKING, Any import torch from .runnable import ( ActivationPayloadLayerDescriptor, ActivationPayloadMember, ControlWitnessKind, Ru...
3c1ecf1e11be5ff85c8beeb8f205e1afbb60049d7c5d391eacd7bac2f12047e3
Python
25,384
665
"""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 from scipy import special, spatial, stats import numpy as np from numba import jit import warnings from tigramite.independence_tests.indep...
3db898e5df4d7437c7945569ab45dec067d856389ad9142ac30d9ca76efe8f2e
Python
25,392
688
""" FlashAttention benchmarking script with Flex Attention-style mask mod support and varlen sequences. """ from dataclasses import dataclass import math from typing import Any, Dict, Optional, Tuple import cuda.bindings.driver as cuda import cutlass import cutlass.cute as cute from cutlass.cute.runtime import from_d...
66eaa917e7d2c89960a4b76421b942e50ac489381850256d1ba67748cbf3aaa7
Python
25,398
649
#!/usr/bin/env python3 """Shared extra-feature extraction library for paper7_ad_cross_cohort Diagnostic F.""" from __future__ import annotations import numpy as np FS_TARGET = 100 EPOCH_SEC = 30 EPOCH_SAMPLES_RS = EPOCH_SEC * FS_TARGET # 3000 MAX_EPOCHS_PER_SUBJECT = 10 def fft_resample(data, fs_orig, fs_target): ...
a8f0af9694926a45779560305a5fd092edda3720a8471e213b57574a9c2bc45f
Python
25,410
653
"""Comparative selection producers: acceptance and honesty gates. Covers the comparative-producer lane obligations: differential producers (``changed`` / ``top_changed``) compare the SUBJECT (resolution trace) against ONE explicit reference with a directional float64 delta, masks are exact AS SETS against manually com...
853497760fd3e56ef2445849bd5c9cbe1ffcba030cbfdfc9bb63870b468b2845
Python
25,456
664
"""Tests for Module, ModuleCall, and ModuleAccessor.""" import example_models import pytest import torch import torch.nn as nn import torchlens as tl from torchlens import trace as trace_fn from torchlens.data_classes import ModuleAccessor, ParamAccessor from torchlens.types import Module, ModuleCall # -------------...
7cc1f938c7179ed182358d17fedaafd836ce60a8f07fcdb650de776a31358c3c
Python
25,474
594
"""r67 C3+C6 -- ONE atomic storage-accessor disposition surface with ACTUAL-READ gating. corr1-4 / free-F4 / free-F5 / r66b-R3 root causes, closed structurally: * Handle ACQUISITION (``untyped_storage`` / ``storage`` / ``_typed_storage``) records origin/watch ONLY -- a discarded handle is not an observation (the le...
d2e5e07e5ada484757830ffa940df05c1b33a15465ed480c4f5f524f089ff757
Python
25,482
714
# --- 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 Table(_BaseTraceType): _parent_path_str = "" _path_str = "table" _valid_props = { ...
dcdcb90570be4a23439cd8ddfdcb05b66c312083ba960a308e4285ae7a15425b
Python
25,497
577
"""Governance for the mutation driver's known-red DESELECT ledger. b9-opus R71r3-F1 (part 2): for the second consecutive hunt pass, the driver's ``DESELECT`` list carried entries whose tests had gone GREEN on tip — each stale entry silently deletes the margin of whatever mutants its tests would have killed, and the dr...
7d4a16b926e43c2c9c5a65e250839c6c3eb0c2c81c82f7febb3cbc995dc7d32d
Python
25,502
549
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license from __future__ import annotations import sys from typing import Any import numpy as np from ..utils import LOGGER from ..utils.ops import xywh2ltwh from .basetrack import BaseTrack, TrackState from .utils import matching from .utils.kalman_filter ...
87e7d3795e2e9523eb38276786858cae544113e69324db81ca1436b5e6030e16
Python
25,502
786
# TODO: make it cffi-buildable with conditional function definition # (Python if ABI, C if API) import abc import enum import inspect import logging from typing import Tuple import typing import warnings from rpy2.rinterface_lib import ffi_proxy from rpy2.rinterface_lib import openrlib from rpy2.rinterface_lib import c...
785e1b142164b3367c44ff128941ab9394befb8c7857c49f6a206d22b4c64cc9
Python
25,503
665
import logging import os import threading import time from collections.abc import Callable from dataclasses import dataclass from typing import ( Any, cast, TypeVar, ) from pydantic import ( BaseModel, UUID4, ) from typing_extensions import TypedDict from galaxy.exceptions import ( Inconsisten...
fc1ed81237942efbffab84f16ddde8c0b85b87ec8017087d1ed36b0ba8464114
Python
25,523
575
""" This code plots the figures in Results. """ import os import os.path as op import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import pandas as pd from mne.channels import find_ch_adjacency from mne.stats import spatio_temporal_cluster_test, ttest_ind_no_p from scipy.signal import butter, fi...
aa82a360dc09655750a3e106c60b4c3c29e754e49a2c6a40b485e7701a23bdef
Python
25,534
790
"""Compact dependency-gated reimplementations for REIMPL2 shard 7. Sources checked: scvi-tools model docs for scVI/scANVI/totalVI/MultiVI/PeakVI/ DestVI/veloVI, Fuchs et al. 2020 SE(3)-Transformer, Kirillov et al. 2023 SAM, and Linsley et al. 2018 hGRU. These models are small random-init PyTorch reconstructions that ...
cc062f685b9f6ef6ebf353371d0f8fbca0b0623b3fb2711d108c2bddadfbc98b
Python
25,539
706
"""Erik Linder-Noren's PyTorch-GAN reference generators (and a couple discriminators). Source: https://github.com/eriklindernoren/PyTorch-GAN A widely-used educational collection of compact, faithful PyTorch ports of classic GAN papers. Each generator below reproduces the *distinctive* architecture of its paper at sma...
f9dca622eeaa209f43ed464cc1a94b8adc7d0b7072168072aa16404d870eef0b
Python
25,542
684
import hypothesis.strategies as st import numpy as np import pytest import seqpro as sp from Bio.Seq import translate from hypothesis import given from numpy.typing import NDArray from pytest_cases import parametrize_with_cases from seqpro._numba import ( _nb_drop_unknown_codons, gufunc_translate, gufunc_tr...
9c3b635618abb370cac4ac36ca6d8d7bbe6e5d0ac0fc4091b9bd33d3392e5bc3
Python
25,565
649
import numbers import numpy as np import shapely from shapely import ops from shapely.geometry import ( LinearRing, LineString, MultiLineString, MultiPolygon, Polygon, box, ) from pyrosm.exceptions import PBFNotImplemented import functools import inspect import os from pathlib import Path impor...
b9e75ce95593b4ac6df6d9acc8857b94cd728cce9d9859bfa9bf932dd37c7e88
Python
25,578
707
""" Base classes shared by every larva agent. Defines the common interface of the simulated, replayed and offline larvae: their body geometry, their pose, and the accessors that the analysis and rendering layers read. """ from __future__ import annotations from typing import Any import math from copy import deepcopy...
d1efd35eb31fa5af271933bb1a625c9a93c2316ce58998bacedf5a31c865ba67
Python
25,578
717
"""setuptools.command.egg_info Create a distribution's .egg-info directory and contents""" from distutils.filelist import FileList as _FileList from distutils.errors import DistutilsInternalError from distutils.util import convert_path from distutils import log import distutils.errors import distutils.filelist import...
59297b718936cb768f8ddfd8448d1b60f1d0f0299c4d353af5f4d8eb761a4523
Python
25,592
697
# Copyright (c) 2021 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...
996a5da2d5b0f66b63ab36f298c295eeb36463f5cc63de7d80cbc21df76a9899
Python
25,600
629
#!/usr/bin/env python """ run_run_analysis.py This script runs running 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 argparse import copy ...
a30a78062eae8ba78d88a54e099b2cac8ddd943c124e1d9fd76b36e59d610777
Python
25,602
714
#!/usr/bin/env python3 import copy import csv import json import logging import os import re import sys from autouri import GCSURI, AutoURI from . import __version__ as version from .caper_args import ResourceAnalysisReductionMethod, get_parser_and_defaults from .caper_client import CaperClient, CaperClientSubmit fro...
9e5ede628e95fc616905be8f52f5f59a2b1b5d8961ef5114d9fa768b2030dc81
Python
25,603
558
import math import os import time import torch import torch.nn as nn import numpy as np; from torch.autograd import Variable import scipy import matplotlib.pyplot as plt import scipy.io as sio from sklearn.preprocessing import normalize from sklearn.cluster import KMeans from sklearn.metrics import normalized_mutual_in...
9399f514a621942b5b35231829e03a0f1bead6f5e2f4f92883c3fd766a5896e9
Python
25,619
612
import logging import os import subprocess import traceback from git import GitCommandError, Remote, Repo class DeviceUpdateError(Exception): """Custom exception raised when device updates fail.""" pass class DeviceUpdater: """ A class to manage and update a device's Git repository. It handle...
a3078191cc2cd24db0a58f02d5b68bdc37859364bdbd9b33f768eb02f30b020a
Python
25,619
642
import hashlib import io import os import pathlib import pkg_resources import time import afmformats.errors import nanite import nanite.fit as nfit import numpy as np from PyQt5 import uic, QtCore, QtGui, QtWidgets from .. import colormap from ..head.custom_widgets import show_wait_cursor from .. import units from ....
dd651a74877f88cfefa6a0188188f97b7e7663223760220dc859465346678866
Python
25,625
585
"""Round-43 security regression: INVERT the CLASS 1 pure-forward-callable gate on the internal-builtin torch roots ``torch`` / ``torch._C`` / ``torch._tensor`` from a growing denylist-of-verbs to a positive STRUCTURAL recognized-operator predicate (findings secE-r42-1/2/3). The pre-r43 gate admitted any callable whose...
403c275e7eabe8ecf089c1bfcda9dfde8152d52a6558b806d3a85b58a5e62101
Python
25,637
682
#!/usr/bin/env python # Created on: September 30, 2013 __author__ = "Sven Kreiss, Kyle Cranmer" __version__ = "0.1" __description__ = """ Creates a counting model using HistFactory for the H2ph, HZZ4l and HWWlvlv channels in ATLAS. The numbers are taken from these papers and conf notes: - http://arxiv.org/pdf/130...
6cb169a300cee3ddff917dbab7d4db97fcd45cdbcb3042c15456bf383f1aae3d
Python
25,637
738
# --- 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 Indicator(_BaseTraceType): _parent_path_str = "" _path_str = "indicator" _valid_props =...
1de72fa3881ce91c55c0eba35b45a7f87c3b13b30304d00130b04aa1742d834b
Python
25,639
409
import sys import tensorflow as tf from tensorflow.keras import datasets from time import perf_counter import numpy as np from pdb import set_trace import sys ENABLE_MEMORY_GROWTH = True # https://stackoverflow.com/questions/36927607/how-can-i-solve-ran-out-of-gpu-memory-in-tensorflow DEBUG_CONV = False TEST_KERAS...
6de74d1e0ce41e1022390874f49ce3be9a956b0c42239b937ed855758260107c
Python
25,640
832
""" Tomographic Reconstruction Utilities Using TwIST, ADMM, and TV Denoising. This module provides a collection of iterative reconstruction algorithms and image-processing utilities for tomographic imaging, including implementations of: * TwIST (Two-Step Iterative Soft Thresholding) reconstruction * ADMM-based regu...
29a3b9e812aa51cfe79b5ea391cb0df9bf276fe3a2653ab628a474dacb4630e1
Python
25,650
739
"""Run simple cell optimization""" """ Copyright (c) 2022 EPFL-BBP, All rights reserved. THIS SOFTWARE IS PROVIDED BY THE BLUE BRAIN PROJECT ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN...
a8f777244a6d02cabd84c16900d5ee08e7f2f20d8ad13dbb6326394412da8a9f
Python
25,659
731
import numpy as np from sklearn.utils.validation import check_random_state from ..geometry._docs import deprecated from ..geometry.base import ( _symmetrize, ctranspose, invsqrtm, powm, sqrtm, expm ) from ..geometry.distance import distance_riemann from ..geometry.mean import mean_riemann from ..transfer import en...
85b20d3b41c0e89b0aa540e0d7a8865848887eee20ad48901fd14692f04c862c
Python
25,675
730
"""In-memory representation of cluster state. This module implements a data-structure used to keep track of the state of a cluster of workers and the tasks it is working on (by consuming events). For every event consumed the state is updated, so the state represents the state of the cluster at the time of the last ev...
4e46dc189d6a818fd48fa35e7d3165047987338a9db5d1d2df3b03a22b5ae25a
Python
25,731
802
""" Copyright (c) 2022 EPFL-BBP, All rights reserved. THIS SOFTWARE IS PROVIDED BY THE BLUE BRAIN PROJECT ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE BLUE BRAIN PROJE...
664743469d0c50945884fe42d572b4859307d0b302226417babddf57e9056371
Python
25,735
685
from __future__ import annotations from itertools import product from pathlib import Path from typing import TYPE_CHECKING, Any import matplotlib.pyplot as plt import numpy as np from gymnasium import Wrapper from natsort import natsorted from neurogym import _SB3_INSTALLED from neurogym.config.base import LOCAL_DIR...
61fa70633e00e84938636b8c488c24e2c9412b5a33177aa6d566075ab96dc0a5
Python
25,737
598
################################################################# # Code written by Edward Choi (mp2893@gatech.edu) # For bug report, please contact author using the email address ################################################################# import sys, random import numpy as np import cPickle as pickle from colle...
47511fa14be1910ff7827e09c8a7f1e539d62b4c4ee0db5f65cb42bf285816ff
Python
25,739
727
#!/usr/bin/env python import datetime from typing import Any import requests from ..utils.configuration import EthoscopeConfiguration from ..utils.etho_db import ExperimentalDB from .base import NotificationAnalyzer class SlackNotificationService(NotificationAnalyzer): """ Slack notification service for Et...
1af81c7231e126891a8403d90fc6f3a8f248605eb28a3b77b6e0e26e2979168f
Python
25,741
612
"""Quiet-box A/B capture-overhead and fast-tier harness with re-baselined gates. This is the durable home of the ad-hoc ``/tmp/perf_ab.py`` A/B harness (D14 ruling: the ~20-30% small-capture fixed overhead is ACCEPTED for the feature sprint; the scheduled post-features perf pass owns optimizing it, and the harness is ...
643f959f1ff5066dfcb40c4593f80ab609f8864ae0cfbd5f552b5aa35952b599
Python
25,741
698
"""Buffer-rung full parity with the param rung (r81, r80 free/hon1/review HIGHs). Round 80 demonstrated TWO HIGH false-VERIFIEDs sharing ONE root: the buffer/tensor-meta provenance rung trusted a STATIC buffer stamp (``TensorMeta.address``, and the sibling ``label_raw``/``buffer_source`` components) with NO verificati...
339f347f5bfbb63a3c576460950efc559841dc12a22705638f49e5d4f9c1e36e
Python
25,743
570
########################################################################## ## ## ## Copyright (c) 2019 Philipp Lösel. All rights reserved. ## ## ## ## This file is par...
376740cadaafe923ad673db681430f09ae0adcae3e852438b18475b84bdbba21
Python
25,744
757
import os import warnings import time import shutil import numpy as np import torch import pandas as pd from torch.utils.tensorboard import SummaryWriter from tensorboard.backend.event_processing.event_accumulator import EventAccumulator import wandb import matplotlib.pyplot as plt import psutil from tqdm.auto import ...
7ecd731a8c47dccf86f6bb7e53424491029100c8dceed97f3caf6576f5adf868
Python
25,747
565
"""Functions for building the input features (reference ccd features) for the HelixFold model.""" import collections import os import time from typing import Any, KeysView, Mapping, MutableMapping, Optional, Sequence, Union, List from absl import logging from helixfold.common import residue_constants from helixfold.da...
f3bd923dbfb97db3e2db0d51ec65322e6083cd520e1e8f560384743c2ea267b3
Python
25,748
460
__author__ = 'Aaron Gudmundson' __email__ = 'agudmun2@jhmi.edu' __date__ = '2022/08/01' __version__ = '01.0.0' __status__ = 'beta' from scipy.optimize import minimize, curve_fit import matplotlib.patches as mpatches # Figure Legends import matplotlib.pyplot a...
8569846fe4a27434d31470a5cf347d5b628a6a7ab09bd6a821253be507650c1b
Python
25,753
686
"""Tests for pynapple.io.interface_neurosuite module.""" import xml.etree.ElementTree as ET from pathlib import Path import numpy as np import pytest import pynapple as nap from pynapple.io.interface_neurosuite import ( NeuroSuiteIO, _build_events, _pair_start_stop, parse_neuroscope_xml, ) # -------...
22dabc07c30eab0d1c2984befff9889a4cfc64be1e3a576b1b037f3bdac8186c
Python
25,762
745
import io import os import re import numpy as np from rdkit.Chem import AllChem from rdkit import RDLogger from scipy.optimize import differential_evolution RDLogger.DisableLog("rdApp.*") from rdkit.Chem import rdMolTransforms import copy import lmdb import pickle import pandas as pd import torch from multiprocessing...
8efe5902949776d7c2e16212b7128016bf0e817dd5a0f3e27156a377bce8591f
Python
25,775
364
''' K-Folding script author: obanmarcos ''' import os import os, sys from config import * import wandb sys.path.append(where_am_i()) import lightning as pl import argparse import numpy as np import matplotlib.pyplot as plt import pandas as pd from utilities import dataloading_utilities as dlutils from utilities.fold...
7d219324ddc1ac2fa430dd5a2f7456420d7ffa12af1097913a3fb7555d2c6046
Python
25,782
521
import numpy from voxcell import VoxelData from parcellation_project.analyses import flatmaps as fm_analyses from sklearn.cluster import KMeans from sklearn import svm from scipy.cluster.hierarchy import linkage, fcluster import scipy from scipy.spatial.distance import pdist from sklearn.metrics import confusion_matrix...