sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
09e900954353df775ddd609b40a9015fd1d98e6fcc3ff5ea0d1f8bf55b3fa5d0 | Python | 36,043 | 948 | """Label-rung current-session anchoring (r83 C1, r82 hon1/free/review HIGHs).
THREE INDEPENDENT r82 LANES broke the SAME class with three different vehicles:
label provenance was validated by TEXT MEMBERSHIP in the active capture's live
event index, with no per-object anchoring. Label text is deterministic per
op-kind... |
c10508c6724a7c3fdb7ba5fe7f14c6ab752db4b588c98ec7d7b6c7f8278a3b45 | Python | 36,049 | 869 | import warnings
from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence
from functools import reduce
from importlib.metadata import version
from typing import Literal
import numpy as np
from anndata import AnnData
from numba import njit, prange
from packaging.version import Version
from pynndescent... |
68eb03c2cb117f224fe787a15ea53f5df6584e279548a48593645c4575973a00 | Python | 36,051 | 886 | """
dap version of modules_all_atom.py
"""
import numpy as np
import paddle
import paddle.nn as nn
import paddle.nn.functional as F
import gc
from copy import deepcopy
from helixfold.model import chain_align_np_aa, lddt, modules
from ppfleetx.distributed.protein_folding import dap
from ppfleetx.models.protein_folding.o... |
8b91f477fc9e3b74537a4a30c19c6ec37ec4c8813474f1f91293056090302e91 | Python | 36,053 | 1,004 | """
This file contains functions to demonstrate core functionality of the pyABF
module. Functions prefaced with "demo_" may be run automatically to generate
a markdown document. In this case their docstrings will be included in the
getting started guide and their code will be added to the
readme along with any image... |
868aa7e6e13f78f614240b0a6b940ee8691046b021669e3f9b5558944a9cfcac | Python | 36,066 | 786 | import pandas
import numpy
import datetime
import powerlaw
import logging
import geopandas
from tqdm import tqdm
from igraph import *
from ..utils import utils
from ..core.trajectorydataframe import TrajDataFrame
'''
Implementation of GeoSim
'''
class GeoSim():
"""GeoSim model.
The GeoSim model of i... |
cb44da140b1a29dbe20bfb82bcd1a762da76d73d0f92dbad5b39a582cb602d1f | Python | 36,083 | 945 | import argparse
import os
from enum import Enum
from autouri import URIBase
from .arg_tool import update_parsers_defaults_with_conf
from .backward_compatibility import PARAM_KEY_NAME_CHANGE
from .caper_workflow_opts import CaperWorkflowOpts
from .cromwell import Cromwell
from .cromwell_backend import (
CALL_CACHI... |
6aa269f66c6916acdcf995a8b262abb0690fdfff3bb96433aef4e1546815090d | Python | 36,136 | 1,090 | import os
import shutil
import gzip
import pysam
import glob
import pytest
import re
from TestUtils import checkBinaryEqual, checkGZBinaryEqual, load_and_convert, make_data_files, TABIX_DATADIR
def setUpModule():
make_data_files(TABIX_DATADIR)
def myzip_open(infile, mode="r"):
'''open compressed file and d... |
6915a5c1001bc8acb8cde1d28e6a3d4990b2ebb3e604a54bb76fe1a2380e7a00 | Python | 36,160 | 1,315 | import os
import os.path as opath
import textwrap
from collections import ChainMap
from importlib import import_module
from io import StringIO
from typing import List
import re
CAVEAT = """
# --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
"... |
a8ea5839d2e842010a91e0561b84e94c3b8575b69938a6e2cfadcfb531dc65a7 | Python | 36,210 | 1,069 | """Tests for functions in the cli.parser module."""
import logging
import os
from copy import deepcopy
from pathlib import Path
import pytest
from niworkflows.utils.testing import generate_bids_skeleton
from xcp_d import config
from xcp_d.cli import parser
from xcp_d.data import load as load_data
from xcp_d.tests.te... |
c42140f7692ba6dc7214ee21b469bac8682349b65489dd093a52fe2d6fcc958c | Python | 36,225 | 711 | #!/usr/bin/python3
##########################################################################
## ##
## Copyright (c) 2019 Philipp Lösel. All rights reserved. ##
## ##
#... |
1a8bf9f93c9bc755ae443cedde2225942822a428eccc9b8c9b8e0c1a5be637a7 | Python | 36,343 | 774 | # Copyright (c) 2025, Jay Shah, Ganesh Bikshandi, Ying Zhang, Vijay Thakkar, Pradeep Ramani, Tri Dao.
# A reimplementation of https://github.com/Dao-AILab/flash-attention/blob/main/hopper/flash_bwd_postprocess_kernel.h
# from Cutlass C++ to Cute-DSL.
import math
import operator
from typing import Callable, NamedTuple, ... |
270352a595881eb65228488612c95d3d4dd25cb9233e198f970bdf84eaabf9fe | Python | 36,349 | 832 | """Tools for dimensionality reduction, adapted from Dynamo: https://github.com/aristoteleo/dynamo-release/
dynamo/tools/dimension_reduction.py"""
import warnings
from copy import deepcopy
from typing import Callable, List, Literal, Optional, Tuple, Union
import anndata
import matplotlib.pyplot as plt
import numpy as n... |
02c5b84a7ce08b91fc7907292fd9a7f59e7632590ef7e609b02e81e7882763a8 | Python | 36,382 | 813 | """
Heterogenous lists/contents are difficult to query properly since unions are
not easily made.
"""
import json
import logging
from typing import (
Any,
)
from sqlalchemy import (
asc,
cast,
desc,
false,
func,
Integer,
literal,
null,
nullsfirst,
nullslast,
select,
... |
10233664854ae8d41e4d571190b9c7766859c3c1ec119035a9d6205a5cead125 | Python | 36,403 | 1,088 | import glob
import logging
import math
import operator
import os
import re
from typing import List, Optional, Tuple
import joblib
import numpy as np
import pandas as pd
import pyteomics.mass.unimod as unimod
import scipy.signal as ssignal
import tqdm
import config
logger = logging.getLogger("suspect_library")
def... |
e80bc7f8ee1c61a5926031f2e7128fee19567218e05ea020fcdbc342aa20b67d | Python | 36,410 | 954 | """Unit tests for source-level analysis."""
from copy import deepcopy
import mne
import nibabel as nib
import numpy as np
import pytest
from mne.minimum_norm import apply_inverse_epochs, read_inverse_operator
from mne_rsa import rdm_nifti, rdm_stcs, rsa_nifti, rsa_stcs, rsa_stcs_rois, squareform
from mne_rsa.source_l... |
10892ab8cded77293707627373388d8ad8d24904b10d2dae864cadfe60101b3c | Python | 36,416 | 647 | #!/usr/bin/env python3
"""Журнал наблюдений: пересчёт статистики по всему накопленному и сборка страницы.
Читает замороженный датасет отчёта (runs/compare.jsonl, 12 seed'ов) плюс всё,
что накопил суточный прогон (runs/daily/compare_ext.jsonl), применяет те же
критерии годности и тот же двойной критерий подтверждения, ... |
5bafcc2b3206eee7a8bb228fe64a09256372bbbfdbd8bffb89e8579253416e13 | Python | 36,416 | 647 | #!/usr/bin/env python3
"""Журнал наблюдений: пересчёт статистики по всему накопленному и сборка страницы.
Читает замороженный датасет отчёта (runs/compare.jsonl, 12 seed'ов) плюс всё,
что накопил суточный прогон (runs/daily/compare_ext.jsonl), применяет те же
критерии годности и тот же двойной критерий подтверждения, ... |
70086760d9cb2e5eb96d36cc840df5aa0c1e03b72eebb61fbaf3e05fe92ea9c1 | Python | 36,478 | 987 | import locale
locale.setlocale( locale.LC_ALL, 'en_US.UTF-8' )
import re
import collections
import dateparser
try:
from local_extractor.states.state_utils import TN_utils
except ImportError:
import sys, os, pathlib
path = pathlib.Path(__file__).absolute().parents[2]
path = os.path.join(path, 'local_e... |
f9f9bc676952d4dcd2c6c8f2be0538a71345454c4e4a2c7635255f89f7c4a8c0 | Python | 36,493 | 1,143 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Plotting tools."""
import itertools
import os
import matplotlib.pyplot as plt
import nibabel as nb
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import gridspec as mgs
fr... |
cb921997678fdd98d821fd610bbae41585135b10594f93f05a4ce5777cfbcd83 | Python | 36,540 | 913 | # Asteroid Impact (c) Media Neuroscience Lab, Rene Weber
# Authored by Nick Winters
#
# Asteroid Impact is licensed under a
# Creative Commons Attribution-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/b... |
3e57a445363d26e1c3dc9531e25666ccb5fc72a213e000930bce8c3cd4c64be7 | Python | 36,551 | 947 | from typing import Callable, Dict, List, Tuple
import datasets
import functools
import os
import random
import string
import numpy as np
import time
import torch
import transformers
import argparse
from transformers import AutoTokenizer, AutoModel, AutoModelForCausalLM
from tqdm import tqdm
from collections import def... |
de51dfd6ed2510400db9a4bb5844cf63287f5e3aa31dc670cbad9339b939fe46 | Python | 36,575 | 700 | #==============================================================================#
# Author: Dominik Müller #
# Copyright: 2024 IT-Infrastructure for Translational Medical Research, #
# University of Augsburg ... |
a650bd21f344089e26ce75ce9e6f47186d90ba8236fe68a4a08edb47edb2116c | Python | 36,577 | 914 | # Asteroid Impact (c) Media Neuroscience Lab, Rene Weber
# Authored by Nick Winters
#
# Asteroid Impact is licensed under a
# Creative Commons Attribution-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/b... |
13892e807e44728e7da55eb4ba0802024c3898a1c5da4ff265186d3288a09e83 | Python | 36,581 | 774 | import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression, LogisticRegression
from scipy import stats
from sklearn.decomposition import PCA
from sklearn import svm
from sklearn.manifold import TSNE
import torch
import numpy as np
import utils_linclab_plot
from tqdm import tqdm
import os
from mat... |
37b46a8cb0e1eb0b5e75ea46b78504162554756f76023ab814eb697819daf9c5 | Python | 36,602 | 1,125 | import gzip
import random
import re
import statistics
import subprocess
from distutils.spawn import find_executable
"""
Run doctests:
python3 -m doctest gplib.py
"""
#######################################################################
def graphprot_predictions_get_median(predictions_file):
"""
Given... |
1b7147110209b4352101f10755c3c21c58db6f9e3fc04242093593c6e0e161b1 | Python | 36,629 | 1,033 | """Module for classification function."""
import functools
import numpy as np
from scipy import stats
from sklearn.base import BaseEstimator, ClassifierMixin, TransformerMixin
from sklearn.svm import SVC as sklearnSVC
from sklearn.utils.extmath import softmax
from sklearn.linear_model import LogisticRegression
from sk... |
fc50054d90df124b975f78df8c9b8aff714ffc622cded01e01b0462ba3454a95 | Python | 36,639 | 1,070 | import warnings
from numbers import Number
import numpy as np
import numpy.core.umath as _umath
import pytest
from numpy import ufunc as _ufunc
import pynapple as nap
ufuncs = {k: obj for k, obj in _umath.__dict__.items() if isinstance(obj, _ufunc)}
tsd = nap.TsdTensor(t=np.arange(100), d=np.random.rand(100, 5, 3),... |
23d0613cb5371779649ff3512ff7e3c4fef7b3756dd19ec0eceeb811c029c9e8 | Python | 36,647 | 898 | import torch as tt
from typeguard import typechecked
from typing import Union, Dict, List, Tuple
@typechecked
def apply_affine(
image: tt.Tensor,
transform_affine: tt.Tensor,
shape_output: Union[tt.Size, List[int]] = None,
type_resampling: str = "bilinear",
type_origin: str = "centre",
type_ou... |
02b5ccd46f455c6fe33969734bb2420b3b2f4768aeaf21e94fff560fc64a85cc | Python | 36,654 | 991 | import copy
import os
import random
from dataclasses import dataclass, field
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import torch
from sklearn.cluster import KMeans
from tqdm import trange
from .visualize import add_scale_bar
#################### Registration ####################
# P... |
61162d9bec1734aab88ad7f92dee6a5c2d4a0e6ae3d9647b181361495cce1e9d | Python | 36,667 | 835 | #!/usr/bin/env python3
"""
File: run_picalo_with_n_expr_pcs.py
Created: 2021/12/02
Last Changed: 2022/03/28
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 th... |
b17c840f0064fdbf42d3ffb2b6ca707784667d68e8845bbc0bfef0ae5a3236b7 | Python | 36,734 | 1,093 | #!/usr/bin/env python
"""Plotting methods.
This module contains various plotting methods. There are two types of
plotting methods: the Primitives and the Composites. The Primitives are
the most basic and offer simple, single-plot representations. The
Composites are composed of several primitives and offer more comple... |
1f476f816464b4250caaf6cc6fdf3f5fc956456a7da61cb7d0a1e03e3e7e5f3b | Python | 36,756 | 1,126 | from __future__ import annotations
import ast
import collections.abc as cabc
import importlib.metadata
import inspect
import os
import platform
import re
import sys
import traceback
import typing as t
from functools import update_wrapper
from operator import itemgetter
from types import ModuleType
import click
from c... |
4a018fdc98b6bc557d67c69fbce1ac04453647d19551c6272cc09cef890ff658 | Python | 36,766 | 807 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
from __future__ import annotations
import torch
import torch.nn.functional as F
from torch import nn
from ultralytics.nn.modules import LayerNorm2d
from .blocks import (
Block,
CXBlock,
Fuser,
MaskDownSampler,
MultiScaleBlock,
... |
fee633776696826643da999cad59f3b7d3a40295a37a543af4968e5146b45706 | Python | 36,770 | 1,660 | # BASE
URL = "https://download.geofabrik.de/"
suffix = "-latest.osm.pbf"
africa_url = "africa/"
asia_url = "asia/"
australia_oceania_url = "australia-oceania/"
central_america_url = "central-america/"
europe_url = "europe/"
north_america_url = "north-america/"
south_america_url = "south-america/"
baden_wuerttemberg_ur... |
971d33a3b8b89f1b7e1815d81aaef4fdd169543c5d0602a1163ed5c7e6854733 | Python | 36,802 | 1,107 | import functools
import itertools
import operator
import numpy as np
import tensorflow as tf
from keras.src import backend
from keras.src.backend.common import is_float_dtype
from keras.src.backend.common import is_int_dtype
from keras.src.backend.common import standardize_dtype
from keras.src.backend.tensorflow.ops.... |
75f72521f0d34e9d47a8e730712f4acd4627c2a0f5aa0c3c0ef6bde31d6edcf2 | Python | 36,807 | 998 | """Adversarial certification for scoped patching and shadow escape detection."""
from __future__ import annotations
import functools
import sys
import threading
import types
import warnings
from collections.abc import Callable, Iterator
from pathlib import Path
from typing import Any
import example_models
import num... |
f3be2aec0825d6f58974d6b017163569f622970760cecde1e0b7ca6d1cf7159e | Python | 36,819 | 771 | #!/usr/bin/env python
import torch
import argparse
import pandas as pd
import random
import time
import numpy as np
import os
import json
import tqdm
import warnings
import copy
from scipy import stats , signal
from captum.attr import NoiseTunnel,DeepLiftShap,GradientShap,Saliency,InputXGradient,IntegratedGradients,Fe... |
755dd105c6e99ce01f6143b3cbac2e6e2e4147f3a552e6298f992b49f33bafe0 | Python | 36,887 | 1,107 | import os
import json
import logging
import hashlib
import pickle
import numpy as np
from collections import defaultdict
from pathlib import Path
from .io.video_io import VideoSortedFolderReader, VideoFrameReader
from .utils.serialization_utils import save_json, load_json, ComplexEncoder, \
save_pickle, load_pickl... |
05f0a3ed79ef007e1e792d09aa7b286238c141165dbf2270c5e0e3439fda7c2f | Python | 36,967 | 983 | import awkward as ak
import numpy as np
import pytest
from seqpro.rag._utils import OFFSET_TYPE, lengths_to_offsets
from seqpro.rag._layout import RaggedLayout, validate_layout
from seqpro.rag._core import Ragged
def test_layout_numeric_basic():
data = np.arange(10, dtype=np.int32)
offsets = lengths_to_offset... |
f0d85c9e257279e2ade34be8154130da4d5e9463972654189bc7fa0fd6634a0b | Python | 37,024 | 748 | """Train Mask RCNN end to end."""
import argparse
import os
# disable autotune
os.environ['MXNET_CUDNN_AUTOTUNE_DEFAULT'] = '0'
os.environ['MXNET_GPU_MEM_POOL_TYPE'] = 'Round'
os.environ['MXNET_GPU_MEM_POOL_ROUND_LINEAR_CUTOFF'] = '28'
os.environ['MXNET_EXEC_BULK_EXEC_MAX_NODE_TRAIN_FWD'] = '999'
os.environ['MXNET_EXE... |
55545cad8b1a119a09e327e78adde750b79301eae2014f55f9daf619cd25311f | Python | 37,034 | 743 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and rel... |
0833bdef0967792701a2b5faaf4c4a900be2209605ffdefec3ad782ccd77ca59 | Python | 37,049 | 948 | import dataclasses
import re
import string
import numpy as np
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.initializers.random_initializer... |
a171916480131e99ff3ae5bc7d3128c6c57bbfed3959e1b558ab2475b815b391 | Python | 37,053 | 793 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
from __future__ import annotations
import csv
import glob
import math
import os
import time
import urllib
from codecs import BOM_UTF8
from dataclasses import dataclass
from functools import partial
from io import BytesIO, TextIOWrapper
from multiproc... |
89a8076d2713cb6bb6beb88c0c64896836f3dd38c8a716a37ce857fb51130c6d | Python | 37,082 | 993 | """Various learning rate schedule functions."""
import math
from keras.src import backend
from keras.src.api_export import keras_export
from keras.src.saving import serialization_lib
@keras_export("keras.optimizers.schedules.LearningRateSchedule")
class LearningRateSchedule:
"""The learning rate schedule base c... |
f5d895a7aca2c4c0711139018fe5c45b44e7d8d2a58dafcb445df52c34209971 | Python | 37,102 | 1,256 | """
Methods for managing spatial metrics (2D x-y arrays)
"""
from __future__ import annotations
import copy
import random
import numpy as np
import pandas as pd
from shapely import geometry, ops
# Avoid SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_ind... |
b2e210ec6f6eadd478553ffe2a8e81b72dd660ed3ce479cd089accd130fcd913 | Python | 37,119 | 913 | import numpy as np
def write_pycv_link(model, n_hid, n_layers, n_at, box_l, rc, fname, normalise=True):
"""Function that writes an input file for the coupling with plumed, based on a model that is passed in the parameters.
This version of the input file will be faster but requires a Cython package "neighborlis... |
ba4d32fbe0b9a8914592e3e0758c35602883ff35d6859e830cf3b3e9e051cd07 | Python | 37,186 | 819 | """
Mux Scan 0 mV calibration version
The purpose of the mux scan is to assess the wells in the array and identify the ones that are viable for sequencing
It does this by collecting data for a short period of time in each well and then using the MinKNOW classifications seen
to determine if a well can be used for seque... |
f206c096df945f7ce8c0db00e16b429efdb94f40331e4a6a2b0187eaedcea055 | Python | 37,229 | 1,006 | import contextlib
import functools
import warnings
import tensorflow as tf
from tensorflow.python.eager import context as tf_context
from keras.src import callbacks as callbacks_module
from keras.src import metrics as metrics_module
from keras.src import optimizers as optimizers_module
from keras.src import tree
from... |
98e9776e28db8f336c5662c494a9adb8c42167e21c707d29f7d543c29c7c451c | Python | 37,262 | 1,157 | """Tests for torch.func transform boundary capture."""
import warnings
from pathlib import Path
from typing import cast
import pytest
import torch
import torch.nn as nn
from _stale_holders import OpaqueCallable
import torchlens as tl
from torchlens import Recording, Trace, _state
from torchlens.backends.torch.wrappe... |
9c43d32a7d5ac3a25949e645b4bf160dfba0e14a234fac5e6ca5ed0923198c9a | Python | 37,268 | 964 | from datetime import datetime, timedelta, timezone
from unittest.mock import Mock, patch
import pytest
from kombu import Exchange, Queue
from celery import signals, uuid
from celery.app.amqp import Queues, utf8dict
from celery.utils.time import to_utc
from t.unit.utils.test_dispatcher import garbage_collect
class t... |
4f19dcc6bc08c0730afa69112e5eed1e0d1d4088a3db73a239c1a08e297a89de | Python | 37,298 | 1,087 | """Phase 10 tests for intervention spec persistence."""
from __future__ import annotations
import importlib
import json
import sys
from pathlib import Path
from types import SimpleNamespace
from typing import Any
import pytest
import torch
from example_models import TinyReluAdd as _ReluModel
from torch import nn
im... |
9f5e6c05460b9c4d1dcd17b96251ca7925189133c8a295d7f4d41ac14bab1e00 | Python | 37,309 | 938 | # -*- coding: utf-8 -*-
# Copyright (C) 2020 [COMET-ML]
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this
# software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify,
#... |
b46a6c8a4b88820cb01c5fd3032794338dc7239dc7e5f13d7006fa9d53558c6b | Python | 37,325 | 961 | """Standing state-hygiene guard for every door that stores or applies an intervention.
Four oracles, applied per entry point, all computed OUTSIDE TorchLens (an
analytic forward or a plain ``register_forward_hook`` ground truth), so a rerun
that is merely self-consistent with the hook plan it ran cannot pass:
1. REPE... |
438ac4f0f4cb787bbb01d6c37c7063e506b59c7e49fb48851a79edb7b377a568 | Python | 37,332 | 1,060 | """
Unit tests for base_scanner module.
This module tests core scanner functionality including DeviceStatus,
BaseDevice, DeviceScanner, and related utility functions.
"""
import json
import socket
import time
import urllib.error
import urllib.request
from threading import RLock
from unittest.mock import MagicMock, Mo... |
6c0ba1738a5e4e961eba9b8b74744f17481302f2414aed5a608f229130f1c201 | Python | 37,378 | 946 | """Tests for backend-neutral loop grouping adapter."""
import cProfile
import itertools as it
import pstats
import random
from collections import Counter, defaultdict
from typing import Any
import example_models
import pytest
import torch
import torchlens.postprocess.loop_grouping_adapter as lga
from torchlens impor... |
5448b961f455e0914ff9fa9331474c9fffdcc3e7507122947caa19496215d6ee | Python | 37,426 | 695 | #!/usr/bin/env python
#
# Perform various types of processing from the spinal cord segmentation (e.g. extract centerline, compute CSA, etc.).
# (extract_centerline) extract the spinal cord centerline from the segmentation. Output file is an image in the same
# space as the segmentation.
#
# Copyright (c) 2014 Polytechn... |
9b521a123f261d2f812bfb7260f29bede8beebdc7e2d3f5621cc8f7e099ddacd | Python | 37,438 | 1,011 | """Task request.
This module defines the :class:`Request` class, that specifies
how tasks are executed.
"""
import logging
import sys
from datetime import datetime
from time import monotonic, time
from weakref import ref
from billiard.common import TERM_SIGNAME, human_status
from billiard.einfo import ExceptionInfo, ... |
7f6578e7eff7f0f272b0b38061539d5a0d0980782a896cacaad680641ca7d9e7 | Python | 37,447 | 775 | """
Functions for SV breakend clustering.
Copyright (C) 2021 Tham Cheng Yong
This file is part of NanoVar.
NanoVar is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your op... |
62e2a4b8bb711404613726db8275ab0846395898de887af31d37ef094c865170 | Python | 37,482 | 860 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 9 11:33:54 2022
@author: yihaoy
"""
#%% loading libraries
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from matplotlib import gridspec
from scipy.spatial import distance
from scipy import signal
import numpy as np
import jsonp... |
70e29e17e3fbcbfbdf659b9c27243b3916e5ee63fef23e86d0879ff3ca308923 | Python | 37,493 | 1,051 | # import scipy
import copy
import multiprocessing
from scipy import signal
from scipy.signal import lfilter_zi
import scipy
import scipy.io
import numpy as np
from scipy.stats.stats import pearsonr
import pdb
import ipdb
import logging
import time
# import copy
# apparently, we can do this:
log=logging.getLogger... |
f557c8e84f3d819ad7ecdcc3028cf8749158fabaea22e04c872216a6f02c5d54 | Python | 37,524 | 819 | import os
from glob import glob
import pandas as pd
from gmso.external.convert_networkx import to_networkx
import torch
import torch.nn.functional as F
import mbuild as mb
import rdkit.Chem as Chem
import parmed as pmd
import networkx as nx
import numpy as np
from torch_geometric.data import InMemoryDataset
from torch_... |
3516e766af298bc3410f70cd517cef8c5defd666597b4066770bc3d86ebb299f | Python | 37,583 | 896 | import numpy as np
import torch
from torch.nn.functional import interpolate
from ovseg.utils.label_utils import remove_small_connected_components_from_batch, reduce_classes, \
remove_small_connected_components
from ovseg.utils.label_utils import remove_connected_components_by_volume_from_batch, \
remove_connect... |
27fd4163e13a034c05f8e3d5c9e5863a97276c88697d1d5afa37c6b357c19a5a | Python | 37,608 | 917 | """Topological graph simplification for pyrosm's directed graph-export edges.
Removes interstitial nodes (degree-2 nodes that only carry geometry) and collapses
each chain of them into a single edge that keeps the full original geometry, matching
the semantics of ``osmnx.simplification.simplify_graph``. Operates on th... |
d6dbe00693b92d203371bb4c48463b2eae0c47be77501abf54a9460521eef69f | Python | 37,631 | 930 | try:
from typing import Literal
except ImportError:
from typing_extensions import Literal
from typing import Optional, Union
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pyvista as pv
import seaborn as sns
from anndata import AnnData
from pyvista import PolyData
from scipy.spa... |
dcca2855b08fc83cdca6837f64b0cae7dd3483ba7c22ae853d6e394309b377d7 | Python | 37,632 | 764 | '''Shared front-end of the LDDMM functions: inputs, kernels, threads, figures and backends.
The public functions in ``_lddmm.py`` turn their arguments into a :class:`Problem` with
:func:`prepare_problem`, run the affine pre-fit and fill in the data-driven settings with
:func:`resolve_defaults` (see ``_prefit.py``), an... |
f95a18b09f7fccc7ca76dd8ae0b8dc7a39bc77f3f8b394b28d15c59bcee6c1b5 | Python | 37,634 | 922 | # 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... |
6d53c5b21088018101cccfbf50f027fa27b345257d0aef1fce77faa6fd7c6e9a | Python | 37,643 | 762 | #!/usr/bin/env python
"""
Generates perfusion stats within various ROIs
"""
import os
import sys
import argparse
import csv
import glob
from fsl.data import atlases
from fsl.data.image import Image
import fsl.wrappers as fsl
import nibabel as nib
import numpy as np
import scipy.stats
from scipy.fftpack import fft, if... |
5b55d9366e02bb0d21cccf5f7533ecfb7084e136454faced9427708051151001 | Python | 37,722 | 976 | import os
import subprocess
import sys
import tempfile
import unittest
from unittest import mock
import pytest
from codecarbon.core.config import normalize_gpu_ids
from codecarbon.core.cpu import (
DEFAULT_POWER_PER_CORE,
TDP,
IntelPowerGadget,
IntelRAPL,
_check_energy_file,
_get_candidate_bas... |
0e847b0c21639a45f3ac872548c6202d4a21ed7808f2ab9b51995611407b1729 | Python | 37,768 | 950 | # --- 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 Marker(_BaseTraceHierarchyType):
_parent_path_str = "scattergeo"
_path_st... |
9b1c63cd53777572189a562ebe78cea7e8b12ae905fedf71c642149f169fd3bd | Python | 37,821 | 1,090 | """
Mothur Metagenomics Datatypes
"""
import logging
import re
from galaxy.datatypes.data import Text
from galaxy.datatypes.metadata import MetadataElement
from galaxy.datatypes.protocols import (
DatasetProtocol,
HasMetadata,
)
from galaxy.datatypes.sniff import (
build_sniff_from_prefix,
FilePrefix,... |
11d054452051904c6bfeceb2d483cf58dbea39ac2746f0ad304842e6c92db74d | Python | 37,832 | 989 | """Post-bump round-trip ACCEPTANCE pass over every formerly S3-gated family.
The tlspec v8 coordinated bump activated every feature-sprint persistence
family together; this module is the bump's regression net. For EVERY family
the sprint gated (the ACCEPTANCE_COVERAGE ledger below, cross-checked against
the owners' li... |
34fc13767a2ebfa8d7bd6e17af50b628a7b9466a11a8ed45e5b90be0d27937c5 | Python | 37,834 | 957 | #!/usr/bin/env python
# =============================================================================
# MODULE DOCSTRING
# =============================================================================
"""
Test classes and functions in the ``tfep.app.mixedmaf`` module.
"""
# ========================================... |
4813157f4f24ca51bc3e7387f206f2b954953e8d0f972143e9d6478fd5f1271e | Python | 37,850 | 972 | """GC and memory leak tests for TorchLens.
Verifies that Trace, Op, Param, and model parameters
are garbage-collectible after use / cleanup.
These are marked ``smoke``: a lifetime regression is invisible to call-count,
``tracemalloc``, and wall-clock gates, so this file is the only per-step gate
that can see one. It ... |
1d3fb6f3783b055abebe17f97de3c17c1412bf7ba65bcc9ecfe0e97edc43b1e5 | Python | 37,859 | 909 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
c2fa1a7ad1b17db21f6223c8135e306e8a7dd3c6298d30f22b4f8fa1a0be2fca | Python | 37,897 | 593 | # FUNCTIONS
import os
import pandas as pd
import numpy as np
import ssm
import copy
from sklearn.model_selection import train_test_split
import h5py
from commonFunctions import *
def preprocessData(dataPath, matFile, videonameh5file, binSize_in, minFillLen, RD_hmm_exog, RD_hmm_Cent_exog, Scalers, arHMM_Model,dataType... |
9cb4aea324286c3c1a0bdbf516331e48864937105362a84e464bac4d522210b6 | Python | 37,919 | 1,008 | """Running budget for retained activation bytes, with a typed refusal.
``tl.trace(model, x)`` retains every operation's output by default. That is the
right default for the models TorchLens was designed around and a footgun at
frontier shapes: a first-time user pointing the default at a large model gets an
OOM kill (o... |
41fef750e438a2cee63fbb32ee4747623fd0a1cdf666bf9e4090d80254847672 | Python | 37,923 | 740 | """Tensor Component Analysis (TCA) wrapper around :mod:`tensorly`.
Provides the ``TCA`` class for decomposing multi-way arrays (time x points x
frequency x ...) produced upstream by the spectral pipeline. Handles dict-of-
arrays ingestion, axis concatenation, complex-to-real unfolding, normalization,
and the actual de... |
5b1c55c1690439a9a02302485eacfa3a207dfdd7ef3cc4dada2529d7226e7e7b | Python | 37,925 | 1,072 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 30 14:02:04 2017
@author: michael
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import numpy as np
import tensorflow as tf
import pdb
from dcCustom.models.tensorgraph import activ... |
7b15cd980abbd578a8be91661c2399b2cbdea0207f1e61b0fb74cfac659bed77 | Python | 37,933 | 845 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
from __future__ import annotations
import contextlib
import math
import re
import time
import cv2
import numpy as np
import torch
import torch.nn.functional as F
from ultralytics.utils import NOT_MACOS14, TORCH_VERSION
from ultralytics.utils.checks... |
54540de13e91cb30cff946575647867e2918670e20d71ace3fcd42ae858b465a | Python | 37,938 | 713 | """
This module contains the time integration governor abstraction,
which combines time steppers, nonlinear solvers, and step controllers into a generic integration loop
that supports arbitrary in situ processing, logging, termination of the integration loop, and more.
For instance, evaluation of the linear operator (J... |
de1ad5933c9f594893200dc8dfcb83d2120f3c4d6fd5c9e28276794f89000644 | Python | 37,947 | 737 | class Candidate:
"""Candidate class for structural variant candidates. Candidates reflect the final SV types and can be merged from signatures of several reads.
"""
def __init__(self, source_contig, source_start, source_end, members, score, std_span, std_pos, support_fraction = ".", genotype = "./.", ref_re... |
8591bb7aea4b77c10116e3c58ab402d43362304be9141680b725b8b12f241866 | Python | 38,020 | 1,192 | import math
import os
import numpy as np
import pytest
from absl.testing import parameterized
from numpy.lib.stride_tricks import as_strided
from keras.src import backend
from keras.src import constraints
from keras.src import layers
from keras.src import models
from keras.src import ops
from keras.src import saving
... |
7438678392a8b0c79162bce89d2ac83b83182a9098b0db19f6b6352384cd8f5a | Python | 38,115 | 1,058 | # Have validation be the test set (rename)
# test,train,val isn't same as kfolds
# Rename SingleModel, MultiModel
# scaler is from MuliModel pre kfold
# Have option for singlemodel scaler if none provided
# indiviual prediction in single
# predicts in multi (return df with aggregate)
# Save to individual folders, ensu... |
993fb194db5751b87d4c16bb4b5ff5a2aee3643e335bfb03926f073a6f7e46da | Python | 38,142 | 1,032 | # -*- coding: utf-8 -*-
"""Benchmark Results
Updated: 27.03.2023 (42a6a924b1b6d5b6cc89a6b2a0a0942cc4af93ab)
------------------------------------------------------------------------------------------
| Model | Batch Size | Epochs | KNN Test Accuracy | Time | Peak GPU Usage |
----------------------------... |
c398fa57020132abbc62528913c49a5106e4e4d3a19390ab5b1de184b93ae9b0 | Python | 38,145 | 979 | """Exhaustive (source x mechanism x use) escape-witness fail-closed matrix.
This is the anti-whack-a-mole guard for the unified runnable escape witness. It
enumerates the whole matrix of tensor->host escapes and asserts the honesty tripwire
for EVERY cell:
* SOURCE class -- model INPUT, INTERNAL op output, BOUND para... |
8a4093fe098a2c0935efb621f5861254e14b3aa64229d75833c38a6b34a75116 | Python | 38,146 | 513 | import os
import pandas as pd
import numpy as np
import sys
#sys.path.insert(0, "/Users/anke/cluster_home/pymeg")
sys.path.insert(0, "/mnt/homes/home024/abraun/pymeg")
sys.path.insert(0, "/Users/anke/cluster_home/anaconda/envs/py36/bin/mne")
import pymeg
from pymeg.contrast_tfr_baseline_per_session_subsample_test impor... |
2b08e6838a073d64a064816a10b49e0410b7e342d537a619601176695c66aa04 | Python | 38,160 | 979 | """
This script was adapted from Niklas Wilming et al. Nature Communications 2020
https://github.com/DonnerLab/2020_Large-scale-Dynamics-of-Perceptual-Decision-Information-across-Human-Cortex
"""
import os
import pandas as pd
from glob import glob
import numpy as np
from joblib import Parallel, delayed
from joblib impo... |
50cfdbdf480ab13b82d75565dbb5bf673ed126a59a4a085328e6d2a490246986 | Python | 38,201 | 883 | import torch.nn as nn
import torch as ch
from .custom_modules import FakeReLUM, FakeReLU
from .layers import conv2d_same, pool2d_same
import sys
from . import spectemp
import numpy as np
import matplotlib.pyplot as plt
import scipy.signal as signal
__all__ = ['spectemp_filts_time_average_coch1']
class SincWithKaiserW... |
0cf5a04414929feaeddb4931c8e820279834c2d44dac77aeef98900db25def91 | Python | 38,259 | 725 |
# this is a parameter defition import shared across all the alignment top level scripts.
# the parameters are defined per experiment (different for different experiment alignments).
# NOTE: defaults for any parameters that are set by argparse (command line) are defined in the
# individual scripts and not here.
# xxx... |
f00418255cb386ee590c9e0b38d667eac5f4ee3dae420d7c1ccfed42e98efb6d | Python | 38,282 | 947 | """
Tests for scheduler timing logic and stimulator scheduling behavior.
These tests are designed to prevent double scheduling issues and ensure
correct timing behavior for both single and multi-stimulator configurations.
"""
import os
import time
import unittest
from datetime import datetime, timedelta
from unittest.... |
0347d4189804e5007fe82a43f09e82a7b8fa359c03c58f24ea934b86f461543b | Python | 38,294 | 994 | from datetime import datetime, timezone
from unittest.mock import Mock, call, patch, sentinel
import pytest
from billiard.einfo import ExceptionInfo
from kombu.utils.encoding import bytes_to_str
from celery import states, uuid
try:
from elasticsearch import exceptions
except ImportError:
exceptions = None
t... |
0c1e1dac313e122657a016ecee96af14ecaa5331ad9e5432c8c797618c0d872f | Python | 38,294 | 974 | # --- 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 Marker(_BaseTraceHierarchyType):
_parent_path_str = "scatter"
_path_str =... |
b2c65b5ce82a4ce63249cecf9ce419844079f80cb45101fc05b2b914add94e31 | Python | 38,297 | 943 | # Copyright 2022 Deepfold Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... |
6fab97d068ed6639e491a6e2aa27e2fd7fc41921b17ce9162cbc707f3a5f1a5f | Python | 38,305 | 897 | #!/usr/bin/env python3
"""
File: bryois_pic_replication.py
Created: 2022/10/18
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.... |
480dacca201dcafd35d2f0f91f72a86f7725a37bb63cd791a396995c4338cf66 | Python | 38,325 | 902 | """Tigramite causal discovery for time series."""
# Authors: Martin Rabel, Jakob Runge <jakob@jakob-runge.com>
#
# License: GNU General Public License v3.0
import pytest
import numpy as np
from tigramite import data_processing as pp
from tigramite.toymodels import structural_causal_processes as toys
import tigramite.... |
c19a1e26d2200b1857d095195a679fd6049e7a6368bbcae6f48f34069e5dfc66 | Python | 38,344 | 1,157 | """
Basic plotting classes
"""
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Dict, Iterable, Optional, Sequence, Tuple
if TYPE_CHECKING: # type-only imports to avoid heavy runtime deps
from matplotlib.axes import Axes
from matplotlib.figure import Figure
import itertools
import o... |
ec349586cf0c8bbde10a7c267692827fca51a2fb0f846942d9ab699033a24408 | Python | 38,367 | 663 | from __future__ import division
from __future__ import print_function
from abc import ABCMeta, abstractmethod
# abstract class python 2 & 3 compatible
ABC = ABCMeta('ABC', (object,), {})
import tensorflow as tf
import numpy as np
import sys
from time import time
from os import makedirs, path
from inspect import isg... |
3cb19b3f35efc8f8bf819d0c2e0f69717125f914c33962b60a09c516ae093a16 | Python | 38,388 | 974 | # --- 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 Marker(_BaseTraceHierarchyType):
_parent_path_str = "scatterpolar"
_path_... |
8be7a2cafba9261e3d972a548db9652d20b5c78a800ba4bc873dc4ea970d4d8a | Python | 38,388 | 974 | # --- 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 Marker(_BaseTraceHierarchyType):
_parent_path_str = "scattersmith"
_path_... |
4d563c86b917edcda94159a81c883b6b00ddf18f58bb540d6ef7410edfb0b386 | Python | 38,406 | 974 | # --- 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 Marker(_BaseTraceHierarchyType):
_parent_path_str = "scattercarpet"
_path... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.