sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
f1c70415608f1752f85149c8e78833114351f4fa4ad80bab6bcccc150adb5859 | Python | 13,885 | 405 | #!/usr/bin/env python
# coding: utf8
import numpy as np
import copy,sys
import pdb
__doc__ = """
This code was adapted from Fründ, Wichmann, Macke (2014): Quantifying the effect of inter-trial dependence on perceptual decisions. J Vis, 14(7): 9.
See Copyright notice below
This module defines the basic functionality... |
3c79b343e5eda81d806a580f1f704c500ed26728da7f091db6fda6057d80d3af | Python | 13,887 | 363 | #!/usr/bin/env python3
"""
File: compare_gene_correlations_per_pic.py
Created: 2022/05/06
Last Changed: 2022/05/09
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 director... |
5ac14e665907cd2fb70a69e12e94fbf3a83d8c8d6c58169b994d0d437f04ae5e | Python | 13,888 | 351 | """Recorded buffer address is authoritative over the shape heuristic (r83 C2, r82 free).
A shape heuristic in postprocess OVERRODE the address the capture had correctly
recorded. ``_buffer_addresses_by_label`` discarded the recorded address whenever
it did not name an unassigned REGISTERED buffer and re-derived one fr... |
6b4024d2ee6b7eeb24e2a6564a4a9e18dfd5c8a938035d7a72fdfbb02a4c525f | Python | 13,888 | 285 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
from __future__ import annotations
import json
from typing import Any
import cv2
import numpy as np
from ultralytics.solutions.solutions import BaseSolution, SolutionAnnotator, SolutionResults
from ultralytics.utils import LOGGER
from ultralytics.u... |
e683de69b3a9719a811345ab58e4d53ed8b990a037cc4f4690274a418fc359c0 | Python | 13,889 | 405 | #!/usr/bin/env python
# coding: utf8
import numpy as np
import copy,sys
import pdb
__doc__ = """
This code was adapted from Fründ, Wichmann, Macke (2014): Quantifying the effect of inter-trial dependence on perceptual decisions. J Vis, 14(7): 9.
See Copyright notice below
This module defines the basic functionality... |
4b068d4e9370f04ccf6ab00445fcaff73130480161fe47e252edd5aa0db608cd | Python | 13,893 | 405 | #!/usr/bin/env python
# coding: utf8
import numpy as np
import copy,sys
import pdb
__doc__ = """
This code was adapted from Fründ, Wichmann, Macke (2014): Quantifying the effect of inter-trial dependence on perceptual decisions. J Vis, 14(7): 9.
See Copyright notice below
This module defines the basic functionality... |
f2060fb5bb01e7f42e311f5783e48968fe99f4ba67ce89af0a9bbcab63e9057d | Python | 13,894 | 429 | """
Experiment-specific termination and progression conditions.
Each condition watches the running simulation and ends it, or advances its
phase, when the experiment's own criterion is met -- a larva reaching a
source, a preference being established, or a life stage completing.
"""
from __future__ import annotations
... |
2fa196df51ad7bafc37c664c23b6b032e4c7a1bd6da0931b41f0f3c0439e3c03 | Python | 13,895 | 453 | from tqdm.auto import tqdm
import pandas as pd
import numpy as np
import torch
from ._helpers import (
_tokenize,
_sequencize,
_token2one_hot,
_one_hot2token,
_pad_sequences,
) # modified concise
from ._helpers import (
_string_to_char_array,
_one_hot_to_tokens,
_char_array_to_string,
... |
93b1b1afa9306fdee98a114f45df594a26663e8d1ecb3a381f00dc87a6b2c655 | Python | 13,896 | 356 | """The real-model ARTIFACT REGISTRY (testing MEMO section 4; build rows A1/A2).
One committed table of every real-model artifact the suite may touch:
``artifact_registry.jsonl``, one JSON row per line. Tests CONSUME rows by
``artifact_id``; nothing in the test suite constructs an artifact reference
ad hoc (no bare ``f... |
80bef812053ce4427c6ff4777ce940c384ee9c39de6d52ddd21f8827305295aa | Python | 13,898 | 315 | '''
Load K-folding models from groups and evaluate performance
author : obanmarcos
'''
import os
import os, sys
from config import *
sys.path.append(where_am_i())
import pytorch_lightning as pl
import argparse
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from utilities import dataloading_u... |
a290cb86d23db0d668e0b883b6176522aa0c4d1a79f9ddccc30c1ffc3896d458 | Python | 13,899 | 300 | import os
import csv
import gzip
import torch
import anndata
import numpy as np
import pandas as pd
import scanpy as sc
import tensorly as tl
import sklearn.neighbors
from scipy.io import mmread
from scipy.sparse import coo_matrix
tl.set_backend('pytorch')
def preprocessing(raw_data_path, PPI_data_path, load_label... |
0dde8869dfc5583844f449b01d22ede08527a2ca027311644163a03f60796944 | Python | 13,900 | 411 | #
# xcp_d documentation build configuration file, created by
# sphinx-quickstart on Mon May 9 09:04:25 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values h... |
d6bccdb27bd044942aa64b44384a468d2bad56cb4173ede50c3dc70761a88e4b | Python | 13,909 | 328 |
import os
import time
import torch
import json, pickle
import numpy as np
import pandas as pd
import networkx as nx
from collections import OrderedDict
from rdkit import Chem
from rdkit.Chem import MolFromSmiles
from torch_geometric import data as DATA
from torch.utils.data.dataloader import default_collate
from sklea... |
080421213127eb0b97348eddc7368b822867f47e6325942d0e2a888b667fc8ee | Python | 13,910 | 454 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class ErrorX(_BaseTraceHierarchyType):
_parent_path_str = "scatter"
_path_str =... |
ae3e86491dccfc267f0be21c055d3f7ac26e0608ee6248baef5ef50dac0cb676 | Python | 13,915 | 331 | from typing import Any, Callable, Dict, List, Optional, Tuple, Union
from PIL.Image import Image
from torch import Tensor
from torchvision.tv_tensors import Mask
from lightly.transforms.add_grid_transform import AddGridTransform
from lightly.transforms.multi_view_transform_v2 import MultiViewTransformV2
from lightly.... |
b9877bbe748da2c4e6f8dadbe17948dd041ceab44388db38ce3ac59e2b66f73b | Python | 13,915 | 380 | """
Tests for the optogenetic LED stimulator classes and OptoMotor pulse_train routing.
"""
import unittest
from unittest.mock import MagicMock, Mock, PropertyMock, patch
from ethoscope.hardware.interfaces.optomotor import OptoMotor
from ethoscope.stimulators.sleep_depriver_stimulators import (
OptomotorSleepDepr... |
105f67646a21a4548e921946bf6df7ab301925f0e42a358b0d8701bd05e4d52a | Python | 13,917 | 421 | """Regression tests for Graphviz sibling-ordering post-processing."""
from __future__ import annotations
import subprocess
from pathlib import Path
import pytest
import torch
pytest.importorskip("torchvision")
import torchvision.models as tv_models # noqa: E402
import torchlens as tl
from torchlens.visualization.... |
f041b9933637fb168fa84bd8dd6f106ed505fbf587f1151c5e96453226143dee | Python | 13,918 | 355 | """Kernel tests: Spine + signed-log2 Histogram (explorer item 4).
The memo-mandated rows: reference (vs direct torch reductions), merge
(integer exactness, split-vs-whole), nonfinite, dtype, count-width, and
RNG isolation.
"""
from __future__ import annotations
import math
import pytest
import torch
from torchlens... |
1d3f09020eb2beb71cc960c220df4da4a3498acd0968d3633c018884f13b04cd | Python | 13,920 | 454 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class ErrorX(_BaseTraceHierarchyType):
_parent_path_str = "scatter3d"
_path_str... |
a51f8974a57ceff5e9f461eabea46d5f51bd73d02bc4d968bae235e4fdf9224e | Python | 13,920 | 454 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class ErrorX(_BaseTraceHierarchyType):
_parent_path_str = "histogram"
_path_str... |
d2fa5ed541f12bea4b2645a6257b55d2758d52f61a764a6471fe2f282732441e | Python | 13,920 | 454 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class ErrorY(_BaseTraceHierarchyType):
_parent_path_str = "scatter3d"
_path_str... |
d920c22b0e294b80330130bb47c4e4b87ce6217030bbd80921eb2bb34f9c995f | Python | 13,920 | 454 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class ErrorX(_BaseTraceHierarchyType):
_parent_path_str = "scattergl"
_path_str... |
9713f1e4971ea5f3f062c0794f2a24ff14c6678d9ace404ed04d0c9decabecae | Python | 13,923 | 423 | from typing import NoReturn
import gymnasium as gym
import numpy as np
from gymnasium.utils import seeding
from neurogym.core import InvalidOperationError
from neurogym.utils import spaces
from neurogym.utils.logging import logger
class LeverPress(gym.Env):
"""Lever pressing environment where a cue signals the ... |
fb664fe0607861dca03861de7a971b7dd2f13288135c0d06a29c230f60344fcb | Python | 13,928 | 327 | """
Prepare the workflow paths to be used by downstream
machine learning algorithm. The paths are divided
into the test and training sets
"""
import os
import collections
import numpy as np
import random
from sklearn.model_selection import train_test_split
from scripts import predict_tool_usage
from scripts import u... |
22c7a0636b724955ac18b6642d06384a0148afb49c31797fdd180c77e03ab9c4 | Python | 13,936 | 447 | import os
import numpy as np
import itertools
from sklearn.metrics import jaccard_score
from nilearn.image import math_img
from nilearn import plotting
import matplotlib.pyplot as plt
import seaborn as sns
from matplotlib.colors import ListedColormap
from fmri_encoder.plotting import (
concat_colormaps,
plot... |
a2f1aa2c3544f8cc103681b76da8d1ba223eb19343e93f7dea78c40adea9f87a | Python | 13,939 | 322 | import os
import json
import numpy as np
import torch
from collections import defaultdict
from src.data.tokenize import tokenize_pet_txt, tokenize_pet_mlm_txt
from src.utils.util import device
import random
class RecordReader(object):
'''
RecordReader reads Record dataset
'''
def __init__(self, conf... |
540c61851f8f81c1ea206b6194574f1c9b16fa64e8f7e6de559b890e396057b1 | Python | 13,942 | 371 | # 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... |
93e48628854cc3a2f51e99bdeda211d4336c2597ce7fa535877be7f119fde5f0 | Python | 13,942 | 416 | """Live intervention and halt coverage for the technical-preview Paddle backend.
The ``interventions`` capability lift is honest only with this coverage: the
mechanism demonstrably works end to end (E2E ablation changes downstream
values AND replay validation passes), halt genuinely stops execution at the
frontier, un... |
2bd4926bf58ca33fabe2460c2d2b72969b40b4a3b9052f0b81bb94b54161da49 | Python | 13,943 | 391 | """F09 CP2: costreport items 13-17, 25 -- peaks, MFU, roofline,
instrumented rate, reserved join slots, and the cost measurer.
Named memo rows exercised: T-MFU-DENOM (two denominators are two
DIFFERENTLY NAMED quantities; a kernel-union step_time is a typed
refusal), the D18 peaks provenance/refusal rules (a zero-row ... |
3296365123514e05c3aa0e6e13abdb69126054e21bae147ee6a5211de63ae319 | Python | 13,944 | 407 | # -*- coding: utf-8 -*-
"""
Created on Mon Feb 15 13:24:28 2021
@author: KEPetousakis
"""
import Code_General_utility_spikes_pickling as util
import numpy as np
import Code_General_Nassi_functions as nf
import matplotlib.pyplot as plt
from copy import deepcopy as dcp
import scipy.stats as stats
import matplotlib
impo... |
1d056e68297afc331eae49118f904fd70e491e88480e1fefc7daa6e44a3e545d | Python | 13,946 | 402 | """Regression tests for releasing persistent model preparation."""
from __future__ import annotations
import io
import pickle
import typing
import pytest
import torch
from torch import nn
import torchlens as tl
from torchlens.backends.torch._tl import get_module_meta
from torchlens.backends.torch.model_prep import ... |
ff51af9b26c3d4787aa219536d1d850725a6799205ed35a14236869140f5b37a | Python | 13,948 | 331 | """
This is the Learning Through Target Bursts (LTTB) repository for code associated to the arXiv 2201.11717 preprint paper:
Cristiano Capone*, Cosimo Lupo*, Paolo Muratore, Pier Stanislao Paolucci (2022)
"Burst-dependent plasticity and dendritic amplification support target-based learning and hierarchical imitation... |
051720b7ebac1ef232b312056320cba8d8696d0d7f6e2f99719df3334a910b44 | Python | 13,950 | 405 | """Tests for ``torchlens.report.explain``."""
from __future__ import annotations
from pathlib import Path
import pytest
import torch
from torch import nn
import torchlens as tl
from torchlens.data_classes import FuncCallLocation
class TinyReportModel(nn.Module):
"""Small deterministic model for report tests."... |
9291a10fbfab710cc242f8ea53fc32d83f7fdcd9000811788a6ae3116f0f4cf8 | Python | 13,953 | 339 | import ipaddress
import logging
import os
import posixpath
import socket
import tempfile
import threading
import uuid
from collections.abc import (
Iterable,
Iterator,
)
from contextlib import contextmanager
from typing import Optional
from urllib.error import HTTPError
from urllib.parse import (
quote,
... |
3cbd1191c861c751b6a383fbe22a6a7e756c7a9fce5da1d4b6c034a928783463 | Python | 13,955 | 345 | import torch
import torch.nn as nn
import torch.nn.functional as F
from ..base import _layers as layers
from ..base import _blocks as blocks
from ..base import _towers as towers
class DeepBind(nn.Module):
"""DeepBind architecture implemented from Alipanahi et al 2015 in PyTorch
This is a flexible implementat... |
4f2df782c3d693840a3eb349476aa1a4250bb4437b60507c6ad788017bf61ab7 | Python | 13,956 | 341 | import re
import logging
class AminoAcid(object):
""" The AminoAcid class represents aa changes in the Cosmic Database.
The AminoAcid class follows the syntax of HGVS
(http://www.hgvs.org/mutnomen/recs-prot.html). Although the parsing
generally follows the HGVS syntax, it does have slight variations ... |
3b9100d8f4e5d9c31b6bf1985708169b6d3254ca6f9351510e5114321307c3a9 | Python | 13,957 | 289 | import json
import os
import torch
from pathlib import Path
import numpy as np
import open3d as o3d
from helpers.configurations import INSTANCE_LABELS_PATH, OBJECT_LABEL_MAP, INSTANCE_LABELS_PRED_PATH, TAKE_SPLIT, OR_4D_DATA_ROOT_PATH
from scene_graph_prediction.data_processing import compute_weight_occurrences
from ... |
4908d213df78ee66be9137e46d61ef4b4fc1fc8babf535821ed6380d2ede98cd | Python | 13,959 | 409 | """F03 ledger memo items 6-8: candidate engine, site_sweep, head sugar, effects.
Carries the SAME-FILE ORACLE the lane gate demands: the head-ablation
sugar's v-facet lowering is checked candidate-by-candidate against a
hand-written torch forward_pre_hook zeroing head i's slice of the c_proj
input (no TorchLens in the... |
96069a34bee669f61742a9beef5acd79693b1b747b25a5f27a86b483b02d8ca0 | Python | 13,962 | 331 | """
This is the Learning Through Target Bursts (LTTB) repository for code associated to the arXiv 2201.11717 preprint paper:
Cristiano Capone*, Cosimo Lupo*, Paolo Muratore, Pier Stanislao Paolucci (2022)
"Burst-dependent plasticity and dendritic amplification support target-based learning and hierarchical imitation... |
e0661a913e8179938105845af9dd1ee3c9f9413b7cf05a815740eea287e567f1 | Python | 13,970 | 382 | """Block-Diffusion (BD3-LM) and MAR with Diffusion Loss.
Block-Diffusion (BD3-LM):
Arriola et al., "Block Diffusion: Interpolating Between Autoregressive and
Diffusion Language Models." arXiv:2406.09405 (2024).
Source: https://github.com/kuleshov-group/bd3lms
MAR (Masked Autoregressive generation) with Diffusio... |
d59786ff719b67c80eef74f25dd06f87d49b528bd05498b7fba6cd44a2f1b883 | Python | 13,974 | 287 | import os
import re
import sys
import gymnasium as gym
os.environ['MPLCONFIGDIR'] = os.getcwd() + "/configs/"
import pprint
import traceback
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from angorapy.utilities.defaults import autoselect_distribution
import distance
import num... |
33fef39a8119ae034c5db852821b2f64b4008d043c23ba71d3fae450d84efec7 | Python | 13,975 | 317 | """Tripwire-strengthening tests for the MLX and Paddle replay oracles.
Two masked-corruption classes are locked out here:
* The MLX oracle used ``atol == rtol`` per dtype band, so every element whose
magnitude sat below the band's decimal tolerance could be replaced by zero
(or sign-flipped) and still read EQUAL.... |
85aab2d8917dbec1932feb43fb2c6e362bb3cd17e1c4b0c998e3c52ee684adb7 | Python | 13,976 | 346 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pandas as pd
import glob
import os
from dateutil.relativedelta import relativedelta
from datetime import datetime
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
import nolds
import seaborn as sns
import operator
from statsmodels.sandbox... |
c311685082d3d481c3ece95efdff5fec9845eb179faa54127475312d382d3ccb | Python | 13,976 | 339 | """Round-28 security regressions: torch._utils._rebuild dotted-walk RCE + sweep.
Four confirmed findings on the sparse ``.tlspec`` load surface:
A-R28-1 (CRITICAL, default-victim RCE) -- the ``SafeBundleUnpickler`` /
``_RenameAwareUnpickler`` ``torch._utils`` ``_rebuild*`` fast-path returned
``super().find_cl... |
bd0ed6094e9fc48de587098f9b05bccbdd5f450b70d3500759a48b5d436cff9c | Python | 13,980 | 402 | """Search feasible SM90 fwd/bwd attention configs for given (head_dim, head_dim_v).
Enumerates tile sizes, swap modes, atom layouts, and staging options.
Checks GMMA divisibility, register budget, and shared memory budget.
Usage:
python flash_attn/cute/sm90_config_search.py --headdim 128
python flash_attn/cut... |
6d00cfdcbc021e0e180aa14b7b866ae990cc0ee3de5505ec69f6684c1ec0c8ce | Python | 13,985 | 380 | import torch
import logging
import pandas as pd
from utils.functional_pytorch import perso_gradient_multi_head_attention_forward
from types import MethodType
import numpy as np
import torch
from utils.protBert_get_attn import forward
import sys
from tqdm import tqdm
import csv
import pickle as pkl
from utils.json_loade... |
49e1e92f3a4465646b586b7d9e19c184e7313f4d4a6d1c30b53c1994d0740c85 | Python | 13,988 | 299 | import unittest
import pysam
import tempfile
from svim.SVIM_COLLECT import bam_iterator, analyze_alignment_file_querysorted, retrieve_other_alignments
from svim.SVIM_input_parsing import parse_arguments
from random import choice, triangular, uniform
class TestCollect(unittest.TestCase):
def generate_random_seque... |
776f304cb6ae24421a65081c808c9393fa6ef969c0fac8452d3d26de67de5d41 | Python | 13,990 | 341 | #!/usr/bin/env python
# =============================================================================
# MODULE DOCSTRING
# =============================================================================
"""
Helper class to train normalizing flows.
"""
# ===============================================================... |
88df234b5232c834c35f7ecbe0bc21995a03eb22b2be6d4937cf3b7cd6d41cbe | Python | 13,994 | 341 | """Registry of quantization strategies, one per mode.
This module is the single dispatch point for quantization behavior. Each
quantization mode (`"int8"`, `"int4"`, `"float8"`, `"ternary"`,
`"gptq"`, `"awq"`) is implemented by one `QuantizationStrategy` that
owns:
- the mode's config class and default-config resolut... |
ebfcccd296a11fefc5d14c5dd66a9d7161839e362b44a75aae7ad7a264c9a6c3 | Python | 13,994 | 355 | from keras.src import activations
from keras.src import constraints
from keras.src import initializers
from keras.src import ops
from keras.src import regularizers
from keras.src.api_export import keras_export
from keras.src.layers.input_spec import InputSpec
from keras.src.layers.layer import Layer
from keras.src.quan... |
a9f05d615d5d27283dda42cb100ccd558c95db02c900f58ab123e863212b79d6 | Python | 14,001 | 254 | import torch
import itertools
from util.image_pool import ImagePool
from .base_model import BaseModel
from data import aux_dataset
from . import networks
class AttnCycleGANModel(BaseModel):
@staticmethod
def modify_commandline_options(parser, is_train=True):
parser.set_defaults(no_dropout=True) # def... |
bc8b505350ff576f17f9320efcc30543f20539bc4a349c7bb28841699f67be75 | Python | 14,004 | 429 | from typing import TYPE_CHECKING, List, Optional, Type, Union
import numpy as np
import seqpro as sp
from seqdata._io.readers import BAM, VCF, BigWig, FlatFASTA, GenomeFASTA, Table
from seqdata.types import ListPathType, PathType
from seqdata.xarray.seqdata import from_flat_files, from_region_files
if TYPE_CHECKING:... |
bab29cbae6ef922d0c21cae93dd5284daac1ded8d9129677ffa58ae6bdfe64fc | Python | 14,006 | 496 | """
Logger copied from OpenAI baselines to avoid extra RL-based dependencies:
https://github.com/openai/baselines/blob/ea25b9e8b234e6ee1bca43083f8f3cf974143998/baselines/logger.py
"""
import os
import sys
import shutil
import os.path as osp
import json
import time
import datetime
import tempfile
import warnings
from c... |
58765f7c2660a6e6030982c1c9a8ec75f1c98be2ef96c508b3c5d862d109500f | Python | 14,012 | 461 | """
Modify Yang's nmfATAC.cluster2peak.lite.py
- remove the unused inputs for xgi and ygi
- remove the unused method lda
- Add another input support:
h5 file (mat, feature by cluster)
"""
import argparse
import h5py
from warnings import warn
import numpy as np
from scipy import sparse
from scipy import io
from scipy... |
5e4aac07b32a48edf24380781fd44b9917725449e172b7d06e4cf95ab11ae8a9 | Python | 14,014 | 297 | from typing import Optional
import os
from pathlib import Path
import pandas as pd
import numpy as np
from itertools import permutations, product
import scanpy as sc
import requests
import zipfile
from tqdm.auto import tqdm
def _download_from_url(file_url: str, save_path: Path):
"""
Downloads a file from a ... |
71d05173947b3a409fe50c8130bb73ee40d6f967f9b40b30cb8318b968f4e05a | Python | 14,016 | 362 | """Round-45 hon1_1 immunizer -- structural model-held-generator inventory by container PROTOCOL.
r42 corr2_1 promised to catch a generator the model itself HOLDS (even drawn on a pre-existing,
non-hooked thread). r44 hon1_1 found the container recursion incomplete: the sweep descended only
``list`` / ``tuple`` / ``set... |
f69d3a72c29e512fa73e0ee47aedff762a6eb015e3b736920859a39d87694a86 | Python | 14,017 | 308 | """Coverage-floor governance: the tripwire floor must be LOCKED, not a YAML literal.
R72 (b9-fable/opus, round 3+4): the nightly coverage job's ``--cov-fail-under``
floor existed ONLY as a workflow literal with a "never lower it (tripwire)"
comment — no test pinned it, so deleting the job or editing the floor down to ... |
7946050cd5dc34a431fff22112c3fd47ad001abb7dcec2011e4687408a2df0e5 | Python | 14,018 | 465 | """
The module contains the conversions to be
used by rpy2.robjects functions and methods.
Conversions are initially empty place-holders,
raising a NotImplementedError exception.
"""
import contextvars
from functools import singledispatch
import os
from typing import Any
import typing
import warnings
from rpy2.rinter... |
798f0eb1dc1c9bed2e8f98afaeed0b19cae0d3021c53d19a2bc146e90282d038 | Python | 14,018 | 343 | """Regression gate for the uninitialized-destination perturbation class (B2).
The dominant ``failed:replay`` class in the menagerie sweep (the diffusers VIDEO
transformers -- Wan*/SanaVideo/SkyReels/ChronoEdit/Helios -- plus the
normalizing-flow families normflows/zuko and torch_geometric's NeuralFingerprint)
was the ... |
af5dd0ce9f00cdb109da8a95cdda8d6e202340878719d714c84281f2b2ec9017 | Python | 14,023 | 360 | """C02 TensorStats kernel + record + renderer pins (lovely items 2-5).
The two blocking round-1 numerical pins (offset cancellation, fp16
underflow), the N(1e6, 1) anti-regression golden, the sampler-aliasing
regression with its strided negative control, the end-bin invariant with a
failing-cap negative control, the e... |
daf2f54275b0809e69202e53f65896cef5a7a2e1e3fac6078deb7a809fb4bc0a | Python | 14,024 | 417 | import itertools
import optuna
import gc
import torch
import numpy as np
from torch import optim
from model import makemodel
from sklearn.utils import shuffle
from sklearn.neural_network import MLPRegressor
from sklearn.ensemble import RandomForestRegressor
from sklearn.metrics import mean_absolute_error
from torch_geo... |
c34ac0808e1390ed6e280fc12313be0739a96ccafe0e12b2f65a7a945793b14a | Python | 14,029 | 440 | """Input chunking helpers for forward-only chunked capture."""
from __future__ import annotations
import re
from collections.abc import Iterable, Mapping
from dataclasses import dataclass
from typing import Any
import torch
from .intervention.errors import BatchChunkInputAmbiguityError, ChunkedForwardConfigError
C... |
540440fdf5f25b382caf180ec6d1a6153b79a40098dfe55c66e4d8bdb4945ac9 | Python | 14,032 | 272 | import torch
import itertools
from util.image_pool import ImagePool
from .base_model import BaseModel
from data import aux_dataset
from . import networks
class DecomposeAttnModel(BaseModel):
"""
This class implements the CycleGAN model, for learning image-to-image translation without paired data.
The mod... |
601a9eeb02594537a875ebbdc723ccd7a8300bf61519e9fbc4723a3e23d7c526 | Python | 14,040 | 448 | import os
import torch
from torch.hub import load_state_dict_from_url
from torchvision.datasets.folder import default_loader
from pathlib import Path
from torchvision import transforms
from .alexnet_gn import *
url_root = "https://visionlab-pretrainedmodels.s3.amazonaws.com"
def build_alexnet_model(weights_url, con... |
b6cb345a24c7cfee38d06fb2cc57fbd850d032e53e70b9b839f1c264d7677f29 | Python | 14,045 | 316 | import os
import torch
import pandas as pd
import numpy as np
import scanpy as sc
from sklearn import metrics
import multiprocessing as mp
from sklearn.metrics.cluster import adjusted_rand_score, normalized_mutual_info_score
from sklearn.metrics.cluster import (
v_measure_score, homogeneity_score, completeness_scor... |
5cfd0661cdbea9f975b6f2f7922b647578f40d99d6de46a66f6fa025143ababc | Python | 14,046 | 360 | """Implementation of the Observer pattern."""
import sys
import threading
import warnings
import weakref
from weakref import WeakMethod
from kombu.utils.functional import retry_over_time
from celery.exceptions import CDeprecationWarning
from celery.local import PromiseProxy, Proxy
from celery.utils.functional import ... |
1d0c3be233d30b500fd2688675d3674ebdba2473c9a942d9a6e42a620ec09ee8 | Python | 14,047 | 339 | from typing import Any, List, Optional, Tuple, Union
import numpy as np
import pyvista as pv
from anndata import AnnData
from pyvista import MultiBlock, PolyData
from ....logging import logger_manager as lm
from ..utilities import add_model_labels, collect_models, merge_models
from .arrow_model import construct_arrow... |
a4d0b020aa6b0af34ca4172ffc603f958fb0a47b20cb553be3c544d77746ffad | Python | 14,052 | 377 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Functions for converting HCP-YA-format data to fMRIPrep format.
These functions are specifically designed to work with HCP-YA data from the release available in
February 2023.
Because HCP-YA doesn't rea... |
c272b370104dfa16b85ba84e1f476b4727dd1610a3ffb05a5a55a08ee7b48e25 | Python | 14,067 | 333 | """Carry a notebook page's markdown into an extracted workflow's report.
Extraction (:func:`galaxy.workflow.extract.extract_workflow_by_ids`) hands its
``build_report`` hook an :class:`~galaxy.workflow.extract.ExtractionLabelIndex`
mapping the ids the page references to the labeled workflow steps/outputs it
built. Thi... |
2df3969ce92a2a6610041ff1674995a0a95af00c8125494b8141857b70afbe6d | Python | 14,068 | 356 | """Site-key join (three-layer rule, verdict tiers) and the tier-(a) fold
closure: the memo's adversarial corpus, each case probe-validated in the
canonical census drivers before becoming a test obligation here.
The join corpus (memo 3.6):
(i) equal-cardinality alternative branches -- guard passes, witness
REFU... |
7c898145375ff3219f47bc27045372bf4e3192635800aa6f6f4c6540ba841a6e | Python | 14,068 | 287 | '''Provides for gradient based interpretation at the level of the embedding vectors using the Captum library'''
import torch
import numpy as np
from bioseq2seq.bin.transforms import CodonTable, getLongestORF
from base import Attribution, OneHotGradientAttribution
import torch.nn.functional as F
import matplotlib.pyplot... |
c43bd4eef31a69ae3db279a03d6ff6b1d99bdaa35b740ed7c2c86d07f21d9739 | Python | 14,072 | 344 | """Job control via the Condor DRM via CLI.
This plugin has been used in production and isn't unstable but shouldn't be taken as an
example of how to write Galaxy job runners that interface with a DRM using command-line
invocations. When writing new job runners that leverage command-line calls for submitting
and checki... |
a6f2539efcbf4e75e94c8b4c8e7c6cd94f1d81f011f3562f31e4e8ac519b8c33 | Python | 14,074 | 255 | #!/usr/bin/env python3
"""Section 1 的新颖性声明必须有一份**真实存在**的检索记录。
背景(本轮修的第 5 条)
----------------------
§1 曾写:
On the scope of the searches recorded in the Code availability statement,
the combination studied here has not previously been quantified: ...
Code availability 一节只交代了归档地址、脚本清单、依赖与许可证——**没有任何数据库、
检索日期、检索... |
ee2d16508fe366f4394cca1228f3f37fbed97323037c326e41a20dcd737f8905 | Python | 14,074 | 373 | # Copyright (c) 2022, Tri Dao.
# Inspired by / adapted from https://github.com/rwightman/pytorch-image-models/blob/master/timm/models/vision_transformer.py
import math
import re
from collections import OrderedDict
from copy import deepcopy
from functools import partial
import torch
import torch.nn as nn
import torch.n... |
050649b0687aad2bd2ec3e4530664bc5c9e757c2cbbe9a0a71ad1f37846e5f32 | Python | 14,077 | 360 | """Backward/grad integrity regression tests (fix-bwgrad lane, grind-p3 T2).
Each test here is red-capable: it FAILS against the defect it pins and passes
only with the corresponding fix in place.
"""
import pytest
import torch
from torch import nn
import torchlens as tl
from torchlens.options import CaptureOptions
... |
d02a1a13293d693f624f9384417a5a3f748c20b902496b5362970872df922b89 | Python | 14,077 | 360 | from keras.src import backend
from keras.src import initializers
from keras.src.api_export import keras_export
from keras.src.optimizers import optimizer
from keras.src.saving import serialization_lib
from keras.src.utils import tracking
@keras_export(
[
"keras.optimizers.LossScaleOptimizer",
"ker... |
8d2d5da0d916cd5aa9caa0adb5826f5955e35d803bee679d6557bb4c0b47a04e | Python | 14,079 | 321 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""Shuffled Controls trial on the Columbia yeti cluster.
"""
import time
import sys
import os
import stat
import subprocess
import logging
import crf_util
from shuffled_control_crfs import ShuffledControlsTrial
class ShuffledControlsTrialYeti(ShuffledControlsTrial):
"""... |
02f401633bfdc073f921b575a703c7499f45a6031818ce074d5687f671758cab | Python | 14,080 | 391 | """
Unit tests for stimulators/triggers.py.
Tests all trigger conditions: InactivityTrigger, MidlineCrossingTrigger,
PeriodicTrigger, TimeRestrictedInactivityTrigger, and TRIGGER_REGISTRY.
"""
import unittest
from unittest.mock import Mock, patch
from ethoscope.stimulators.triggers import (
TRIGGER_REGISTRY,
... |
09dd541be591cbe971880a6edb62fb8352f356b873f8eb7e106306ad4da288b6 | Python | 14,083 | 302 | """
Simulates data to determine good optimization hyperparameters.
Uses msprime to simulate data with recombination maps drawn
from the HapMap recombination map, and then infers recombination
maps on the simulated data. Writes various measures of accuracy
(correlation in several forms and scales; L2 norms) to a file.
... |
19f79d39793cd50e74a3ef3924e8ce2c48446f5927d7d13adcbfcc70e6932d50 | Python | 14,084 | 455 | """Video classes"""
import json
import subprocess
import wave
from functools import lru_cache
from typing import (
cast,
)
from galaxy.datatypes.binary import Binary
from galaxy.datatypes.metadata import (
ListParameter,
MetadataElement,
)
from galaxy.datatypes.protocols import DatasetProtocol
from galaxy... |
4a725d8675d2185e8e711b6464ec69d0917588f90d3246bde2fe300b70051765 | Python | 14,094 | 354 | import os
import numpy as np
import paddle
import pgl
import pickle
from pgl.utils.data import Dataset as BaseDataset
from pgl.utils.data import Dataloader
from scipy.spatial import distance
from scipy.sparse import coo_matrix
from dataloader import DualDataLoader
from tqdm import tqdm
def cos_formula(a, b, c):
re... |
d1e765d877fca923c13fb0d5f841a80a606d27d44fc0e4e253eee76083645cec | Python | 14,098 | 388 | """
Utilities, accessible via subcommands.
"""
import datetime
import itertools
import json
import os
import re
import shutil
import sys
import click
import numpy as np
import pandas as pd
import vampire.common as common
from vampire import preprocess_adaptive
from vampire.gene_name_conversion import convert_gene_n... |
1a827c10a69d89781b31971af5b37ac7a04add9fa33da107d0ca3bff5cd7700a | Python | 14,099 | 387 | """Stage 9 representative-corpus resolver release gate."""
from __future__ import annotations
import gc
import json
from collections import Counter
from typing import Any
import pytest
import torch
from torch import nn
from torch.nn import functional as F
import torchlens as tl
from tests.classics_corpus._loader im... |
5abf758186b079fc0560831e2a96f09c7c652c32f992fd35eed71c16cdb48c6a | Python | 14,100 | 411 | """TensorFlow backend validation tripwire tests."""
from __future__ import annotations
from dataclasses import replace
from typing import Any
import pytest
from conftest import tensorflow_backend_modules
import torchlens as tl
from torchlens.backends.tf import TFBackend
from torchlens.backends.tf.validation import ... |
4f0e78a5f317e2c732f801f092d2c0343030a1a2616771064d8ffdedf0847fbf | Python | 14,101 | 379 | """StyleTTS2 and RawNet3: neural speech synthesis and speaker verification.
StyleTTS2:
Li et al., "StyleTTS 2: Towards Human-Level Text-to-Speech through Style
Diffusion and Adversarial Training with Large Speech Language Models."
arXiv:2306.07691 (NeurIPS 2023).
Source: https://github.com/yl4579/StyleTTS2
Ra... |
2d665677a87a7c29856f10f6e352277bd1973f2df730a0037b14ee55c3ab5ad0 | Python | 14,104 | 324 | import re
from collections import OrderedDict
import pytest
import torch
import torch.nn.functional as F
from einops import rearrange
from transformers import BertConfig
from transformers.models.bert.modeling_bert import BertForPreTraining as BertForPreTrainingHF
from transformers.models.bert.modeling_bert import Bert... |
b025d8554fbd16251ae96ac954842e231682e6cd7505a606a25b748efabf9b29 | Python | 14,104 | 308 | """User-submitted notification requests, e.g. tool installation requests.
A request notification is one a regular (non-admin) user may submit through
``POST /api/notifications``. The client controls only the fields on the
category's create model: a per-category :class:`NotificationRequestHandler`
gates the feature, re... |
caa32b392f3f8535acaba86e9e2b7f05caabb8ff0847ec0a69ca9ba36b783919 | Python | 14,104 | 484 | """A module-scoped edit on a module whose output the model returns applies exactly once.
Post-postprocess, every value the model returns gets a synthetic ``output_N`` node that
aliases the producing op and carries that op's module stamp for display. Post-hoc
``tl.module(M)`` / ``tl.in_module(M)`` used to resolve to th... |
14ea8feb7bba765568f6fbec2f4d80c19300cb884ec7b6a248ec8a7ca0bb07b0 | Python | 14,108 | 380 | """P1 unit proofs for the capture-outcome authority module.
Covers the frozen vocabularies, the string-only payload codec (fail-closed
parse), the status-specific load coherence matrix, the structural derivation
lattice (including the absent-key / ``None`` variants), the capability table
chokepoint (forged-sidecar arm... |
c431125ab1b7585736d09e2ac307c51bdbb8a83377dbb4ebb5dddb3df409de9f | Python | 14,110 | 389 | """
Author: Derek van Tilborg -- TU/e -- 23-05-2022
Utility functions that are used by several different models.
- GNN(): Base GNN parent class for all graph neural network models
- NN(): Base NN parent class for all basic neural network models (MLP and CNN)
- graphs_to_lo... |
97fc75812f45dd422403bdc4e6d64e015dbe91b8f652e979fdd29e6bacd258be | Python | 14,116 | 383 | # 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... |
fe3e7453695a8a0f6245ae56909f15ba563e553f714a41b061fcb592ca653f50 | Python | 14,117 | 493 | """
Logger copied from OpenAI baselines to avoid extra RL-based dependencies:
https://github.com/openai/baselines/blob/ea25b9e8b234e6ee1bca43083f8f3cf974143998/baselines/logger.py
"""
import json
import os
import os.path as osp
import sys
import time
import warnings
from collections import defaultdict
from contextlib ... |
0189a958bbe81c770e33fc6beb9627d9c51da7019d017dc6a997cfbde64ba11a | Python | 14,121 | 384 | # Copyright 2021 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 agr... |
ec8236ccab37ff3ae9670e5ed97808e155dc19472c144695311d694985f98b6a | Python | 14,126 | 316 | import os
import sys
import datetime
import numpy as np
import pandas as pd
from pandas.api.types import is_string_dtype, is_numeric_dtype, is_categorical_dtype
from azureml.core import Workspace, Datastore, Dataset, Environment
from azureml.data.dataset_factory import DataType
tr ='' #custom path to wd
sys.path.app... |
583667706421eacffd6ee8750410017d65c42e04afe3e7848ec3a42118afc684 | Python | 14,130 | 345 | import pandas as pd
import numpy as np
from scipy.stats import binned_statistic
import os
import pickle
from joblib import Parallel, delayed
from matplotlib.colors import ListedColormap
from anatomy import *
from lfp import *
## Set this to histology export path for convenience ##
## Alternatively pass a path to "loa... |
4c83849bf694bdee5a7bcd14f816e10a5a088dc5ff53dda6410cd05111191362 | Python | 14,131 | 377 | #!/usr/bin/env python
# =============================================================================
# MODULE DOCSTRING
# =============================================================================
"""
Test MAF layer in ``tfep.nn.embeddings.mafembed``.
"""
# =========================================... |
78cb0769f845128cad26cd9a34a0fc583d9702d1f4e3966a85c9d5882ea42d18 | Python | 14,133 | 408 | import numpy as np
import torch
from skimage.metrics import structural_similarity as ssim
from edamame.utils import is_notebook, config
from edamame.analysis.misc import getRNMSE
torch.set_default_tensor_type("torch.cuda.DoubleTensor")
class OL_kernel_GPU :
def __init__(self, N, M, e_bar = 1, eps = 1e-16, activa... |
2116e85a5148d67c8ecaf4f229c327bded3c958493877f7c51bd4b2b07a23640 | Python | 14,137 | 216 | import torch
# from rdkit.Chem import rdMolDescriptors, MolSurf
# from rdkit.Chem.Draw import SimilarityMaps
import seaborn as sns; sns.set(color_codes=True)
import numpy as np
import sys
sys.setrecursionlimit(50000)
torch.nn.Module.dump_patches = True
import pandas as pd
from AttentiveFP import Fingerprint,... |
bba9e19a2ddaff41a5d6d1e9b62eaa101cdd2659045fb493245debfcde76a55a | Python | 14,139 | 426 | # normal imports
from prob2020.python.bed_line import BedLine
import numpy as np
import pandas as pd
import csv
from collections import OrderedDict
from functools import wraps
import warnings
# logging import
import logging
import datetime
import os
import sys
logger = logging.getLogger(__name__) # module logger
# ... |
d997dbab7fa425aac12c07d1aac7939f0574eea1f851484274b2b52d87d00e48 | Python | 14,141 | 420 | from functools import lru_cache
from typing import Generator
import numpy as np
from mirp._features.dzm_matrix import MatrixDZM
from mirp._images.generic_image import GenericImage
from mirp._masks.base_mask import BaseMask
from mirp._features.histogram import get_discretisation_parameters
from mirp._features.texture_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.