sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
732896d09935d7773c846795e64c9626774466cf879dea023338f40cefa211ae | Python | 23,995 | 594 | """Test of data set functionalities"""
import pathlib
import shutil
import tempfile
import nanite.model as nmodel
import numpy as np
import pytest
from PyQt6 import QtCore, QtWidgets
import pyjibe.head
from helpers import MockModelModule, make_directory_with_data
data_path = pathlib.Path(__file__).parent / "data"
... |
e079eb62df9309f78cacccc2776096758ca4d0c81dab44e29f46d779f8143602 | Python | 24,010 | 564 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: protocol_ui.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.pro... |
5d11cf52c95345b829a05041fe1bdb053fcd468da10d7f115f5ebc072402285f | Python | 24,021 | 469 | __author__ = 'cenwan'
#-----The Python (Scikit-learn version 0.22.2) implementation of a predictions integration approach.
#-----Please download data via http://bioinfadmin.cs.ucl.ac.uk/downloads/FFPredGAN/TestingData/Integration/.
import numpy as np
import collections
import pickle
import joblib
import os
from sklea... |
5f2cc87683e93863ac695500774d52cedfff0f174a0362ec88dfa9d7e35fc968 | Python | 24,027 | 624 | import os
import tempfile
from collections.abc import Iterator
from contextlib import contextmanager
from typing import (
TYPE_CHECKING,
)
from galaxy.exceptions import (
AuthenticationFailed,
ObjectNotFound,
)
from galaxy.files.models import (
AnyRemoteEntry,
BaseFileSourceConfiguration,
BaseF... |
253360394c5d6b983cf2133dca9041193a4ef3ded77d2e793ee25c64651ba64e | Python | 24,032 | 599 | # 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... |
ac5ac7a163237dcfd9b91264b8c0e942f2734480ed839beb20a37ad25a604091 | Python | 24,035 | 730 | import logging
import os
import random
import uuid
from collections import Counter, defaultdict
from shutil import rmtree
from typing import Dict, List, Optional, Tuple
import pandas as pd
import pkg_resources
import yaml
from jinja2 import BaseLoader, Environment, meta
# Truncation of jinja template variables
# 171... |
cbe4deb4d20eefece2ea77c608558e1aa98b032e622b2d3f5d262f12c26fed1c | Python | 24,050 | 689 | import warnings
from array_api_compat import array_namespace as get_namespace
import numpy as np
import pytest
from scipy.linalg import block_diag
from scipy.signal import welch, csd, coherence as coherence_sp
from conftest import approx, assert_array_almost_equal, to_backend, to_numpy
from pyriemann.geometry.covaria... |
47c96d97299bfa73c147692929bdb3e0df1c18167c97155283c0c1bd3750eafa | Python | 24,059 | 630 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import division
from __future__ import print_function
import numpy as np
import torch
import torch.nn as nn
from torch.nn import Parameter
import torch.nn.functional as F
from layers import *
from uti... |
63d4dc8df1958dec7eda09da740ad543007368c1b9c4175d7a79788db6898c49 | Python | 24,077 | 522 | #!/usr/bin/python3
##########################################################################
## ##
## Copyright (c) 2019-2024 Philipp Lösel. All rights reserved. ##
## ##
#... |
2795d353885e89d691c449f493f332ec2477471523c1a2d5a8429bd456d8daa6 | Python | 24,095 | 465 | # -*- coding: utf-8 -*-
"""
Created on Tue Jun 21 20:44:27 2022
the method of mscnn model, including TGAN model results extraction, data reconstruction, and so on.
@author: 8
"""
# Packages
import os
import torch
import copy
import utils
import json
import warnings
import numpy as np
import tgan_utils
import copy
impor... |
f1779569354404931111b5a108f6bda2560f72a87d1d31ddf0121af31175a3f4 | Python | 24,096 | 607 | import json
import os
import re
import shutil
import sys
from json import JSONDecodeError
from bokeh import embed
from tqdm import tqdm
from angorapy.models import MODELS_AVAILABLE
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from angorapy.utilities.monitor.statistical_plots im... |
516318ef2f52821eed457f0c9765623bf4d6646b58727237425fc0463b8f8860 | Python | 24,097 | 573 | from ovseg.model.SegmentationModel import SegmentationModel
from ovseg.model.SegmentationEnsemble import SegmentationEnsemble
from ovseg.utils.io import load_pkl
from os import environ, listdir, makedirs
from os.path import join, exists
from time import sleep
import numpy as np
import sys
import time
import copy
class... |
b1bc623888568a1ff6b13dff599939a1c5f33bd006c17da351ca72b8cb81fdb0 | Python | 24,166 | 609 | from typing import Any, Dict, List, Iterable, Optional, Tuple, Union
import abc
import argparse
import collections
import dataclasses
import functools
import heapq
import random
import pandas as pd
import transformers
import torch
from torch.utils.data import DataLoader
from torch import nn
import tqdm
device = tor... |
912b1b0b17e1d24cf383842c4fd04561356663ab5f185191a222dbab7cdf3e21 | Python | 24,182 | 608 | """Control, shape, and host-escape witness checks."""
from __future__ import annotations
import dataclasses
from collections.abc import Mapping, Sequence
from typing import TYPE_CHECKING, Any
import torch
from ._runnable_state import (
runnable_tensor_byte_digest,
)
from .ir.container import (
ContainerSpec... |
bb9fab04ca4e9872a729648a77310e85f2b459b730fbcccc46f7d6ed523b3841 | Python | 24,187 | 457 | import os
# os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
# os.environ["CUDA_VISIBLE_DEVICES"] = "0" # specify which GPU(s) to be used
import time
import numpy as np
import json
import argparse
import torch
import torch.optim as optim
from torch.utils.data import DataLoader
from torch.nn.parallel import DataParalle... |
c4c6dd012008663261689678538858739bfe964e781f45797883a04132126f1b | Python | 24,192 | 502 | import logging
import mne
import numpy as np
import os
import glob
#from conf_meg import conf_analysis
import sys
sys.path.insert(0, '/mnt/homes/home024/abraun/pymeg')
sys.path.insert(0, "/mnt/homes/home024/abraun/conf_meg")
import conf_analysis
from pymeg import source_reconstruction as sr
from pymeg import lcmv as py... |
f22a1f20a1ca9e9a48b40118b657278504f75ab243cb1aa67a90070eb2993287 | Python | 24,197 | 561 | """
.. _tut-statistics:
Tutorial part 3: statistical analysis of group-level RSA results
----------------------------------------------------------------
In this tutorial, we'll dive into cluster-based permutation testing for group-level
statistical analysis.
The statistical test is described in `Maris & Oostenveld,... |
751ed98d7df74f01797a585e5e588a521ee5e431509904ee672c6c09e92b038b | Python | 24,209 | 667 | """Round-22 arg-position hardening gates.
Guards the class fixed in round 22: under-specified ``FUNC_ARG_SPECS`` entries
dropping real tensor parents (F1 ``lu_solve``, F2 ``cosine_similarity``, F4
``ctc_loss``, F5 ``searchsorted``), Tier-2 dynamic-cache poisoning making capture
depend on trace order (F3), and the comp... |
49696b5006d9080b3122f885fb80dfdc44e1d47a19218911b3677ec0b4c7feb4 | Python | 24,226 | 632 | """
noise_model.py — Per-chamber adaptive spectral noise floor.
Overview
--------
This module learns what silence sounds like in a specific sound-isolation
chamber and uses that knowledge to replace the fixed RMS threshold in the
detection gate.
Two-phase design
----------------
Calibration (lights-off window, ~30–60... |
c5d7be0cdec7535c80193c9cc98bb2e677470822ebc1cb9736f8f44c3906df44 | Python | 24,237 | 773 |
#-- setup-begin
import rpy2.robjects as robjects
from rpy2.robjects import Formula, Environment
from rpy2.robjects.vectors import IntVector, FloatVector
from rpy2.robjects.lib import grid
from rpy2.robjects.packages import importr, data
from rpy2.rinterface_lib.embedded import RRuntimeError
import warnings
# The R 'p... |
8d575a95e714f65357a4e541342e10ccba6d5cd4c1e36f943bc1a677205973a8 | Python | 24,257 | 604 | import numpy as np
from numpy.random import default_rng
import scipy
import matplotlib.pyplot as plt
from tqdm.notebook import tqdm_notebook as tqdm
import pandas as pd
import pathlib
from collections import defaultdict
import seaborn as sns
from functools import partial, reduce
import ruamel.yaml
yaml = ruamel.yaml.YA... |
46130794ee9ee1172aff5f5d24fd0f2368370f00b4971cd35b30995f502e15f1 | Python | 24,262 | 637 | # --- 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 = "bar"
_path_str = "ba... |
ae95990936efac76a3f66ede1151f7bd98fa61c81a61f3d009234ed2bc14df27 | Python | 24,265 | 664 | """Tigramite causal discovery for time series."""
# Author: Jakob Runge <jakob@jakob-runge.com>
#
# License: GNU General Public License v3.0
from __future__ import print_function
import json, warnings, os, pathlib
import numpy as np
import dcor
from sklearn import gaussian_process
from .independence_tests_base import... |
c32e091958c122f5d205b19853ddcb26603be174c2b9c057ce567d831380d5df | Python | 24,275 | 551 | from typing import Type, Optional
from dataclasses import dataclass
import operator
import cutlass
import cutlass.cute as cute
import cutlass.pipeline as pipeline
from cutlass.cute.nvgpu import cpasync
from cutlass import Int32, Uint32, const_expr, Boolean
from cutlass.cute import FastDivmodDivisorV2
from flash_attn.... |
95449a160e6d0556efd44964bdd313a66c2d43d886e32324e8ba05399aec5347 | Python | 24,281 | 504 | from typing import List, Optional, Tuple
import numpy as np
import pandas as pd
from anndata import AnnData
from scipy import sparse
from scipy.sparse import issparse
from scipy.stats import gmean, pearsonr
try:
from typing import Literal
except ImportError:
from typing_extensions import Literal
from ..confi... |
e364be3738ab76f345dbbe9a7e901438c6378de86bf3e19f00406d0cca1be52c | Python | 24,281 | 601 | # -*- 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,
#... |
8ea6d973c51b7dacea1bd02f27606f8d05ad3aac48cc669529d0a6a1544dce7a | Python | 24,285 | 674 | """
Unit tests for larvaworld.lib.util.xy module.
Tests pure math/numpy functions that don't require datasets or simulation.
Focus: distance calculations, angle unwrapping, averaging, geometric utilities.
"""
import numpy as np
import pandas as pd
import pytest
from larvaworld.lib.util.xy import (
unwrap_deg,
... |
1b297ad9d57d06c1d335f874e81aca43782c38fb94b4d04c85907e376131b4db | Python | 24,287 | 654 | # --- 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 = "treemap"
_path_str =... |
920248932fc86e4b78cd88f702536dad99d9feafb8187215556ceb0d4db13680 | Python | 24,288 | 656 | # --- 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 Link(_BaseTraceHierarchyType):
_parent_path_str = "sankey"
_path_str = "s... |
410ee8a5e8644ffb573b09c3a14871138e7911935bed4796af5a7ac4afd6648d | Python | 24,301 | 495 | """Single-shot Multi-box Detector."""
from __future__ import absolute_import
import os
import warnings
import mxnet as mx
from mxnet import autograd
from mxnet.gluon import nn
from mxnet.gluon import HybridBlock
from gluoncv.nn.feature import FeatureExpander
from gluoncv.nn.predictor import ConvPredictor
from gluonc... |
5833a97b009e8a3ae4acd9d212b2660152d497ef6ec7c6a672172c864bd38ecf | Python | 24,335 | 640 |
### Calculate precision and recall and plot PRC curve of homozygous SVs for each tool
from sklearn.metrics import average_precision_score
from sklearn.metrics import precision_recall_curve
from sklearn.metrics import auc
import matplotlib.pyplot as plt
import matplotlib.lines as mlines
import matplotlib
impo... |
aab8b1c378d381779f3d8d6251d8379c23ddb546acb0bdc60313717bc0d1a16a | Python | 24,344 | 591 | """P4 completeness fixture: the live mutator sites against the closed registry.
Originally captured against the LIVE legacy ``replace_op_event`` sites BEFORE
any wiring or migration (DoR 4.2, review C7 / review 2 — that pre-migration form is
preserved at commit d4b1738d); re-targeted in P4c onto the amendment lane's
s... |
9242a2041355b96765915af067431c6f1f0207fc528308b571f40680d3bdd5c7 | Python | 24,366 | 678 | #!/usr/bin/env python3
"""
NEURON 3D RxD Ca diffusion + iso-volume geodesic binning
Last updated: 18.9.2026
Author: Laura Keto
### Description
This script performs three-dimensional calcium diffusion simulations in
realistic morphologies imported from SWC files using the NEURON RxD
framework. The morphology is vo... |
a118d8846943d62c6d07b70fb731612120a6a487d35d7af7ab3de2fa87d3bda8 | Python | 24,370 | 638 | # --- 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 = "histogram"
_path_str... |
c682b3018d87841931bb8e8cb48ccf09840e565392583d8a6b959281def9ce80 | Python | 24,376 | 418 | #!/usr/bin/env python3
"""Журнал протокола B2 (ЧЕРНОВИК 13 октября 2026, прогонов не было): статистика
по PREREGISTRATION_B2_черновик.md §4-§5, §8-§9 и страница docs/b2.html.
Читает runs/b2/protocol_b2.jsonl (раннер runs/daily_b2.py), пишет docs/b2.json и
docs/b2.html. Правило страницы то же, что у A2: чисел нет, пока... |
a5cf7eb28159a106a60194f2e1564b8286c7541425feccce61122ffc92de5ebe | Python | 24,377 | 627 | """State-binder metadata/layout completeness (r63 C1) -- whole-class immunizers.
Round-62/63 (both labs, Option-A decision) proved two false-VERIFIED families on the
sparse runnable-``.tlspec`` state surface:
* **Captured physical form, READ then lost in transport**: a captured param/buffer with a
non-canonical PHY... |
1572be25c20c7acceefebe843caa2b350ba5dc7049a8d0d88cf1b262328504f7 | Python | 24,379 | 418 | #!/usr/bin/env python3
"""Журнал протокола B2 (ЧЕРНОВИК 13 октября 2026, прогонов не было): статистика
по PREREGISTRATION_B2_черновик.md §4-§5, §8-§9 и страница docs/b2.html.
Читает runs/b2/protocol_b2.jsonl (раннер runs/daily_b2.py), пишет docs/b2.json и
docs/b2.html. Правило страницы то же, что у A2: чисел нет, пока... |
dc44f02f9f0fb66adffedda199c8c29677904885932fa1f0be5543adcaf01997 | Python | 24,387 | 632 | from unittest import mock
import jax
import numpy as np
import pytest
import tensorflow as tf
import torch
from keras.src import Sequential
from keras.src import backend
from keras.src import layers
from keras.src import models
from keras.src import testing
from keras.src.distribution import distribution_lib
from ker... |
dbcd5e911e4964020fd7771ad3b58ed28e87f1f3db5fec1a013f0c3949f8e06e | Python | 24,398 | 730 | import warnings
import itk
import numpy as np
import os
import pytest
from mirp.extract_features_and_images import extract_images
from mirp.settings.generic import SettingsClass
from mirp.settings.transformation_parameters import ImageTransformationSettingsClass
from mirp.settings.feature_parameters import FeatureExtr... |
0e3c18b07acdb6c1940b28f14daf1cb34444eaa6f9056c521c3916188d33453d | Python | 24,402 | 625 | """Label/activation-rung STORAGE integrity (r85, r84 review SOL-1 HIGH).
The state-provenance trust decision is a ``{rung} x {axis}`` matrix. Each rung
(param, buffer ``address``, label / ``buffer_source``) trusts a receiver as
internal model state -- exempting it from the input-taint / layout nets -- only
when TWO in... |
2b953dd37c86504d5e30af3a69fbcf73ede08ce61755de41d8c05bca2919d7c6 | Python | 24,413 | 497 | """
gate.py — Fast signal-processing gate for birdsong detection.
Two-stage architecture
----------------------
Stage 1 — Noise-model gate (when a NoiseModel is available)
Compare the chunk's per-bin spectrum against the learned per-chamber
noise floor. Falls back to fixed RMS floor if no model is loaded.
St... |
93ca3b4a892bf0dedd97063646e4a5f2478a076888d8e2bf1517ab01cd1d3436 | Python | 24,420 | 714 | """Functions for parsing various file formats."""
import collections
import dataclasses
import itertools
import re
import string
from typing import Dict, Iterable, List, Optional, Sequence, Tuple, Set
# Internal import (7716).
DeletionMatrix = Sequence[Sequence[int]]
@dataclasses.dataclass(frozen=True)
class Msa:
... |
0b3aabcbb2aef71dcc36e2e1b0b3d6d2264ad88d32b5b3a87cda4d937a3fae2d | Python | 24,428 | 583 | import math
import time
import ipdb
import torch
import numpy as np
from pandas import read_csv
import os
from torch.utils.data import DataLoader, Dataset
from tqdm import tqdm
import torch.utils.data as dat
import matplotlib.pyplot as plt
from ourmodel import TransferLoss
def file_name(file_dir):
for root, dir... |
8b67a39278616cf5474ec10acebfdd25da10c2f02a05cc87759f3a24433a58ef | Python | 24,428 | 540 | """Round-45 secC_1 immunizer -- torch-symbol decode routes through the single ``torch_attr`` helper.
r42/r43 secC_1 replaced ``getattr(torch, name)`` with ``torch.__dict__.get(name)`` at three decode
sites to kill the PEP-562 lazy ``torch.__getattr__`` side effects (unrequested submodule import
``onnx`` / ``_dynamo`` ... |
4d0fbf5162816f55f6652d39c4a130d07519ea12cd972ff79a072ae0bc968e9b | Python | 24,435 | 513 | # --------------------------------------------------------
# Based on BEiT, timm, DINO and DeiT code bases
# https://github.com/microsoft/unilm/tree/master/beit
# https://github.com/rwightman/pytorch-image-models/tree/master/timm
# https://github.com/facebookresearch/deit
# https://github.com/facebookresearch/dino
# --... |
f25eb1c049eea7084ff321b9a3b64b7f18c3d42fee7ca3909bc573bb98ceea23 | Python | 24,453 | 799 | """Helper functions for cci_plot.py."""
import matplotlib
import matplotlib.cm as cm
import matplotlib.colors as plt_colors
import matplotlib.patches as patches
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from anndata import AnnData
from matplotlib.axes import Axes
from matplotlib.patches im... |
f122b0e5794e403eacba4dce2ec3906eda36ef5f9ab0b6fb8674f8b3814058d2 | Python | 24,454 | 623 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import math
from functools import partial
import slowfast.utils.logging as logging
import slowfast.utils.misc as misc
import torch
import torch.nn as nn
import torch.nn.functional as F
from slowfast.models import head_helpe... |
8f45a71e435d1ee1e11c3d9070882b835d6e82f297eb42705fd7002371efdb2f | Python | 24,457 | 629 | #!/usr/bin/env python
# =============================================================================
# MODULE DOCSTRING
# =============================================================================
"""
Moebius transformation for autoregressive normalizing flows.
"""
# ===========================================... |
6ab5023dfcb10dc4cb6853b860d99eb6f55e688c08432ed729631c8de84c5dda | Python | 24,471 | 618 | """
Manager and Serializer for Library Folders.
"""
import logging
from dataclasses import dataclass
from typing import (
TYPE_CHECKING,
)
from sqlalchemy import (
and_,
exists,
false,
func,
not_,
or_,
select,
)
from sqlalchemy.exc import (
MultipleResultsFound,
NoResultFound,
... |
8923c38f88ccb2d299f78d994d2ac759eda3578bdf1ff496b88ac9426939b1d6 | Python | 24,477 | 713 | """
Functions to decode n-dimensional features.
"""
import inspect
import warnings
from functools import wraps
import numpy as np
from .. import core as nap
def _format_decoding_inputs(func):
@wraps(func)
def wrapper(*args, **kwargs):
import xarray as xr
# Validate each positional argument... |
b3295601ec014b443c576d22639c0fc4bbb176dd82184c026a92c2420b328f32 | Python | 24,499 | 522 | import unittest
import sys
sys.path.append('../')
import chcochleagram
from chcochleagram import *
import numpy as np
import torch as ch
import faulthandler
faulthandler.enable()
class CompressionTestCase(unittest.TestCase):
def __init__(self, *args, **kwargs):
unittest.TestCase.__init__(self,*args,**kwarg... |
ed61dd3ed4c311c9a2d0f872ed54e756314baa1feb8e24d5373d3136c92e8198 | Python | 24,507 | 519 | import numpy as np
import os
import sys
import time
import tensorflow as tf
import tensorflow.keras
from tensorflow.keras.models import Sequential
import random
import pandas as pd
#import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import matplotlib
matplotlib.use('Agg') # Must be before importing mat... |
f45a6f247db35aac45b49740c8ad1364374c4918488d6c11f55f48a54811b64c | Python | 24,509 | 683 |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... |
4e2b647be02a93f655ddd058105c5ed8e9ffe3daef398ef3dd21e3a3817623fb | Python | 24,511 | 679 | from __future__ import annotations
import importlib.util
import os
import sys
import typing as t
from datetime import datetime
from functools import cache
from functools import update_wrapper
from types import TracebackType
import werkzeug.utils
from werkzeug.exceptions import abort as _wz_abort
from werkzeug.utils i... |
c4bb3a8f069d3c5c829ae5112e501ccf4300efc554c8a3807ea6e39c002fb5f5 | Python | 24,514 | 689 | # -*- coding: utf-8 -*-
# oiffile.py
# Copyright (c) 2012-2015, Christoph Gohlke
# Copyright (c) 2012-2015, The Regents of the University of California
# Produced at the Laboratory for Fluorescence Dynamics.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, a... |
3a786fdb8e38c13d6dcdab9e78a226fe647c137722dbbb2082fe39d4ef71585f | Python | 24,520 | 485 | #==============================================================================#
# Author: Dominik Müller #
# Copyright: 2024 IT-Infrastructure for Translational Medical Research, #
# University of Augsburg ... |
5fbbb959f37d751eb9e383e6b8c2ef953f605c88756678d27fb9a1bb106e65a1 | Python | 24,521 | 691 | from keras.src import backend
from keras.src import ops
from keras.src.api_export import keras_export
from keras.src.backend.common import global_state
from keras.src.backend.common import is_float_dtype
from keras.src.backend.common import standardize_dtype
def _strategy_registry():
"""Returns the quantization m... |
d113f8c140982a56cbc49f77f78be818ec8efe532532509061ba6eb71bf34584 | Python | 24,528 | 747 | """Read-only streaming exporters + the self-contained contract (D15).
NPY, HDF5, and MAT converters: complete-only, streaming (one shard of
working memory), READ-ONLY — destructive ``reclaim=`` was withdrawn by its
own proposers (deleting source shard k after writing destination part k
destroys the only complete canon... |
fb2989d9e3babffe6025710150a94fd9551f26dad3340b19c638cdc17e5520bd | Python | 24,547 | 572 | #!/usr/bin/env python
# =============================================================================
# MODULE DOCSTRING
# =============================================================================
"""
Test objects and function in the module ``tfep.potentials.mimic``.
"""
# =====================================... |
fa7152b0dcf94d512df7b1ae3343c2b700c10d1b69af7d5441ac1439db21cc81 | Python | 24,548 | 712 | # 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... |
42fc22350fc0cb629743add3499bc3978231c39fb9a4a512be0671de8f5dc6ca | Python | 24,580 | 627 | """Tests for the xcp_d.utils.bids module."""
import json
import os
import shutil
import pytest
from bids.layout import BIDSLayout, Query
from niworkflows.utils.testing import generate_bids_skeleton
import xcp_d.utils.bids as xbids
from xcp_d.data import load as load_data
def test_collect_participants(datasets):
... |
0396354593cbd50daf10f27fd1f321784ef12d79581ac656403329dd8cdefdc1 | Python | 24,591 | 650 | import sys, os, random, scipy
import numpy as np
import pandas as pd
from numba.typed import List
import statsmodels.api as sm
from statsmodels.stats.multitest import multipletests
from tqdm import tqdm
from sklearn.cluster import AgglomerativeClustering
from anndata import AnnData
from .base import lr, calc_neighbou... |
ca31d6bed86ed6d1e1605a8200b86584527f5576df73aeeca739684c772ecbe4 | Python | 24,621 | 830 | import base64
import json
import webbrowser
import inspect
import os
from os.path import isdir
from plotly import optional_imports
from plotly.io import to_json, to_image, write_html
from plotly.io._utils import plotly_cdn_url
from plotly.offline.offline import _get_jconfig, get_plotlyjs
ipython_display = optional_im... |
f3e40abb05119dd275fca116943aacfa505605ea05c54dd5de852e8b83ec4836 | Python | 24,632 | 611 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Nov 29, 2018
@author: Quentin Lutz <qlutz@enst.fr>
@author: Nathan de Lara <nathan.delara@polytechnique.org>
@author: Thomas Bonald <tbonald@enst.fr>
"""
from typing import Union
import numpy as np
from scipy import sparse
from sknetwork.data.base import D... |
51c7df881e34291e9e7f69138b034e7cd47d840549623d13bda2f465afb9209c | Python | 24,644 | 686 | import pandas as pd
import Code_General_utility_spikes_pickling as util
import numpy as np
import matplotlib.pyplot as plt
import os
import scipy.stats as stats
_RES_DPI = 48
_SAVEDATA = False
_X_MARKER_SIZE = 50
_show_excluded = False
ID_trunk = [0,1,2,3,4] # IDs of trunk dendrites (add 7 to ID to return linear ... |
01bed8faa885f10e6c814eac4f0560b14d4e6b3f0e7083c4d87a1b3e93254e93 | Python | 24,670 | 722 | #!/usr/bin/env python3
import multiprocessing
import regex as re
import logging
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
from MarkovModels import common
from MarkovModels.BeattieModel import BeattieModel
from MarkovModels.ClosedOpenModel import ClosedOpenModel
from M... |
2b152dd51f059d71a41487bb0f6f1cdaae2a7d14b34ccb9402887891b1fe889a | Python | 24,673 | 576 | """Executable checks for documentation snippets.
Two gates live here:
* the per-block gate over the P2 ``docs/`` pages (``DOC_FILES``), and
* the canonical-page gate that EXECUTES every non-sketch Python fence in
``README.md`` plus AGENTS.md's former "Common Patterns" and "Architecture" code
(``CLAUDE.md`` only i... |
35115d80bf4a52d8df4626934267adb724e8399740b78af7f2bb089e11b9d17f | Python | 24,679 | 688 | """Direct per-arm killers for the M1 raise-arm mutation campaign (mutants2 lane).
Each test below targets exactly ONE ``raise MetadataInvariantError`` arm of its
checker (mutation_driver.py's per-arm family, id ``<contract>#aNN``) with a
duck-typed fake of the exact object the checker reads: every EARLIER arm must
sta... |
48b2c957fc8fe5298e2bdb5744da767eb34ca45c021e272617e0e7e1b469df84 | Python | 24,681 | 405 | import random
import os
from agents.model_2d import *
from envs.tunl_2d import Tunl
import numpy as np
import torch
from lesion_expt_utils import generate_random_index
import argparse
from tqdm import tqdm
import re
import gc
import matplotlib.pyplot as plt
import sys
sys.path.insert(1,'/home/mila/l/lindongy/deeprl-tim... |
7e53f5a0713be14a8f16b7830e8ecbf5a83feb5fe41184992828a0b808d01a81 | Python | 24,688 | 715 | """Programmatic geometry audit for graphviz edge-label placement.
Library API (used by ``tests/test_label_geometry.py`` as a regression gate)::
from support.label_geometry import audit_gv_source
result = audit_gv_source(gv_source)
assert result.hard_violation_count == 0, result.describe_violations()
Manu... |
9f88a31d464a30d2ea0fb1159e6e31f1b768da804794e21fe6152ed3d03c5ddb | Python | 24,688 | 564 | import importlib.resources
import nanite.model as nmodel
import numpy as np
from PyQt6 import uic, QtCore, QtWidgets
from .. import units
class TabFit(QtWidgets.QWidget):
def __init__(self, *args, **kwargs):
super(TabFit, self).__init__(*args, **kwargs)
ref = importlib.resources.files("pyjibe.f... |
b27e08f19a07e266dd100f01f091c4b2155dd4410ea494c093caa4bcf73ec433 | Python | 24,722 | 672 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
"""ResNe(X)t Head helper."""
from functools import partial
import slowfast.utils.logging as logging
import torch
import torch.nn as nn
from detectron2.layers import ROIAlign
from slowfast.models.attention import MultiScale... |
e189c28a1421340539fd2d8dde173807fc0426d95b506632e369f166bedf50a3 | Python | 24,730 | 400 | #!/usr/bin/env python3
filename_1 = "exon_position.txt"
filename_2 = "combination.txt"
#Define a function to detect AS
def file_writing(out_name, tmp, count):
if count >= 1:
o_1 = open(out_name, 'a')
for item in tmp:
tmp2 = [str(i) for i in item]
tmp_w_2 = '\t'.join(tmp2... |
29f2b5d1aea13fe3f443cb6a604f23e034b7cf796334e1e298cf31e6d941a325 | Python | 24,753 | 594 | import xml.etree.ElementTree as ET
import re, os
import pandas as pd
import logomaker
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import subprocess
from Bio.motifs.matrix import PositionWeightMatrix as PWM
from Bio import SeqIO
from scipy.cluster.hierarchy import fcluster, linkage
from util... |
6614dfc9ef23a2aa959f8f23a0519a4e887da9746a23e2c316b7de995697da72 | Python | 24,753 | 512 | import tensorflow as tf
from packaging import version
from tensorflow.keras.layers import Layer
from tensorflow.python.keras import backend
from tensorflow.python.keras.utils import conv_utils
if version.parse(tf.__version__) < version.parse("2.6.0"):
from tensorflow.python.keras.engine.input_spec import InputSpec... |
21e8c22271433045eaba7f12dbe8dd5f5b50c3df8f090aaf8f7be8cf8688e9f6 | Python | 24,757 | 723 | from functools import partial
from inspect import getmembers
from pdb import pm
from random import random
from typing import Callable, Dict, List, Union
import networkx as nx
import numpy as np
import pandas as pd
import scipy.stats as spstats
import tensorflow as tf
from nfp.preprocessing.mol_preprocessor import Smil... |
0baac4ed5db9881285d1b85d8b2cadeeb77c99f6fd72cc7cccc972898c0f49cc | Python | 24,759 | 697 | # --- 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 Layer(_BaseLayoutHierarchyType):
_parent_path_str = "layout.map"
_path_... |
5b23a67d90562a907850581f1eb7c980be1f784b037ae3f8b2c3f2027aab4e74 | Python | 24,760 | 912 | """Ops for graph construction.
Large amounts of code borrowed from Keras. Will try to incorporate into
DeepChem properly.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import os
import sys
import traceback
import numpy as np
import tensorflow as tf
f... |
34e9ebdaa8104d2c54b6148a5503b51c68f30e07ca9fc1e3413a60d689833fc4 | Python | 24,772 | 707 | #!/usr/bin/env python
# Copyright (c) 2009 Andrew D. Straw
# 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, modif... |
ca78c83a746182bcfbca12e938aa6e51d47baf628222a7f62b634eb00c7a4e67 | Python | 24,794 | 600 | """Define original spectral fitting algorithm object."""
import warnings
from itertools import repeat
import numpy as np
from numpy.linalg import LinAlgError
from scipy.optimize import curve_fit
from specparam.modutils.errors import FitError
from specparam.utils.select import groupby
from specparam.data.periodic imp... |
044c017a2c1482055ea960b02bb0068fd6cf5d66bbb8807fbe092e473896c9e3 | Python | 24,812 | 637 | """Read Until Client core
The base module provides the ``ReadUntilClient`` which is the primary
connection point between the read_until_api and MinKNOW.
"""
import grpc
import logging
import queue
import time
import uuid
from collections import Counter, defaultdict, namedtuple
from itertools import count as _count
fr... |
ddd737e88559ec73332066e241f70b673e89030fcc4b6125d98a136d660d5e46 | Python | 24,818 | 641 | <<<<<<< HEAD
"""
The original SARD implementation from github.com/clinicalml/omop-learn
"""
import math
import numpy as np
import torch
import torch.nn.functional as F
from gensim.models import KeyedVectors
from torch import nn
=======
import time
from torch import nn
import torch.nn.functional as F
import numpy as n... |
73712ba9753c2a58cb75e3371fb1fc253ab4c2df8c89d08fd437a7da6b670f80 | Python | 24,842 | 400 | import os
import random
from agents.model_2d import *
from envs.int_discrim_2d import IntervalDiscrimination_2D
import numpy as np
import torch
from lesion_expt_utils import generate_random_index
import sys
sys.path.insert(1,'/home/mila/l/lindongy/deeprl-timecells')
from analysis import utils_linclab_plot
import argpar... |
7f2342e83941f4f1dbfb0026a11d891b325396721c4a44d415c18219d5cd2669 | Python | 24,844 | 582 | """
This is the loadable seq2seq trainer library that is
in charge of training details, loss compute, and statistics.
See train.py for a use case of this library.
Note: To make this a general library, we implement *only*
mechanism things here(i.e. what to do), and leave the strategy
... |
9b60426932e686a75cb108aec8a4333983433888130dbc18763c4ec57c6e6a5a | Python | 24,850 | 494 | from tensorflow.keras.models import Model
from tensorflow.keras.layers import (
Input, Conv2D, MaxPooling2D, UpSampling2D, Activation, concatenate, Dropout, GaussianDropout,
AlphaDropout, BatchNormalization
)
from tensorflow.keras.activations import softmax
from tensorflow.keras import backend as K
def apply_... |
a697294486ee873ff19c400629476a1dbfb769b652203df200c279649ad5b7fc | Python | 24,858 | 726 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
"""Video models."""
import torch.nn as nn
from slowfast.models.common import drop_path
from slowfast.models.nonlocal_helper import Nonlocal
from slowfast.models.operators import SE, Swish
def get_trans_func(name):
"""... |
aca9905c7c3f2c84f95f55f2add1d849d57cae05f7319de79a15b788eef85d8a | Python | 24,870 | 559 | """Module that contains different layers that can be used to construct a convolutional motif kernel network (CMKN).
The main part of a convolutional motif kernel layer is implemented in the class CMKNLayer. The three pooling layers
(GlobalAvg1D, GlobalMax1D, GlobalSum1D) provide custom global pooling layers while the ... |
dfd7efa1ec567931e2876321c3057601f0ffc6f96df0b1010a45717faf94882d | Python | 24,875 | 515 | import time, itertools
from dataset import ImageFolder
from torchvision import transforms
from torch.utils.data import DataLoader
from networks import *
from utils import *
from glob import glob
# import torch.utils.tensorboard as tensorboardX
from thop import profile
from thop import clever_format
class NICE(object) ... |
f3dc66555d83e903713f868782533a332bbf18fa086fb5adceab6775b4b4b4c7 | Python | 24,881 | 648 | """
Graph/plotting registry for the larvaworld package.
This module provides a class for managing and creating plots and graphs.
"""
from __future__ import annotations
from typing import Any
import os
from .. import util, funcs, plot
__all__: list[str] = [
"GraphRegistry",
]
class GraphRegistry:
"""
R... |
f96f4db65d563e20713b5ae94cd94d926f3cab872d3ad4f035297b356d4bfde1 | Python | 24,909 | 672 | # -*- coding: utf-8 -*-
from enum import Enum
import logging
import numpy as np
from dipy.data import get_sphere
from dipy.io.stateful_tractogram import Space, Origin
from dipy.reconst.shm import sh_to_sf_matrix
from scilpy.reconst.utils import (get_sphere_neighbours,
get_sh_order_a... |
656ea642152f7f0b4cafb911b79d1cf2f896b4cd06fc1c5d960b2b0dc41a7e54 | Python | 24,912 | 757 | __author__ = 'quentin'
import multiprocessing
import time, datetime
import traceback
import logging
from collections import OrderedDict
import cv2
import tempfile
import os
#this code is reused from device_scanner
import urllib.request, urllib.error, urllib.parse
import json
class AsyncMySQLWriter(multiprocessing.Pr... |
34ff3cdf5a7deae2213d78c71ab107ee9722696941976199c4f0622940dcf568 | Python | 24,919 | 560 | """CI / packaging governance gates (grind-p3 T13 fix lane).
Each test here pins a CI-plumbing invariant that regressed silently at least
once: pre-commit and the lint gate disagreeing on ruff order, oracle legs
skipping every golden while staying green, the byte oracles never executing
on any CI leg, unscoped release ... |
484fb076d60c32f6f87f2236a0f8b73c3fcd86c936d8d41f76bdd11c4540644f | Python | 24,921 | 474 | #==============================================================================#
# Author: Dominik Müller #
# Copyright: 2024 IT-Infrastructure for Translational Medical Research, #
# University of Augsburg ... |
5466ba034f48dcc8fdd015d5ca51c050d061ef2e710c7685710ee890d768d6c1 | Python | 24,929 | 621 | import tensorflow as tf
from tensorflow.keras.layers import Activation
from typing import Union, Callable, Optional
from tensorflow import Tensor
from numpy import pi
"""
This module contains many complex-valued activation functions to be used by CVNN class.
"""
# logger = logging.getLogger(cvnn.__name__)
t_activatio... |
9e3fe9eded15efc0e55ef4902a43ab502a174f68526040a5c06d1e4350210de5 | Python | 24,937 | 792 | """ Helper functions for cci_plot.py.
"""
import sys
import math
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.axes import Axes
from matplotlib.patches import Arc, Wedge
from mpl_toolkits.axes_grid1 import make_axes_locatable
from matplotlib.path import Path
... |
aace11d744a5af73c6a0ab15c0c1f060e070bae8dd087d36b2ac6ef56571b39b | Python | 24,944 | 797 | import pickle
from collections.abc import Mapping
from copy import copy
from itertools import count
from time import monotonic
from unittest.mock import Mock
import pytest
from billiard.einfo import ExceptionInfo
import t.skip
from celery.app.utils import _new_key_to_old, _old_key_to_new
from celery.utils.collections... |
f8693c806cf23136156b2724e1787b8e43f0491c3514e197674c3b298cdf7fde | Python | 24,948 | 590 | import pandas as pd
import numpy as np
import os
import random
import json, pickle
from collections import OrderedDict
from rdkit import Chem
from rdkit.Chem import MolFromSmiles
import networkx as nx
from sklearn.utils import resample
from utils import *
import random,ast
#Setting the protein and ligand properties f... |
ada97927cc9910ebe4193c7b4be32b8241a3e84ccb98550f8622be5e1336a8f0 | Python | 24,950 | 596 | ##########################################################################
## ##
## Copyright (c) 2019 Philipp Lösel. All rights reserved. ##
## ##
## This file is par... |
9bc3c222c93ee2176a3215012412fe88f1928ce60b8686d572a0ab7f1246d807 | Python | 24,959 | 709 | """Workflows for generating plots from functional data."""
import fnmatch
import os
from nipype import Function, logging
from nipype.interfaces import utility as niu
from nipype.pipeline import engine as pe
from niworkflows.engine.workflows import LiterateWorkflow as Workflow
from templateflow.api import get as get_t... |
c8740cbd39445a3cd5c89c882289d0fc38e8f206a98ebf52fabb287fa45ec337 | Python | 24,967 | 640 | from dataclasses import dataclass
from typing import (
cast,
Literal,
Protocol,
TYPE_CHECKING,
Union,
)
from openpyxl import Workbook
from openpyxl.styles.protection import Protection
from openpyxl.worksheet.datavalidation import DataValidation
from openpyxl.worksheet.worksheet import Worksheet
fro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.