sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
43b66e780e08a9732a6a6a916c45979955944b826cfa10400b1e4ea98e4149d1
Python
2,891
84
"""Live-refresh RunReport declares host-RNG nondeterminism (deephunt F2). The loaded-sparse provider derives ``nondeterministic_sources`` from the descriptor's RNG profile, but the live-refresh provider historically never passed sources to the one report finalizer, so a Python-``random``/clock model reported a determi...
96dae5eff68165c2bd13dbc7dbfbf63aa4a83b558884c3072225bf10e4ab75a9
Python
2,891
96
from typing import Optional, Union from anndata import AnnData from .._compat import Literal from PIL import Image from pathlib import Path # Test progress bar from tqdm import tqdm import numpy as np import os def tiling( adata: AnnData, out_path: Union[Path, str] = "./tiling", library_id: str = None, ...
a27885e6fecc2c21026f714ca299e022a5681ff79a47c9efdf950fb260073f80
Python
2,892
87
import numpy as np import pandas as pd from anndata import AnnData from natsort import natsorted from sklearn.cluster import DBSCAN def localization( adata: AnnData, use_label: str = "leiden", eps: float = 20.0, min_samples: int = 1, copy: bool = False, ) -> AnnData | None: """\ Perform lo...
10a8e28c5e012a54f907f9098431ee5c3e1fe08672307c936450c5093a4b77ab
Python
2,893
54
#==============================================================================# # Author: Dominik Müller # # Copyright: 2024 IT-Infrastructure for Translational Medical Research, # # University of Augsburg ...
3242a268cb522da2e4b745515dac2949280cdd4bcea548bed2689b8da4ce3d72
Python
2,893
84
"""Typed run-door refusal for ``run(seed=<non-int>)`` (r77 nit). Round-76 (free-roam) found ``seed`` typed ``int | None`` but unchecked: junk reached ``torch.manual_seed`` raw and escaped as torch's ``RuntimeError: manual_seed expected a long`` instead of the typed precondition lane. Verified transactional pre-fix (gl...
4baf80c87bf3be2ca7104b873b13bcb9890c23665c9312da2dac2c6f84e581b1
Python
2,893
97
import json import os import ast from src.utils.util import make_exp_dir class Config(object): def __init__(self, filename=None, kwargs=None, mkdir=True): # Dataset parameters self.dataset = "fewglue/BoolQ" self.num_lbl = 2 self.max_num_lbl_tok = 10 self.max_num_lbl = 10 ...
8f7928ce9cb1390c9170de9cdd744f72720cb75ddc6386422037345029aecab7
Python
2,893
74
import glob import numpy as np import random import fnmatch import os from PIL import Image from matplotlib import pyplot as plt import PIL from sklearn.model_selection import train_test_split from sklearn.decomposition import PCA #from tensorflow.keras.utils import to_categorical from sklearn.metrics import confusion_...
e30eb53606719822260b2dc84bf080c5fdff0c6c84b42f19b6eb7bc7dec0561b
Python
2,893
87
# --- 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 Textfont(_BaseTraceHierarchyType): _parent_path_str = "scattergeo.selected" ...
8b0b57e73e18a36b9bcc5ae8fb25275b1ffb74ac0be4db209769eaf18bdbb997
Python
2,897
107
from __future__ import annotations import argparse import nox nox.needs_version = ">=2024.3.2" nox.options.sessions = ["lint", "tests", "tests_packaging"] nox.options.default_venv_backend = "uv|virtualenv" @nox.session(reuse_venv=True) def lint(session: nox.Session) -> None: """ Lint the codebase (except f...
c5fe235861da77169289052dd2907052c070ecdc6db0e23b57d302d5f3657757
Python
2,897
83
import tensorflow as tf # Local dependencies import metrics import rcan import care import srgan import RESNET import WUnet import UnetRCAN def create_strategy(): strategy = tf.distribute.MirroredStrategy() print(f'Number of devices: {strategy.num_replicas_in_sync}') return strategy def compile_model(...
d6af57ed06f7f1ed2c14183de47eaba5cba5d845221d314e71ba44e7295b140f
Python
2,897
84
import os import subprocess import threading import errno import pytest from pysam import AlignmentFile from TestUtils import make_data_files, BAM_DATADIR def setUpModule(): make_data_files(BAM_DATADIR) def alignmentfile_writer_thread(infile, outfile): def _writer_thread(infile, outfile): """read ...
fd623c139b680bf400cefb98ecd13a81219b9bfba31a13b5ceda10460909708d
Python
2,897
104
# --- 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 Title(_BaseLayoutHierarchyType): _parent_path_str = "layout.polar.radialaxi...
b6a7fd4653567923840cb566c985ae5a7de640c6d3515992468c56a03367f079
Python
2,898
105
import pytest from pyrosm import get_data @pytest.fixture def test_pbf(): pbf_path = get_data("test_pbf") return pbf_path @pytest.fixture def helsinki_pbf(): pbf_path = get_data("helsinki_pbf") return pbf_path def test_parsing_landuse_with_defaults(test_pbf): from pyrosm import OSM from py...
660bd2adf42ae5ee9163959a7c906d2ca933561fbdc813020f098ce4f71a4b6e
Python
2,899
106
""" ==================================================================== One-way Manova with frequency ==================================================================== One-way Manova to compare Left vs Right for each frequency. """ from time import time from mne import Epochs, pick_types, events_from_annotations...
aa0681dad50a195511a8f78e23bec69eb68c8a5f894c1ffbe98564428f1df448
Python
2,899
91
import networkx as nx from stlearn.pl.utils import get_node from stlearn.utils import _read_graph def shortest_path_spatial_paga( adata, use_label, key="dpt_pseudotime", ): # Read original PAGA graph G = nx.from_numpy_array(adata.uns["paga"]["connectivities"].toarray()) edge_weights = nx.get_...
257bc3b7fcce35cb93c731eaf6464b1fb197151cf94acc3e0f75fad6d8837acf
Python
2,900
85
from pyrosm.data_manager import get_osm_data from pyrosm.frames import prepare_geodataframe from pyrosm.utils import validate_custom_filter, require_layer_key, warn_empty_result # Values of ``building`` that mark a part of a building (an entrance, a window) or say # that a feature is not a building. NOT_BUILDINGS = fr...
ac993e823e85fac1e0817006f7b761ca7a941c5160029c992d681a1b6c421cc1
Python
2,900
94
from __future__ import absolute_import import hashlib from pip._vendor.six import iteritems, iterkeys, itervalues from pip._internal.exceptions import ( HashMismatch, HashMissing, InstallationError, ) from pip._internal.utils.misc import read_chunks # The recommended hash algo of the moment. Change this wheneve...
d42fe87a8dcd9e849d574e3b55d1aee41bcdbd167cd8204a16d4bb93593b3431
Python
2,900
78
from __future__ import annotations import os import socket import time from contextlib import closing, suppress from time import monotonic from unittest.mock import Mock, patch from pytest_celery import CeleryTestSetup from celery import uuid from celery.events.state import HEARTBEAT_DRIFT_MAX from celery.utils.obje...
33e16c3141356c844a5969f36fd0ed53430a3121b19d15a7e687de8d365bb189
Python
2,901
112
""" Centralized ROI-to-channel mappings for mAGO-based hardware modules. All mAGO firmware modules share the same serial protocol but use different channel layouts depending on module type and connected hardware. This module consolidates the scattered channel maps from individual stimulator classes. Channel layout re...
f35c5fda5d6e31db5a31c9e13b4032c853fda95bb2daafece7bdc4d00d7492b6
Python
2,901
94
import warnings class deprecated(object): """Mark a function or class as deprecated (decorator). Issue a warning when the function is called/the class is instantiated and adds a warning to the docstring. The optional extra argument will be appended to the deprecation message and the docstring. N...
69d2ad68e8e0656bc797e3a1ab7f46698e1747662790f592a91530f37f6fda06
Python
2,902
73
""" Classes for all common sequence formats """ from galaxy.datatypes.data import get_file_peek from galaxy.datatypes import data from galaxy.datatypes.metadata import MetadataElement import logging log = logging.getLogger(__name__) class GenBank( data.Text ): """ abstract class for most of the sequence ...
ad1f86056e8dd389951edaa78b474f52e57af8f91d1197c0656f232a29a2c6bf
Python
2,902
96
import sys from datetime import datetime from .DL import DelhiDB from .GA import GoaDB from .HR import HaryanaDB from .KA import KarnatakaDB from .KL import KeralaDB from .MH import MaharashtraDB from .MP import MadhyaPradeshDB from .PB import PunjabDB from .TG import TelanganaDB from .TN import TamilNaduDB from .UK ...
88ccf76d184346773235cb2b850936edc26a64a38cf066b2b3d15ac6c9579fc7
Python
2,903
82
import json import sys import threading from typing import Any def _locate_schedd( htcondor, schedd_cache: dict, schedd_lock: threading.Lock, collector: str | None, schedd_name: str | None, ): cache_key = (collector, schedd_name) with schedd_lock: cached = schedd_cache.get(cache_ke...
f3a0ca91e95838efb6a4515b1cfe12020852de196d2deca39c6fba04e0ad98cc
Python
2,903
81
import torch from torch import nn from schnetpack.nn import shifted_softplus, Dense class EndToEndModel(nn.Module): """ Join a representation model with nn module. Args: representation (torch.nn.Module): Representation block of the model. output_module (e.g. nn modul): Output block of the...
94b0046ec6bc6e2d84629b04d43edfffe4e10865249f499444d4b677c4bcae0d
Python
2,904
87
# --- 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 Textfont(_BaseTraceHierarchyType): _parent_path_str = "scatterpolar.selected"...
a2b10323bfc3a0a776259a993903d8486953b4b253ddabf5b9c4f2897f8e0d26
Python
2,904
87
# --- 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 Textfont(_BaseTraceHierarchyType): _parent_path_str = "scattersmith.selected"...
c4fc5d27bd4c2bb426b57993e67609b33d6b6b3ebfd2fbcfe607a032f7e90ba7
Python
2,904
78
# Copyright (c) 2023 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...
5477b3332ed385b7aa43ca35922c11898fb081a520bba1983d9f84d058cb702c
Python
2,905
87
""" Utilities for manipulating or evaluating the R language. """ # TODO: uuid is used to create a temporary symbol. This is a ugly # hack to work around an issue with with calling R functions # (language objects seem to be evaluated when doing so from rpy2 # but not when doing it from R). import typing imp...
c704a60e8aa84031f1ea050bf78018ce1bffab690fb372e07031c512929ed7a7
Python
2,905
99
import warnings import numpy as np import scanpy as sc import tensorflow as tf import sys sys.path.append('../pkgs/scGAE/') warnings.simplefilter(action='ignore', category=FutureWarning) tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR) # scGAE modules from scgae import SCGAE from preprocessing import * ...
27729f1a20110389832a3e7cb0018438e3262c9c5bd5d9de4a61669db7ef4344
Python
2,906
93
from typing import List import plotly import plotly.graph_objs as go from plotly.offline import get_plotlyjs_version def validate_coerce_fig_to_dict(fig, validate): from plotly.basedatatypes import BaseFigure if isinstance(fig, BaseFigure): fig_dict = fig.to_dict() elif isinstance(fig, dict): ...
320002e3bff5d07d20d78e92c5e3c692dc7a1522431821f6d5138bca083b5c9f
Python
2,906
73
from abc import ABC, abstractmethod from typing import List, Union, Optional from config_manager import config_field class Template: """Object to specify required structure of configuration file.""" def __init__( self, fields: List[config_field.Field], nested_templates: Optional[Li...
72d3c0ab65f6b276f90e0d4715d7ca4858ef51023a63ceb8ce15018a1de72e55
Python
2,907
69
""" AvgPool2d w/ Same Padding Hacked together by Ross Wightman """ import torch import torch.nn as nn import torch.nn.functional as F from typing import List, Tuple, Optional from .helpers import tup_pair from .padding import pad_same, get_padding_value def avg_pool2d_same(x, kernel_size: List[int], stride: List[int...
a766a23d2fcc49d47e67ee6ece67166481c209db2cef6b7e55b54741918bd070
Python
2,907
82
"""Intervention honesty: fire records count the CURRENT value's fires (edits memo row 0e -- the 2-edits-3-records over-count). A replay push recomputes each site from capture truth through exactly this push's hook fires, so the push REPLACES the site's replay-minted node-hook records instead of extending them. Live-do...
4c890a781aafc5c829b0a17649e4316ecdfcb66b90a07211005cca0830bc3b19
Python
2,908
108
from typing import Literal from anndata import AnnData from .global_level import global_level from .local_level import local_level from .weight_optimization import weight_optimizing_global, weight_optimizing_local def pseudotimespace_global( adata: AnnData, use_label: str = "leiden", use_rep: str = "X_p...
67eaac9d4ff9f39abbe8973adfe47dfc205ffc990cb65aa5c4a53d771701316c
Python
2,908
75
#!/usr/bin/env python3 """Empirical p-value and manuscript sentence from permutation null accuracies.""" import argparse import os import numpy as np OBSERVED = {"stroke": 0.5404, "healthy": 0.6232} def load(path): ext = os.path.splitext(path)[1].lower() if ext == ".npy": a = np.load(path) elif ...
791b359d9ce417df5c3bda92ae229fa7d8baa165df4071437af67655de00df00
Python
2,908
33
config = { 'SERVER' : 'http://localhost:8080', # localhost, URL of your homepage e.g. 'https://biomedisa.info' or your internal IP e.g. 'http://192.168.176.30' 'SERVER_ALIAS' : 'biomedisa-001', # an alias name for your server (for email notification and logfiles) 'SECRET_KEY' : '...', # some random string ...
0146c6c62691b9fc75fad56809b60ce563ae984bb5a9c790a569798acba1e76c
Python
2,909
76
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
1aadf3bce85fefbfc9aa51b609d68f8782bcf9c1a045cafe42c47771b29772fd
Python
2,909
81
"""Generated, closed Tier-R inventory (design-of-record section 2.4). Walks the dataclass graph reachable from the record universe and fails on any field the checked-in classification table does not cover — and on any table entry whose field no longer exists. The inventory is therefore mechanically closed in both dire...
53a2e0e589efcc004875ac20bbe74e9e84036dd80739988a81b61899de4a50d1
Python
2,909
87
# --- 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 Textfont(_BaseTraceHierarchyType): _parent_path_str = "scattercarpet.selected...
73317312940a1c7327c393f01103c0a40efdb2d0bd1c94886e8b803a080ad17b
Python
2,909
88
"""FlopCounterMode differential legs (M(oracles) item 12; F36 oracle wave 1). torch.utils.flop_counter.FlopCounterMode is the EXTERNAL oracle (I2, ships with torch): TorchLens's analytic MAC census must satisfy the exact convention identity ``torch_total == 2 * true_MACs`` on MAC-only models (FlopCounterMode counts ma...
ed8d1463e30c6144a62f1a6ae3864b73a09e64dd71243c1e3399eb4d598f2872
Python
2,909
114
"""Smoke tests tasks.""" from __future__ import annotations import os import sys from signal import SIGKILL from time import sleep import celery.utils from celery import Task, current_app, shared_task, signature from celery.canvas import Signature from t.integration.tasks import * # noqa from t.integration.tasks im...
071fb7b0c72f679f723bcea056e207dd5ce2baad1a3a2e3f95aa5da77722d5fe
Python
2,910
88
import torch import torch.nn as nn from spliceai_torch import ResidualUnit class SplicePointIdentifier(nn.Module): def __init__(self, cl, asymmetric_cl, hidden_size, n_layers=3, starting_channels=4): super().__init__() assert cl % 2 == 0 if asymmetric_cl is None: first_layer =...
3163d724416e5c3089c7ace8b3af8330ac5bd982cbb588a5442095b071c22a6b
Python
2,910
82
# Copyright (c) ByteDance, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import os from typing import Any, Callable, Optional, Tuple import PIL.Image as PImage from timm.data import IMAGENET_DEF...
f60b2aabdcd01c46dc8781a893d978a74b34c69d4dc8b3413c04c2927f17c4ae
Python
2,910
119
import gc import os import re import time import pytest import gym from gym.wrappers.monitoring.video_recorder import VideoRecorder class BrokenRecordableEnv(gym.Env): metadata = {"render_modes": ["rgb_array_list"]} def __init__(self, render_mode="rgb_array_list"): self.render_mode = render_mode ...
1145ef90b9e3be726cfb42a53ea6644cc9ea9c1038b106270fe9d4193b3817e6
Python
2,911
104
# --- 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 Legendgrouptitle(_BaseTraceHierarchyType): _parent_path_str = "pie" _path...
3141fdeac62ecc887ef337ea40587e09b379e84d9f1d058706b4bbd6b4e47d5e
Python
2,911
104
# --- 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 Legendgrouptitle(_BaseTraceHierarchyType): _parent_path_str = "box" _path...
47fb414f582653d73147adfdd6e9f1b3899b7a47f827f56891c23e0f2e2d372a
Python
2,911
87
# This example requires the following dependencies to be installed: # pip install lightly # Note: The model and training settings do not follow the reference settings # from the paper. The settings are chosen such that the example can easily be # run on a small dataset with a single GPU. import copy import pytorch_l...
dfc990c19e2eb538ba0df8ac481e00e7f61e21d98865b7d81bbc778625c8ca9b
Python
2,911
104
# --- 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 Legendgrouptitle(_BaseTraceHierarchyType): _parent_path_str = "bar" _path...
ac0d3bf9ba867c5a9935546ddac1ce43535eff1f129f4a779ce34344d99a2901
Python
2,912
63
import numpy as np import cvnn.layers as complex_layers import tensorflow as tf from pdb import set_trace def get_dataset(): (train_images, train_labels), (test_images, test_labels) = tf.keras.datasets.cifar10.load_data() train_images = train_images.astype(dtype=np.complex64) / 255.0 test_images = test_im...
008203aa010311fc84aa1ddd25223ab14eba831889e453527a769a1d128085c4
Python
2,913
74
from .bulletin import Bulletin from bs4 import BeautifulSoup class Uttarakhand(Bulletin): def __init__(self, basedir): statename = 'UK' super().__init__(basedir, statename) # NOTE: Need to update this list of URLs every 2-3 months or so self.bulletin_urls = [ "https:...
2f2b975798c5dc9c6f6ac732a318ae3574192602c107f44f5714670e5c99d595
Python
2,914
111
""" Feature calculations. """ import types import pdb import numpy as np from rdkit import Chem from rdkit.Chem import rdGeometry, rdMolTransforms from deepchem.utils.save import log from dcCustom.feat.proteins import Protein __author__ = "Steven Kearnes, modified by Qingyuan Feng" __copyright__ = "Copyright 2014, Sta...
3d71592e9d267208f3e14aa697004e612fcc6ed234508c41fc163514af71a2af
Python
2,914
87
# --- 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 Textfont(_BaseTraceHierarchyType): _parent_path_str = "scatterpolargl.selecte...
54e7358c521d3c4d6cd28188711f9448fe1c0eeae2e2c484d54bc3032955128b
Python
2,914
87
# --- 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 Textfont(_BaseTraceHierarchyType): _parent_path_str = "scatterternary.selecte...
57071da194c476e68e307ec1f189cf4f0c664fff88a0caa9a52c7acb4d3b0066
Python
2,914
93
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Import raw (MaxFiltered) MEG data to remove metadata then save in same format for further BIDSifying. @author: mikkel For information about NatMEG-PD please refer to the data descriptor: Vinding, M. C., Eriksson, A., Comarovschii, I., Waldthaler, J., Manting, C. L.,...
5e33ccc038b2321b2c8005a7b4c9542b42a71ab35e8edc6ba4b2fee6a13bee60
Python
2,914
89
"""Shared journal-grabbing probe for the P4 test files. Intercepts step-0 materialization to hand tests the REAL journal entries a tiny capture produced, without depending on postprocess internals beyond the one compat seam every path routes through. Since P7 there is ONE torch producer (decomposed ``OpRecord``). The...
d409b587694de3e3a88fc4a613a760c8fe0becdc08d57f268df4ebbbabbbcd8a
Python
2,914
92
# 05/23/2023 Fengyao Yan # Validation test on semi silico cmp data import random import numpy as np import pandas as pd from numpy import NaN import tensorflow as tf from sklearn.metrics import mean_squared_error from scipy.stats import pearsonr from gen_composition import gen_comp from decide_organ import model_name,...
99d16afe6e2045148f61d1ae7e0239712be372a5b8a35d30da559f83e120049a
Python
2,915
85
import json import os import sys import traceback import urllib.request from packaging.version import parse as parse_version from PyQt6 import QtCore class UpdateWorker(QtCore.QObject): finished = QtCore.pyqtSignal() data_ready = QtCore.pyqtSignal(dict) @QtCore.pyqtSlot(str, str) def processUpdate(s...
bc71edfa4b1cb7af64b78def09e790ff4c6fe64ab4fcf8e3d9699f44e8d3c0a0
Python
2,915
97
# Copyright (c) 2025, Tri Dao. """Unified FlashAttention logging controlled by a single ``FA_LOG_LEVEL`` env var. Host-side messages go through Python ``logging`` (logger name ``flash_attn``). A default ``StreamHandler`` is attached automatically when ``FA_LOG_LEVEL >= 1`` so that standalone scripts get output withou...
1180fe21d4efc7b26943dd62ecd9fb6b99f0ad76feb7423450a03da586e56acf
Python
2,916
92
#!/usr/bin/env python ## # This script reads multiple alignments merged in single stockholm file # and splits the alignment blocks according to data.names table # The first sequence of each alignment file assumed to match to names table entries # Author: M. Miladi ## import re import sys from Bio import AlignIO try:...
d13ee4df2883e007e752cf46b04da3324fa60c89f9779d35d464b4925794ad5a
Python
2,916
76
"""Parse ISO8601 dates. Originally taken from :pypi:`pyiso8601` (https://bitbucket.org/micktwomey/pyiso8601) Modified to match the behavior of ``dateutil.parser``: - raise :exc:`ValueError` instead of ``ParseError`` - return naive :class:`~datetime.datetime` by default This is the original License: Copyrig...
d3ff3558de48d6c826f4daea1ad365d11edad4851ff2e6c29851be07f938c2cb
Python
2,916
95
""" #-------------------- Created on 2021.10.24 Version 1.0 __author__ = 'Xx' #-------------------- """ ''' Description: Routine for determining the level of confidence of a particular clear sky test. Input single threshold value ('midpt') with associated confidence limits ('locut', 'hicut'). "Low" and...
db45dca59c8b146f5c935bcef0659d21249a4d650779d1ee0de6bf309122a15a
Python
2,916
90
import numbers import cv2 import numpy as np import PIL import torch def _is_tensor_clip(clip): return torch.is_tensor(clip) and clip.ndimension() == 4 def crop_clip(clip, min_h, min_w, h, w): if isinstance(clip[0], np.ndarray): cropped = [img[min_h:min_h + h, min_w:min_w + w, :] for img in clip] ...
06d8b0f06ef303cb45e8af5b4e29b5e92a5ec573ffd0477406fe4cfd8e1420bf
Python
2,918
104
# --- 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 Legendgrouptitle(_BaseTraceHierarchyType): _parent_path_str = "ohlc" _pat...
1049417779bc5397bb30b97302b36a340ecb0cf59f2feca9a08d6c37cb650775
Python
2,918
104
# --- 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 Legendgrouptitle(_BaseTraceHierarchyType): _parent_path_str = "cone" _pat...
61584d51e64830fdd6260ceec37c141466fdc3c84dae13b93977751a608d054b
Python
2,918
80
""" analyses.core — library functions for the cross-cohort EEG-AD methodology. This package extracts the genuine library functions out of the historical diagnostic_*.py development scripts and exposes them as a stable API. New code (build_trained_model, deploy_classifier, proper_cv, INGEST_TEMPLATE) should import from...
01662406a4035c4f91bb81a23d5cda9c1b1b6101a82398763706e162a8337470
Python
2,920
99
""" setup.py ======== This is the setup.py script for Eelbrain. http://docs.python.org/distutils/index.html https://setuptools.readthedocs.io/en/latest/setuptools.html About MANIFEST.in: https://docs.python.org/2/distutils/sourcedist.html#manifest-template """ # Setuptools bootstrap module # http://pythonhosted.o...
827ddb661c91fa335a0fc841a7a7a68ef2c6d915e19a3466deeff69ac291c973
Python
2,920
69
"""Input distributions""" import logging import neurom as nm from neurom import load_neurons import tmd from tns.extract_input.from_TMD import persistent_homology_angles from tns.extract_input.from_neurom import soma_data, trunk_neurite, number_neurites from tns.extract_input import from_diameter from tns.morphio_util...
d504923f4870d66a7a266dd3bf391c5d8cc418423b6db9fcc28ad5e6c391ef47
Python
2,921
59
from Bio import SeqIO import unittest import os class TestTrinitySampleData(unittest.TestCase): @classmethod def setUpClass(cls): cls.sampledata_dir = os.environ["TRINITY_SAMPLEDATA"] def test_genome_guided(self): seq_count = self.count_sequences('test_GenomeGuidedTrinity', 'test_GG_use_b...
81cefeace6814f506b6437e8af5980d1cc19df67fa273134a18a080097618049
Python
2,922
83
import sys import unittest from unittest.mock import patch import logfire from codecarbon.output_methods.emissions_data import EmissionsData from codecarbon.output_methods.metrics.logfire import LogfireOutput class TestLogfireOutput(unittest.TestCase): def setUp(self): self.emissions_data = EmissionsDat...
991ca5cfae8a60b3c869d9c563a541037e4c4128d3b40968fad1fa2eee8c96d8
Python
2,922
72
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license from __future__ import annotations import shlex import shutil import subprocess import tempfile from pathlib import Path from ultralytics.utils import LOGGER, YAML def _check_atc() -> None: """Raise if the CANN ATC compiler is not on PATH.""" ...
a197a79b4e6f3d91d8773c631a42e93789d18b7e2785cb6154eac788c166fe67
Python
2,922
69
"""Riemannian tangent-space baseline under the same leakage controls as CSP+RF.""" import os, sys, numpy as np, pandas as pd ROOT = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, os.path.join(ROOT, "src")) from sklearn.pipeline import make_pipeline from sklearn.preprocessing import StandardScaler from s...
2e2695292aacea76a2dd287d5005e2c872681f7aa88c604c8c0a5bea49f77fc8
Python
2,925
93
# This example requires the following dependencies to be installed: # pip install lightly # Note: The model and training settings do not follow the reference settings # from the paper. The settings are chosen such that the example can easily be # run on a small dataset with a single GPU. import copy import torch imp...
4f4e35d2bb8e099f327c23bb6dd338a1f4616ef963ff29c13f069d45f7a56415
Python
2,925
105
import pandas as pd import gc from camelot.core import TableList, Table def _merge_tables_samewidth(table1, table2): # return were_tables_merged = False if either of tables is None if table1 is None or table2 is None: return False, None ncols1 = table1.shape[1] ncols2 = table2.shape[1] ...
6c47ef3b6d321a971333052d1246d8a77d6e0c1e21185ada98a687de5499a961
Python
2,925
66
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created in April 2020 @author: Thomas Bonald <bonald@enst.fr> @author: Nathan de Lara <nathan.delara@polytechnique.org> """ import unittest from sknetwork.data.test_graphs import * from sknetwork.linalg import Laplacian, Normalizer, CoNeighbor from sknetwork.linalg.ba...
c9b24d4fa431c8d93038f59dfc324460f2374f44fac8874a64492eb8191cbdfb
Python
2,925
104
# --- 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 Legendgrouptitle(_BaseTraceHierarchyType): _parent_path_str = "image" _pa...
e581b65f486997df54cb10f5217b15be85806c3665b0795d35b08ee8abc1dc9e
Python
2,925
104
# --- 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 Legendgrouptitle(_BaseTraceHierarchyType): _parent_path_str = "table" _pa...
fcf8d3ec19ee74e52df212285208392704f1d2e025565a7b154bd5d303141ea9
Python
2,925
104
# --- 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 Legendgrouptitle(_BaseTraceHierarchyType): _parent_path_str = "splom" _pa...
28c6c0be7e2235f18621ca5d53ab0070763481ebda81e17d867f2dc28eae0150
Python
2,926
105
"""Shared TensorFlow backend test configuration.""" from __future__ import annotations from importlib.metadata import PackageNotFoundError, version from typing import Any import pytest from packaging.version import InvalidVersion, Version _MIN_TENSORFLOW_VERSION = Version("2.16") _MIN_KERAS_MAJOR = 3 _TF_CPU_CONFIG...
3692bfaed5d26cc023ba0c1edab5abf1cd025cc17e8d25ce62757e73a1c488e0
Python
2,926
110
import pytest from pyrosm import get_data @pytest.fixture def helsinki_pbf(): pbf_path = get_data("helsinki_pbf") return pbf_path @pytest.fixture def helsinki_history_pbf(): pbf_path = get_data("helsinki_test_history_pbf") return pbf_path def test_reading_points_of_interest_with_defaults(helsinki_...
6b9865a324591deaf8e0616128481b5fb5203f0e4e634d3c4b32c04785d3452a
Python
2,929
74
"""F11 visual-token gates (collapse memo item 10 / D10, machinery wave). The ONE ``collapse_tokens`` table in ``themes.py`` holds every kind's marks and panel-fixed wording (the naming sprint renames in one place; a compact mode is a table change), the K4/K3 theming bug is fixed (hardcoded grays ignored dark themes), ...
790d4f4f699bfa0ac0412cb66432b37bafc1692fa68c0758b4c5c22ce4360833
Python
2,929
101
#!/usr/bin/env python # coding: utf-8 # In[4]: import pandas as pd from sklearn.model_selection import train_test_split, TimeSeriesSplit from sklearn.linear_model import LinearRegression from sklearn.metrics import mean_squared_error, r2_score, mean_absolute_percentage_error from sklearn import preprocessing import...
86abc2be8c6c2078f2b220fba251ca4ea2b6973135fe54ba2d69faf64379ab22
Python
2,929
94
from __future__ import absolute_import import sys import textwrap from pip._internal.cli.base_command import Command from pip._internal.utils.misc import get_prog BASE_COMPLETION = """ # pip %(shell)s completion start%(script)s# pip %(shell)s completion end """ COMPLETION_SCRIPTS = { 'bash': """ _pip_co...
d5dfacec76fdfb7d12f91ed003923d0b704991adea0029ce3174402109491d03
Python
2,929
81
""" 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...
09c190e38e49b096bd48d9cb6904f1b01a43cb9565c3b9aefa67fa6123369d6c
Python
2,930
72
# !/usr/bin/env python ## created by Yun Hao @MooreLab 2021 ## This script contains data-formatting functions used for DTox model training ## Module import numpy as np import pandas as pd import torch from torch.utils.data.dataset import Dataset from sklearn.model_selection import train_test_split ## This function ...
9307134202511234ca8a82404186320275dea05ada2560669fbe28d2350b4330
Python
2,930
101
#!/usr/bin/env python # coding: utf-8 # In[4]: import pandas as pd from sklearn.model_selection import train_test_split, TimeSeriesSplit from sklearn.linear_model import LinearRegression from sklearn.metrics import mean_squared_error, r2_score, mean_absolute_percentage_error from sklearn import preprocessing import...
125aab243307c5a5e5a5ac38a7d5ceae9e7ae175e297cfd6c4b668768499a53a
Python
2,932
104
# --- 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 Legendgrouptitle(_BaseTraceHierarchyType): _parent_path_str = "quiver" _p...
25b24f62f99476aa37fdc2652a8d722f4e72ad9c82dcd5ff9c41f7e7556c69f5
Python
2,932
90
# Copyright (c) 2021. Lightly AG and its affiliates. # All Rights Reserved from typing import TYPE_CHECKING, Callable, List import numpy as np import torch from PIL import Image as Image from PIL.Image import Image as PILImage from torch import Tensor from lightly.transforms.torchvision_v2_compatibility import torch...
33e7a2238b458cda6857a2cce6e52c0df1db5e7932b749f06a46fa726c05ed78
Python
2,932
104
# --- 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 Legendgrouptitle(_BaseTraceHierarchyType): _parent_path_str = "violin" _p...
35aad2c93afa964594f952ca330f7629e8f900c2d636824a722cd560c50c56cb
Python
2,932
104
# --- 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 Legendgrouptitle(_BaseTraceHierarchyType): _parent_path_str = "mesh3d" _p...
4c913585e2b236737317c1bc4bafd5e953601a6615ba5463bd891a3fc2ac47d9
Python
2,932
74
# Copyright (c) ByteDance, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import math from typing import List import torch import torch.nn as nn from timm.models.layers import trunc_normal_ from...
57eb3a67a174dc7919a86fa201e6f27426d2e2b9cfa28d63d1cd38b73bc6e702
Python
2,932
104
# --- 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 Legendgrouptitle(_BaseTraceHierarchyType): _parent_path_str = "carpet" _p...
5b3c3367b77edd527ef6b60c8e9b86ae3dffec47f17dc78c8ee4a3271fb73dee
Python
2,932
104
# --- 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 Legendgrouptitle(_BaseTraceHierarchyType): _parent_path_str = "funnel" _p...
628778482c923fe7eacf518d2c46722d6c39f78a21bc50ec7db609bce544a038
Python
2,932
87
from typing import ( Annotated, ) from pydantic import ( Field, ) from galaxy.files.models import FilesSourceRuntimeContext from galaxy.util.config_templates import TemplateExpansion from ._fsspec import ( CacheOptionsDictType, FsspecBaseFileSourceConfiguration, FsspecBaseFileSourceTemplateConfigu...
c49b21863ed43e2bcf98a9f8424232dd14143572ae2a96d512af37d179b9cc1e
Python
2,932
93
import pytorch_lightning as pl import torch class SurvivalModelHead(pl.LightningModule): def __init__(self, input_shape): super().__init__() self.mlp_head = self._create_network(input_shape) def _create_network(self, input_shape): raise NotImplementedError def c...
d54d2bd9e8f546a5940c031d9a3eb723fd7548d074e554508eb6031de152d839
Python
2,932
104
# --- 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 Legendgrouptitle(_BaseTraceHierarchyType): _parent_path_str = "volume" _p...
f00b86bd1c9b18956673fd1be600126a99cd9853be40f9a9439dea6095f5d287
Python
2,932
104
# --- 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 Legendgrouptitle(_BaseTraceHierarchyType): _parent_path_str = "icicle" _p...
f4ed6ae7cbf139ba13a79a3e9390791dd8d7d5064ad40388b9394c7c1a5eaf5a
Python
2,932
104
# --- 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 Legendgrouptitle(_BaseTraceHierarchyType): _parent_path_str = "sankey" _p...
f5e4a42731bd8450adf7d91cd83066c1e7851f589354b8f83e4a0eca811aaef1
Python
2,932
99
# This example requires the following dependencies to be installed: # pip install lightly[timm] # Note: The model and training settings do not follow the reference settings # from the paper. The settings are chosen such that the example can easily be # run on a small dataset with a single GPU. import pytorch_lightnin...
21e164bc04b5f8725a6099179654fd8b57d2cc4347dda9955c03befc8108a2c1
Python
2,933
73
"""F06 real-model rows: the DenseNet-121 divergence identity (attrib memo D13). The kit's marketing sentence as a blocking test with no download (weights are cached in this checkout's torch hub): restricted to module-dispatched ReLUs our guided backprop matches the module-hook coverage class (captum parity is pinned s...
a171567be0cad69505278b4ec8da15f75ee59df90600478a9e154ee8d8b33f78
Python
2,933
77
import numpy as np from . import xpu from .xpu import cupy_wrapper, iscupy @cupy_wrapper(['X', 'Y'], dtype='float64') def pdist(X, Y=None, metric='euclidean'): if iscupy(X): import pylibraft.distance.pairwise_distance import cupy as cp if Y is None: Y = X D = pylibraft...