sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
8c1cddd31b76fa8a8c8906aa6ea611b3698357652c96bb53cf42e67570462229
Python
18,277
416
# SOURCE: vendored from Dr-Patient/pytorch_NeoDTI @ main # https://raw.githubusercontent.com/Dr-Patient/pytorch_NeoDTI/main/src/model.py # https://raw.githubusercontent.com/Dr-Patient/pytorch_NeoDTI/main/src/pytorch_NeoDTI_cv.py # # Wan, Zeng, Liao, Zhang 2019 (Bioinformatics) "NeoDTI: Neural integration of neighbor # ...
f7f9d4252bc7b92d11ed5faccbd490b6b036a75ffd8049f5285130642581e190
Python
18,287
577
#!/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...
c6d0a0761eae24f07d83535d081dd264f5758f2f050d47bf593223336694d118
Python
18,290
434
''' Copyright 2021 Twente Medical Systems international B.V., Oldenzaal The Netherlands 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 requir...
1d6b52859aa3e75a423f368e80a1572eef0ca44288e6b5ef65ee756c07a0b9ff
Python
18,294
503
import matplotlib.pyplot as plt import re import os from scipy.spatial import distance import numpy as np import seaborn as sns from os import listdir from os.path import isfile, join from utils import permute_l import h5py import pandas as pd from constants import * import logomaker def read_roc(path): acc_di...
592bdc2714c4b6193b404bbc5ec5047714688c9a9aeb23380db67b6c0ea285df
Python
18,295
452
# Copyright 2025 Google. # # 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 writing, soft...
3ccf501108d4c50c42b6bc464ff4466a3429d28adb7540589f14d0ad4b5b9360
Python
18,298
393
# --- # jupyter: # jupytext: # formats: ipynb,py:percent # text_representation: # extension: .py # format_name: percent # format_version: '1.3' # jupytext_version: 1.11.5 # kernelspec: # display_name: brainpy # language: python # name: brainpy # --- # %% [markdown] # # *...
248c11bd6ed2f80baca42b753ac794377ccac59e423937c1780786a02da31cad
Python
18,300
429
#!/usr/bin/env python3 import unittest """ compare.py - versatile benchmark output compare tool """ import argparse from argparse import ArgumentParser import json import sys import gbench from gbench import util, report from gbench.util import * def check_inputs(in1, in2, flags): """ Perform checking on th...
832cef7659e2db733111fabc54bf7e20efecf5fb9df21e15a582168fcba153d5
Python
18,301
533
""" Bug Report API Module Generates comprehensive bug reports for debugging by collecting system information from the node and all connected ethoscope devices. """ import datetime import platform import shutil import socket import subprocess import sys from typing import Any import bottle import netifaces from .bas...
93e3262eeb6bddf3d56e692f2c064899f9fcad7158ef9b1d289ca08f8e84593a
Python
18,303
444
import torch import torch.nn as nn import torch.nn.functional as F from ..base import _layers as layers from ..base import _blocks as blocks from ..base import _towers as towers class DeepSEA(nn.Module): """DeepSEA model implementation from Zhou et al 2015 in PyTorch This is a flexible implementation of the ...
30a3c579474810a4210d2106300f7d33db4f1cd2fb8ec61f6a4320fd840bff9c
Python
18,307
446
import numpy as np from scipy.spatial.distance import * import pandas as pd from sklearn.model_selection import train_test_split from nilearn.surface import load_surf_data import bct from netneurotools import networks as nets from netneurotools import metrics, datasets from strength_preserving_rand import strength_pr...
97be54ac817357f065ef6a41b7109df096471d23253067b27769efa772e886d2
Python
18,307
466
#!/usr/bin/env python # # Check the installation and environment variables of the toolbox and its dependencies. # # Copyright (c) 2013 Polytechnique Montreal <www.neuro.polymtl.ca> # License: see the file LICENSE # TODO: if fail, run with log and display message to send to sourceforge. # TODO: check chmod of binaries ...
4092f8e2949203729c5858da199ad9d4729484bc42af3a67c37db1ef276c26b1
Python
18,316
484
# 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...
adacce42f001f9642cf4ba3c589faa593ca5bc324543d3f259b60e4f9d3c5e3c
Python
18,318
472
from contextlib import closing from io import StringIO from os import path from typing import Optional import numpy as np from gym import Env, logger, spaces, utils from gym.envs.toy_text.utils import categorical_sample from gym.error import DependencyNotInstalled MAP = [ "+---------+", "|R: | : :G|", "|...
d3ee615afc931fc29dea1c42d0f15c01727db386ea3f82cb95616ded54f4b837
Python
18,319
549
# --- 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 Newshape(_BaseLayoutHierarchyType): _parent_path_str = "layout" _path_s...
f9d0593771351b2684360854aefe18531b26f44fbb8d8086bfb973fd4e4e2043
Python
18,322
353
import csv import itertools import os from collections import OrderedDict import PIL.Image import numpy as np import torch import torchvision.transforms from torch.utils.data import Dataset from datasets.basic import MultiSiteDataset from utils.lung_cropping_tools import get_crop_model, learning_based_lung_cropping f...
dfc28c6ee7e3f20c2ea24b10b781bc21e12fb0a1f42660c6ab6ca1192112db02
Python
18,327
428
import sys import os import math import copy import numpy as np import pandas as pd import textwrap import seaborn as sns from scipy import stats from statsmodels.distributions.empirical_distribution import ECDF from sklearn.preprocessing import MinMaxScaler from plotnine import * import matplotlib.pyplot a...
849b2235a7f255f8ea413fcb6ad075e6a9b50039b5b209b13a6ba2b3f02f2bc0
Python
18,331
536
#!/usr/bin/env python3 """ Deterministic STEPS 3D calcium diffusion in realistic morphologies with geodesic binning Last updated: 20.08.2026 Author: Laura Keto Description ----------- This script performs deterministic 3D calcium diffusion simulations in realistic astrocyte branchlet morphologies using the STEPS Tet...
ee8e92f3d0fd19acc9c1527b7c3a5282d1b1ea6ded4ec3afdbf3a0c7753f69a4
Python
18,333
663
import os from collections.abc import Iterable from time import sleep from pydantic import BaseModel from celery import Signature, Task, chain, chord, group, shared_task from celery.canvas import signature from celery.exceptions import Reject, SoftTimeLimitExceeded from celery.utils.log import get_task_logger from ce...
54564cc5958a983f72dfaae4f9a363a8c344e2d7b84e78ab27b4f2d27888b786
Python
18,335
557
# Copyright 2025 Google. # # 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 writing, soft...
6a7957d4bb6b31e88eafece9f0cdf6cb7771d651636bf6e88eea4e1f737d5d1a
Python
18,340
657
"""Handles the constants, everything that is displayed in the widget""" # License: GNU General Public License v3.0 import os import numpy as np METHODS = ["PCMCI", "PCMCI+"] TESTS = ["ParCorr", "RobustParCorr", "ParCorrMult", "ParCorrWLS", "GPDC", "GPDCtorch", "CMIknn", "CMIsymb", "Gsquared", "CMIknnMixed", "Regression...
ff377fc09dde04e7d65c94791a03842db837c816f6f0ef010c32992110c2087d
Python
18,341
426
import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # FATAL import scipy import scipy.io as sio from scipy.sparse.csgraph import dijkstra from scipy.sparse import lil_matrix import sklearn from sklearn.metrics import pairwise_distances_chunked from sklearn.decomposition import PCA from sklearn.preprocessing import Sta...
be25217ac78ad45f4eb1f774785a3bd70b96d4a119a0fd358f50e3a1bc3946dd
Python
18,358
509
# -*- coding: utf-8 -*- # # pythonguide documentation build configuration file, created by # sphinx-quickstart on Wed Aug 4 22:51:11 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # #...
c418816b3a1141e395d09e5970dd54935ea4b8b3f2ed6f092f2ced7313de7070
Python
18,366
472
import copy from typing import List, Tuple, Union try: from typing import Literal except ImportError: from typing_extensions import Literal import numpy as np import scipy from anndata import AnnData from ..logging import logger_manager as lm # --------------------------------------- Normalizing sparse arra...
1ad60b1ed8a288131fc4c54a368889d25874f0985ccf3c80e048b1d60f8efdd4
Python
18,367
569
import os from math import log import argparse def even(x): x = int(x) if x % 2 != 0: raise RuntimeError("Expected even number but received {}".format(x)) return x def str2bool(v): if isinstance(v, bool): return v if v.lower() in ('true', 'y', 't'): return True elif ...
a8752faf87b53cc067e9d098f95c4bcc4769be773ffdfcca7aab2c6a0ae00bec
Python
18,372
755
from itertools import cycle import numpy as np from plotly.subplots import make_subplots from plotly.colors import qualitative from cvsx.unit_conversions import convert def latex(s: str): if s.startswith("p_") or s.startswith("q_") or s.startswith("v_"): s = s[0].upper() + s[1:] parts = [] for s...
d317b98fe6f8b36ce67f6b6530a05500a8301b99c52a03777a647bad708b697b
Python
18,372
431
import nibabel as nb import numpy as np def load_mgh(filename): """ import mgh file using nibabel. returns flattened data array""" mgh_file=nb.load(filename) mmap_data=mgh_file.get_data() array_data=np.ndarray.flatten(mmap_data) return array_data; # function to load mesh geometry def load_mesh_geo...
e66a2453574fb629aeb26e6a34d29276e3d260bbcd5522c80e67f8dcd6ca04fc
Python
18,380
424
#!/usr/bin/env python3 """ NanoVar This is the main executable file of the program NanoVar. Copyright (C) 2021 Tham Cheng Yong 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 Li...
13430e55098e46381afeda9ff6ec2e0b7f68e83fbf02458cd090a8c0f86fe5e7
Python
18,383
476
import locale locale.setlocale( locale.LC_ALL, 'en_US.UTF-8' ) import re import pandas as pd import camelot import pdfminer from pdfminer.high_level import extract_pages try: from local_extractor.utils import common_utils except ImportError: import sys, os, pathlib path = pathlib.Path(__file__).absolute(...
6555d2b31c027772995cc8d63ceeb038add662bb010eabeece919382ed87f899
Python
18,385
489
import json import logging import optparse import os import signal import sys import time import traceback from dataclasses import asdict from http.server import BaseHTTPRequestHandler, HTTPServer from ethoscope_node.backup.helpers import GenericBackupWrapper, UnifiedRsyncBackupClass from ethoscope_node.utils.configur...
812c9e6d5cd34c661b151a313b1347a4e294f1d6405a7789ed82cdeb6431aa0c
Python
18,391
379
""" .. _tut-sensor-level: Tutorial part 1: RSA on sensor-level MEG data --------------------------------------------- In this tutorial, we will perform sensor-level RSA analysis on MEG data. We will explore how representational similarity analysis (RSA) can be used to study the neural representational code within vis...
2049c119520e79221e462754e55e65d395041d0839d603ae2a2a720ef40c649a
Python
18,398
572
# -*- coding: utf-8 -*- # %% [markdown] # # Find Fixed Points # %% [markdown] # The goal of this tutorial is to learn about fixed point finding by running the algorithm on a simple data generator, a Gated Recurrent Unit (GRU) that is trained to make a binary decision, namely whether the integral of the white noise inp...
1cd71c3f60f71d5e02c2dbaa9cb2e439bc4beeb7f233293758ac87186bcc2cd2
Python
18,399
378
# ------------------------------------------------------------------------------------- # Code with functions to plot results from model fittting # Marta Blanco-Pozo, 2023 # ------------------------------------------------------------------------------------- import os import joblib import pandas as pd import seaborn ...
1bbe26b04b845d8d81703c73478cb2db78451dbac70a4b4fa469cd4689ce36ce
Python
18,403
514
"""Utility methods for ome_zarr access.""" import csv import json import logging import os import urllib import webbrowser import xml.etree.ElementTree as ET from collections.abc import Iterator from datetime import UTC, datetime from http.server import ( # type: ignore[attr-defined] HTTPServer, SimpleHTTPReq...
a79cb42dfc33e126227bdba27ae7a024d7d5cc5c8fd7f7a5f26c68d501024e0a
Python
18,412
482
# Copyright (c) 2025, Tri Dao import math from functools import partial from typing import Optional, Tuple, Union import torch from torch import Tensor from einops import rearrange, repeat from flash_attn.ops.triton.rotary import apply_rotary def rotate_half(x, interleaved=False): if not interleaved: x...
a58108a7567bcc7512e2079ed82d134be74837d0137a1e773c6987cd043bc662
Python
18,420
532
"""Interleaved same-runner A/B performance gate for the nightly workflow. The previous nightly gate ran three whole smoke suites back to back (parent, release anchor, current) and compared single medians. Runner drift over those five minutes read as a regression: a row with no TorchLens code failed the gate at 1.40x, ...
8df1d4ba3b3b386ea010798f9219b4f8e6790a36dab5f15c452cf74009887ccb
Python
18,422
547
import pytest import textwrap import types import warnings from itertools import product import rpy2.rinterface_lib.callbacks import rpy2.rinterface_lib._rinterface_capi import rpy2.robjects import rpy2.robjects.conversion from rpy2.rinterface.tests import utils try: import IPython except ModuleNotFoundError as no...
930c883db4df7d1e947ff4d72d0dd649d2c1902fee648be89ab3ebcc765993a8
Python
18,429
412
"""Auto pipeline for object detection task""" # pylint: disable=bad-whitespace,missing-class-docstring,bare-except import time import os import math import copy import logging import pprint import json import pickle from typing import Union, Tuple import uuid import shutil import numpy as np import pandas as pd from a...
00a3785313f7da1c733ec16bac27fcf3f12577a8bbb2ee6a3724ea3227b98458
Python
18,440
447
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Oct 14 15:13:14 2020 @author: Audrey Mazancieux This script performes "event-related" analyses for one subject that has performed the local-global task on signal extracted from an ROI in native or standardised space (using the extract_timeSerie scri...
6046a4756fa024d542a99192bf4a7383f8897ec6816f46117659c0f241cbbb6c
Python
18,442
520
# 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...
8c0f45192aa075ff800e1db7e74fec3eda404c42591d296c80aeb99ebc2657bb
Python
18,445
511
# --- 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 Grid(_BaseLayoutHierarchyType): _parent_path_str = "layout" _path_str =...
0c0ea88d789be1cefba8a5c0c55a120a8a17ed8b5224b433b0add4bde397fb85
Python
18,451
527
# -*- coding: utf-8 -*- import tensorflow as tf ## ResNet base model ## class ResNet(tf.keras.models.Model): def __init__(self, stacks, version, use_bias, classes, bn_ep=1.001e-5): super(ResNet, self).__init__() self.version = version self.stacks = stacks # initial layers ...
d2b2294b1b108301d21666023f7259d6e633272e629e9d5f5bf5cbebf4c02b54
Python
18,462
539
from __future__ import annotations import sys import pytest import env # noqa: F401 from pybind11_tests import ConstructorStats from pybind11_tests import methods_and_attributes as m NO_GETTER_MSG = ( "unreadable attribute" if sys.version_info < (3, 11) else "object has no getter" ) NO_SETTER_MSG = ( "can'...
5e3592ebe824d0e51b2236ce2cb6b53885574bd5f955aa2035b5d9662639d0be
Python
18,474
489
# 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...
487f7e1bf10b875a6e45052126dfd42578ac51ae320842b088b506b6fbf2e7e2
Python
18,477
583
"""Round-28/31 capture-attribution regression pins. Locks the fixes for the round-31 capture-reseal findings (review) and the validation false-negative hunt (review): H2 runtime tensor control-arg parents, H1/M3 foreach attribution, M4 element-overlap alias propagation, M5 in-place grad_fn metadata, M6 tensor property...
f01221b184389b4525240e3cd3a599653b2c634122141d740ae781e45509e7ac
Python
18,478
495
"""Resumability + self-description contract tests for :func:`torchlens.extract_dataset`. Covers the artifact-v2 resume mechanism (extract memo D1: append-only fsynced ledger, commit protocol, field-by-field signature compare, crash-safety proven via a hard child-process death) and the self-describing bounded manifest ...
635a3f3a35a25a9699279f1282f15d37f246a582698f4b7665c7fee0752f586b
Python
18,479
579
"""Tests of decoding for `pynapple` package.""" from contextlib import nullcontext as does_not_raise from itertools import product import numpy as np import pytest import pynapple as nap def get_testing_set_n(n_features=1, binned=False, bin_size=1.0, time_units="s"): combos = np.array(list(product([0, 1], repe...
015f55684688bb6bd587a5d1749b2c134211e09497c977c161e8b2246ba3f0c0
Python
18,490
445
"""Final end-to-end integration gates for influence geometry.""" from __future__ import annotations from collections.abc import Iterator from fractions import Fraction from pathlib import Path from unittest import mock import pytest import torch from support.rf_isolation import preserved_rf_registry from torch impor...
3ab6e664adccd79c529a408767d5f0ae6f191335499a7538f4e9874c363ad924
Python
18,490
417
"""Directpose implementation""" # pylint: disable=line-too-long, redefined-builtin, missing-class-docstring, unused-variable,unnecessary-comprehension import math from typing import List, Dict import torch from torch import nn from torch.nn import functional as F from torch.autograd import Variable import numpy as np ...
55b751d76346863c830d32f5cc03a333cea12289d46c087e92fe01ee31da7436
Python
18,497
451
"""Generate a diffusion map embedding """ import numpy as np has_sklearn = True try: import sklearn except ImportError: has_sklearn = False def compute_diffusion_map(L, alpha=0.5, n_components=None, diffusion_time=0, skip_checks=False, overwrite=False, eige...
97db0f85c672e6856133c2283ea36c3078acef43ca511a5d888aaa85c29a30e5
Python
18,497
473
""" Created on 15/07/2014 @author: Andrew Robinson Modification on 24/10/2022 Addition of LDAP3 auth provider using the ldap3 module. The original LDAP auth provider uses the python-ldap library which has external dependencies like openldap client libs. ldap3 is a pure Python LDAP v3 client library. @author: Mahend...
8f428a353bdb017c1bfd32661d88521663493b5b3c5906a9be1cd186985ad41e
Python
18,498
543
# 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...
b57dfe102f5a1989ee092cf4d8327364fec5e56ab13f000d454816051a6d6a4e
Python
18,503
514
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved from http.client import RemoteDisconnected import json import numpy as np import torch import torch.nn.functional as F from torch import nn class NBLoss(torch.nn.Module): def __init__(self): super(NBLoss, self).__init__() def for...
81b094d521b7024bfad5250087736d7cfc1911408b7bc566cebdac379db18083
Python
18,505
520
# 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...
1ca97b29de73c9e403f9a75b63f1d3e3464f08853b4aca7f74c8b33762c4a930
Python
18,506
550
""" Functions to realign time series relative to a reference time. """ from numbers import Number import numpy as np from .. import core as nap from ._process_functions import _perievent_continuous, _perievent_triggered_average def compute_event_triggered_average( data, events, binsize, window=0, ...
55bf09ce5fe6f47458c5d90b2e014381069d0a8a44e832e88d082e4abc63159c
Python
18,509
482
import os import subprocess import numpy as np import pickle as pkl import nibabel as nib from os.path import join as pjoin from scipy.stats import pearsonr, permutation_test from nibabel.gifti import GiftiDataArray, GiftiImage from sklearn.linear_model import LinearRegression, Lasso from sklearn.metrics import r2_scor...
222dbac2d7c80ce0b188cb57399e5ab6a84c7f8a6dc6d8aee9d14166bfe59b06
Python
18,515
464
"""HD256 varlen API, cache, and CUDA-graph regression tests on SM100/SM110. None and fresh CUDA scalar maxima must share a device-driven specialization without host reads; Python integers retain rectangular scheduling in the backward. Set FLASH_ATTENTION_HD256_STRESS=1 for additional randomized cases. """ import os f...
764f874e824b73d9c832cd32105e8f7d8cef525431890a8404ef9db2fe1ccae4
Python
18,516
520
# 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...
9ef4f34e005dcd752e0d45e9b71b8d0366835d1951637896dfba5cabede24422
Python
18,517
437
''' Copyright 2021 Twente Medical Systems international B.V., Oldenzaal The Netherlands 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 requir...
d7e0a4f6d969868f0746608a0016a63028ccedae7048117ddc69a7057b560f35
Python
18,525
554
import fnmatch import io import logging from uuid import UUID import requests from requests.exceptions import ConnectionError, HTTPError from .cromwell_metadata import CromwellMetadata logger = logging.getLogger(__name__) def requests_error_handler(func): """Re-raise ConnectionError with help message. Cont...
48e2fe09312ae8ffe4503d3439c0fb1465cc11241e3ce65b01f2dc607a83dccb
Python
18,526
495
"""Utilities to help job and tool code setup jobs.""" import json import os import shutil import threading from typing import ( Any, cast, NamedTuple, Optional, ) from galaxy.files import ( ConfiguredFileSources, DictFileSourcesUserContext, FileSourcesUserContext, ) from galaxy.job_executi...
2f2b8c2b89dc100a1f8531d527c08fdc4017210d6e99442fc885806becb76568
Python
18,534
470
#!/usr/bin/env python """ Integration tests for the notification system. Tests end-to-end workflows and component interactions. """ import datetime import json import os import tempfile import time from unittest.mock import MagicMock, Mock, patch import pytest from ethoscope_node.notifications.base import Notificat...
45311666a14a2803b115f7294c658c2193ff3bbee78d9c5be04423ef4686f417
Python
18,535
507
""" Target Detection Analysis Module for Node This module provides node-side analysis capabilities for target detection data collected from ethoscope devices, including failure pattern analysis, dataset management, and reporting functionality. """ __author__ = "giorgio" import json import logging import shutil from ...
b0bd71d4f5904325bc5cd576930dc2a198503486b4d60c9397f1472fd739508f
Python
18,538
374
"""Train YOLOv3 with random shapes.""" import argparse import os import logging import time import warnings import numpy as np import mxnet as mx from mxnet import nd from mxnet import gluon from mxnet import autograd import gluoncv as gcv gcv.utils.check_version('0.6.0') from gluoncv import data as gdata from gluoncv ...
d29a7ed0ffd6f335738013834134ffcd9fb2a09dc78f7a3741e5a33c5e2ab946
Python
18,538
462
# Copyright (c) MONAI Consortium # 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 writing, so...
14654c474682fcd05ac5ef2755654785118dfb8633fbaabae1d838cbeb7465e5
Python
18,554
472
"""Spatial markers. """ import warnings from random import sample from typing import Tuple import anndata with warnings.catch_warnings(): warnings.simplefilter("ignore") import geopandas import numpy as np import pandas as pd from joblib import Parallel, delayed from ..configuration import SKM @SKM.check_...
fb530090a824e7249d144579cad42ebbab22203f2b51c0b549655554d00ab1a2
Python
18,556
492
import numpy as np from keras.src import layers from keras.src import ops from keras.src import random from keras.src import testing class OneStateRNNCell(layers.Layer): def __init__(self, units, state_size=None, **kwargs): super().__init__(**kwargs) self.units = units self.state_size = s...
adb2409c16d740c538398c7aefbd063ca749caa954df0f60666407df5a0bd49e
Python
18,568
374
"""Train YOLOv3 with random shapes.""" import argparse import os import logging import time import warnings import numpy as np import mxnet as mx from mxnet import nd from mxnet import gluon from mxnet import autograd import gluoncv as gcv gcv.utils.check_version('0.6.0') from gluoncv import data as gdata from gluoncv ...
2de0723de9eff256afb6ff95f79cb6e1dbc243f691f2984a759e74d5e1e49b9c
Python
18,572
388
""" Functionalities to aid in feature selection to characterize signaling patterns from spatial transcriptomics. Given a list of signaling molecules (ligands or receptors) and/or target genes """ import argparse import os from typing import List, Literal, Optional, Union import numpy as np import pandas as pd import s...
98d350c973c742d802d6341139dbd4ed2dd48a93a6c36295bc5b1e9b9ed52fed
Python
18,576
564
import collections import math import numpy as np from keras.src import backend from keras.src import tree from keras.src.backend.common import is_float_dtype from keras.src.backend.common import standardize_dtype from keras.src.trainers.data_adapters import data_adapter_utils from keras.src.utils.module_utils import...
ca9db3766734a99334ac32282b3ea5adda5daad6ba82991a70b07db4240c5727
Python
18,576
478
import re import pytest import torch from einops import rearrange from flash_attn.models.gpt import ( GPTLMHeadModel, remap_state_dict_hf_gpt2, shard_state_dict_tp, combine_state_dicts_tp, ) from flash_attn.utils.generation import InferenceParams from flash_attn.utils.pretrained import state_dict_from_...
b79b1f1b623e7790569b44b91294f1811c38f24e7b17b5f81843c92b1ba7e1d5
Python
18,581
561
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 @pytest.fixture def helsinki_region_pbf(): pbf_path = get_data("helsinki_region_pbf"...
ae1a320b41725277ec7c07cb2bb920099352d940db38bb6d0e8fa76487d238d2
Python
18,582
397
import pathlib import sys import numpy as np import optuna import pandas as pd import torch import torch.nn as nn from pyreadr import pyreadr from sklearn.metrics import roc_auc_score, precision_recall_curve, auc from torch.utils.data import Subset, DataLoader from datasets import VisitSequenceWithLabelDataset, pad, ...
c2f777079a573c7a5999f6d60871ff45082963ca2966aa78895476ef217735ef
Python
18,590
549
"""Reusable read-only Panel tables for LarvaDataset step and endpoint data.""" from __future__ import annotations from html import escape from collections.abc import Callable from typing import TYPE_CHECKING, ClassVar import pandas as pd import panel as pn from larvaworld.lib.param.custom import EndpointDataFrame, ...
7d8b8ba6992042f36967b1cc7925fcdfd66edb6417e24266a15cb841d2968b3e
Python
18,593
538
import numpy as np import pandas as pd from anndata import AnnData import scipy.spatial as spatial from numba.typed import List from numba import njit, jit, prange from stlearn.tools.microenv.cci.het_helpers import ( edge_core, get_between_spot_edge_array, get_data_for_counting, add_unique_edges, ...
f4273d89415baf4b205ca125f4fac49b7f6902132453adbc624d6609e65291d1
Python
18,593
330
import torch import torch.nn as nn import numpy as np from .losses import smoothl1_loss, l1_loss, SigmoidFocalClassificationLoss from external_src.group_free_3D.OR_4D.OR_4D_detection_dataset import DC def compute_points_obj_cls_loss_hard_topk(end_points, topk): box_label_mask = end_points['box_label_mask'] s...
4e4d2e53d2a6ceab02b32004ebc1a5ab2d9d9ef5be591234a1ab8698573483fa
Python
18,598
442
# 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...
0008fedc6695b31a81c3bb5a1b355263fd1474c70fbf9e5fb2facdacbfba3f5c
Python
18,605
554
############################################# # This file contains scripts to perform the # # Convolutional Neural Net experiments. # # # # Author: Jonas Ditz # ############################################# import argparse import os import pickle im...
10176267074a7c088f729bc36e3a46c81ca4c3b3efe8611819fd9ca9fdb1d492
Python
18,609
562
""" glm.py This module contains functions to run and analyse GLMs predicting ROI activity from stimulus and behavioural information for data generated by the Allen Institute OpenScope experiments for the Credit Assignment Project. Authors: Colleen Gillon Date: September, 2019 Note: this code uses python 3.7. """ ...
e50dcb6ba91e8c6cc18d41b68171e1309b85aa4481009ba13d9d505dfa5b0147
Python
18,610
501
import argparse from multiprocessing.spawn import prepare import random import os import glob import matplotlib.pyplot as plt import numpy as np from pathlib import Path import pandas as pd from sklearn.linear_model import LogisticRegression, LogisticRegressionCV from sklearn.model_selection import train_test_split f...
c43c0f164b12e9f8cea07de50d2d36b0d8f22fd368c627cf4a76e1e9320dfeae
Python
18,622
455
import pickle import random import numpy as np import json import os import glob from typing import List, Dict, Any import warnings warnings.filterwarnings('ignore') ## TODO: Interface config should be loaded from the config file rather than hardcoded here. ## @liuyang: 2025-03-20 GEN_INTERFACE_CONFIG = { "interf...
3a9b90a912285590b97c7ac465661715af6f5b3f07bf7b6998ccac649d7146fa
Python
18,625
493
import copy from tqdm import tqdm import torch import torch.nn as nn from graphmae.utils import create_optimizer, accuracy from graphmae.models.gat import GAT from graphmae.models.gin import GIN from graphmae.models.gcn import GCN from graphmae.models.dot_gat import DotGAT from graphmae.models.gcnii import GCNII impo...
5e31430f491a8914a81f802039f9dfa3c1b13ed338f14652b20f94b491802a4e
Python
18,625
560
from __future__ import annotations import json from pathlib import Path from typing import Final import pytest from labelme import _config from labelme._config._migration import migrate_config def _steer_home(*, monkeypatch: pytest.MonkeyPatch, home: Path) -> None: monkeypatch.setenv("HOME", str(home)) # n...
a9e410a9c8b0bab87baf662d861a1424b2cbaff3e469dc8007d66cc0ce2905ec
Python
18,647
450
"""TensorFlow implementation of fully connected networks. """ from __future__ import print_function from __future__ import division from __future__ import unicode_literals import logging import warnings import time import numpy as np import tensorflow as tf import threading import collections import pdb import deepch...
34751a6a9abe609e53aa19f93fd1563b95c611fa8c43bc0bbd0350c30fc4df61
Python
18,654
455
import os import numpy as np import pytest from absl.testing import parameterized from keras.src import backend from keras.src import layers from keras.src import models from keras.src import ops from keras.src import saving from keras.src import testing from keras.src.backend.common import AutocastScope from keras.s...
c188a3c62e762f1786f697852754ce896931f3fc0f4e2b4a89bca931036a9b34
Python
18,654
558
#!/usr/bin/env python # how to use this function... # PYTHONPATH=lib python lib/galaxy/model/dataset_collections/types/semantics.py import argparse import ast import os import re import sys from io import StringIO from typing import ( Annotated, Any, Literal, NamedTuple, ) import yaml from pydantic im...
af151b3f24aad550f0485711b0ec9f78990b84928c321a8e1617f6adcc9bc5a3
Python
18,657
326
from __future__ import print_function, division import os import sys import torch import warnings import numpy as np import subprocess from torch.autograd import Variable from models import CompFCNNTarCNNModuleInception, CompFCNNTarCNN4Layers, CompFCNNTarCNNModule2Layers, CompFCNNTarCNN4LayersStride, get_model from eva...
1c0d0ecf6e2b68d48f2446ec02af79268d9e8cf8591e7257e0af092ed7d9f60a
Python
18,658
526
# 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 th...
16223aa1b75c36c7294dd8d5b9c55019521f2829e19567a448763967bb05fdbc
Python
18,665
597
""" Classes that build the larvaworld CLI argument parser. Parser arguments are derived automatically from the canonical :class:`param.Parameterized` configuration classes (or from registry parameter dictionaries), so that the CLI surface stays in sync with the underlying parameter definitions instead of duplicating t...
34a9a6ecc6d53e80e880fde614931b20d98e5e642aba29106943b3e26595df51
Python
18,668
477
import inspect import os import pickle import numpy as np import pytest from absl.testing import parameterized from keras.src import backend from keras.src import constraints from keras.src import layers from keras.src import models from keras.src import optimizers from keras.src import testing from keras.src.api_exp...
e13796e44261243988ce9b5231636bb3a945f69c12e9234426f93766e2a062f2
Python
18,668
427
"""Keras base class for convolution layers.""" 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.backend import standardize_data_format from keras.src.layers.input_spec import InputSpec from...
f74c66ade6eef79f01f55c6f6c6d14bec45d18892411ad93705fbd377f5917a0
Python
18,676
405
import argparse from loader import MoleculeDataset, load_data import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from sklearn import metrics from sklearn.metrics import roc_auc_score,accuracy_score,precision_score,recall_score,precision_recall_curve,f1_score from skle...
b4f6acc962219dbe8853c27129d5d3ef3a9955936ede727db7fbe7f10c7fc449
Python
18,687
584
"""Data type definitions. This module provides the basic data types for Wyrm, like the :class:`Data` and :class:`RingBuffer` classes. """ import copy import logging import numpy as np from wyrm.processing import append_cnt logging.basicConfig(level=logging.NOTSET) logger = logging.getLogger(__name__) class...
af6ae4b680cd39cad0505f12f0c251910a81478b6d15d4f253ec0577759f64fa
Python
18,699
361
# !/usr/bin/env python ## created by Yun Hao @MooreLab 2021 ## This script contains functions used for implementing LRP to evaluate relevance of DTox paths ## Module import numpy as np import pandas as pd import torch from functools import reduce from operator import concat from statsmodels.sandbox.stats.multicom...
ef880f928b6297fa4d964fe425c97cd72e3fa589bba722d813b9cb6b4c651b05
Python
18,701
446
import contextlib import streamlit as st import pandas as pd import plotly.express as px import http import urllib import re import statsmodels.api as sm import holoviews as hv from holoviews import opts, dim import requests import duckdb hv.extension('bokeh', logo=False) #draw interactive visualization using holoview...
55e94cc8f56020951fea7d8a5c99530a673df832190646ccb650cfa6f76857a0
Python
18,704
653
# Natural Language Toolkit: TextGrid analysis # # Copyright (C) 2001-2011 NLTK Project # Author: Margaret Mitchell <itallow@gmail.com> # Steven Bird <sb@csse.unimelb.edu.au> (revisions) # URL: <http://www.nltk.org> # For license information, see LICENSE.TXT # """ Tools for reading TextGrid files, the format us...
c60524fd92b9676b585d4cd41503e79593cd09d79238c7f54944a3ee87d4e02c
Python
18,704
491
#!/usr/bin/env python3 """ Deterministic STEPS reaction-diffusion simulation with volume-matched calcium injection. Last updated: 20.08.2026 Author: Laura Keto Description ----------- This script performs a deterministic three-dimensional calcium-calmodulin reaction-diffusion simulation in STEPS using the TetODE solv...
eaf22795af923f1db610ac0d7d7a6b657e6169bf5ab72a17b6caf9a94985dd72
Python
18,708
543
"""Dynamo / fake-mode boundary: graceful typed degradation, never a raw crash. Tensors inside a ``torch.compile`` region are data-free ``FakeTensor``s. Every TorchLens step that reads a value -- ``safe_copy``, ``torch.equal``, ``.item()``, ``data_ptr()``, memory accounting -- is meaningless or fatal on them, so before...
62619aaf61ead8bf376c2a57f12c06978bdd62d9dafc4400c4b4d0efb9a2e0aa
Python
18,710
383
# ----------------------------------------------------------------------------- # Copyright (c) 2015, The Deblur Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # -------------------------------------------------...
deef6424932f22e5e7806c2dd37ae1eb0b81592861cd7e6cf9c05ab9b293bae0
Python
18,727
372
# Adapted from import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from torch.distributions import Categorical, Normal @torch.jit.script def soft_clamp(x: torch.Tensor): return x.div(20.).tanh_() @torch.jit.script def soft_clamp_scale(x: torch.Tensor): return x.div(20.).tanh_...
96d110b4aaf44aa01a0a34418b797461aba319178410983b841ba57604d5d5dc
Python
18,732
469
"""The composition ledger: one row schema, closed vocabularies, seed rows (row 0.8). Compo memo 3.1: tests own verification policy through this importable ledger; production owns product truth (operation ids, operation-grain backend capabilities) which rows REFERENCE by id and never restate. Every declared cell carrie...