sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
09c3ae48fecaa460bdd569c14056afab3453dc8c716009f49e1f072a22d45c35
Python
21,565
343
import os import random from agents.model_1d import * from envs.int_discrim import IntervalDiscrimination 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 argparse imp...
09b48c88c2e76afcb825dda91af49d7eb8f523dcf2999443aa9561da90f9f0a5
Python
21,570
620
"""Stale pre-wrap torch references: every holder shape is disclosed and rescued. A model built before the process's first capture holds pristine torch functions (``self.act = F.gelu`` resolved before ``wrap_torch()``). Capture never rewrites the user's objects; instead an escape signal triggers the rescue re-run, whos...
f155b76043f2535b75cfe7944252de093d412aea12892959af40bae2b1d828ac
Python
21,590
634
#!/usr/bin/env python """ Description of the sticky end concept and what does the marking mean. what is the reaction matrix and so on .... Copyright 2013 B. Gruening and Hitesh Patel version: 0.3 """ import argparse import logging import multiprocessing import os import re import shutil import subprocess import sy...
30968627874113e99712e2b68555aa71ef8af824edff43004eb121b155c03a9d
Python
21,629
508
""" Characterizing cell-to-cell variability within spatial domains """ from collections import OrderedDict from typing import Dict, List, Literal, Optional, Tuple, Union import anndata import matplotlib.pyplot as plt import numpy as np import pandas as pd import scipy from anndata import AnnData from matplotlib import...
7adbb3f15d0d3df59b5f68cc3baa033339497950bc190be51d7abcdd44c147a8
Python
21,645
235
# pylint: disable=line-too-long,too-many-lines,missing-docstring """Kinetics700 video action recognition dataset. Code adapted from https://github.com/open-mmlab/mmaction and https://github.com/bryanyzhu/two-stream-pytorch""" import os from ..video_custom import VideoClsCustom __all__ = ['Kinetics700'] class Kinetics...
a8b95aec8e86132b4fd9dbdffceb14c1e979569e03d6995ebb5413aa6883a453
Python
21,667
638
# Author: Christian Brodbeck <christianbrodbeck@nyu.edu> """Tools for loading data form eyelink edf files.""" from glob import glob import os import re import shutil import subprocess import tempfile import numpy as np from .._data_obj import Dataset, Datalist, Var from .._utils import ui from .._utils.subp import ge...
93de152f0746328002ae8f3d55d6ee00b334ee6ec2d7150e176360912d1cc325
Python
21,671
574
import pkg_resources import logging from PyQt6 import QtWidgets, QtCore, uic # from PyQt6.QtWidgets import QMessageBox from matplotlib.widgets import SpanSelector import numpy as np import multiprocessing as mp import time from bmlab.session import Session from bmlab.controllers import CalibrationController from bm...
eacdfdd981bd48d804e45a7a258e8d09a3d4389e937958894ff8577d87e587e3
Python
21,673
627
# 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...
32db25ea881f71cac83ce098eeb2dbd29b8c8acda0ce699c53efea970a2890a0
Python
21,674
259
import numpy as np from gym import utils from gym.envs.mujoco import MujocoEnv from gym.spaces import Box class HumanoidStandupEnv(MujocoEnv, utils.EzPickle): """ ### Description This environment is based on the environment introduced by Tassa, Erez and Todorov in ["Synthesis and stabilization of co...
fd6b662b4dcb0e9822e681f673c3122c0477b5fbcd14a0ddff8942967260dc3a
Python
21,677
576
""" Code here relates to the creation of stimulus waveforms from epoch tables. In the waveform editor of ClampEx, you can edit the stimulus waveform table for each channel (DAC). Each waveform table is made of epochs, which appear as a single column of values in the waveform editor. The overall strategy here is that ...
76ccf3ace751aece8c226ef298fd457fc07fc6e6f251a6820d9af4d83e03d010
Python
21,682
354
#functions from "Figure 1 and 2 - Foraging decisions emanate from high arousal states.ipynb" originally worked on this in December 2020 import os import pandas as pd import numpy as np import ssm from ssm.util import one_hot import re import copy from numpy.linalg import norm from scipy.stats import multivariate_norma...
126179dc367e1929c1dd82faa1de8f712d0efb4cb5afafd81d8ed53416f387ae
Python
21,685
571
# --- 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 Line(_BaseTraceHierarchyType): _parent_path_str = "scatter3d" _path_str =...
32d6ef57ca586b23af9294fe87d1d2dca56530b45364694f0ab90044029b0e9b
Python
21,685
675
import argparse import json import os import warnings import matplotlib import matplotlib.pyplot as plt import numpy as np import pandas as pd import plotly import plotly.graph_objs as go from galaxy_ml.model_persist import load_model_from_h5 from galaxy_ml.utils import read_columns, SafeEval from sklearn.feature_sele...
b88c923ce00d21034cb5e883131e8e32fe7b1b99fe9d82e0c16983d1d55fd3e3
Python
21,691
481
from core import * import genotypeio import torch from torch.utils import data import numpy as np import pandas as pd import scipy.stats as stats from collections import OrderedDict import sys import os import time sys.path.insert(1, os.path.dirname(__file__)) def _in_cis(chrom, pos, gene_id, tss_dict, window=100000...
162860ba61099260d113073a8f168ad20b132194dd526a5ed5fd4fac1bc60da1
Python
21,704
543
# pylint: disable=missing-function-docstring, line-too-long """ SlowFast Networks for Video Recognition ICCV 2019, https://arxiv.org/abs/1812.03982 Code adapted from https://github.com/open-mmlab/mmaction and https://github.com/decisionforce/TPN """ import torch import torch.nn as nn import torch.utils.checkpoint as cp...
fcbaaa5ee0670f86d9ab5882a8215fc30e741f252b508b564d4f30f9a7437866
Python
21,714
527
from __future__ import annotations import argparse import logging import os import subprocess # nosec - needed import sys from itertools import product from typing import Optional, Union from bream4.device_interfaces import device_wrapper from bream4.device_interfaces.devices.base_device import BaseDeviceInterface f...
d4324ade5d90a93e9478907adc7294ebede0f1de3c3d85f616cc5257f24ec993
Python
21,721
530
#!/usr/bin/env python # coding: utf-8 # In[1]: from tqdm.auto import tqdm import torch import torch.nn.functional as F from trainingUtils import MultipleOptimizer, MultipleScheduler, compute_kernel, compute_mmd from models import Encoder,Decoder,VAE,CellStateEncoder,CellStateDecoder, CellStateVAE, SimpleEncoder,Loca...
d3effd0f41adb54ec55d40a83279d963ea466fefdd6de106939140cf47ded87b
Python
21,739
575
from importlib import resources import logging from PyQt6 import QtWidgets, QtCore, uic # from PyQt6.QtWidgets import QMessageBox from matplotlib.widgets import SpanSelector import numpy as np import multiprocessing as mp import time from bmlab.session import Session from bmlab.controllers import CalibrationControll...
6ef1708ee231b92b056e3d9adffe74d1153e8ae9de888678b8babf8c5223615e
Python
21,740
625
"""Phase 14 error catalog and cross-cutting intervention API audit tests.""" from __future__ import annotations import gc import threading import weakref from collections.abc import Callable, Iterable from pathlib import Path from typing import Any import pytest import torch from example_models import TinyReluAdd as...
947a9da4e541fde66cff7c39159c3ac983f01f7f3e1449394d85515fbfd49707
Python
21,743
511
#!/usr/bin/env python3 """ File: visualise_interaction_eqtl.py Created: 2022/04/07 Last Changed: 2022/07/20 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...
3bd1865b8601cddbbaafa6db0d24db5353d1984b66a0b785b61502a828e1b7b8
Python
21,758
620
'''learning module''' import sys from abc import ABCMeta, abstractmethod from typing import cast, Any, Optional, Dict if sys.version_info >= (3, 8): from typing import TypedDict, Protocol else: from typing_extensions import TypedDict, Protocol import os import warnings import uuid import pickle import copy im...
56ccc844590675738b2348662b7750ab52d7fa584dc60e0086b9aaa27d7281f8
Python
21,771
416
#==============================================================================# # Author: Dominik Müller # # Copyright: 2024 IT-Infrastructure for Translational Medical Research, # # University of Augsburg ...
e8f75e568e22561338b9f4c45c8d8edc6a6c63f5791cb46bc3f77bef0cbda66c
Python
21,771
484
""" Tests for transformer objects. """ from __future__ import division from __future__ import unicode_literals from deepchem.molnet import load_delaney from deepchem.trans.transformers import FeaturizationTransformer __author__ = "Bharath Ramsundar" __copyright__ = "Copyright 2016, Stanford University" __license__ = ...
8e8bca7fca6daf4a78281dd8f3f5890c20145b5001bfde0448b656508f885e86
Python
21,798
663
"""Worker remote control command implementations.""" import io import tempfile from collections import UserDict, defaultdict, namedtuple from billiard.common import TERM_SIGNAME from kombu.utils.encoding import safe_repr from celery import states from celery.exceptions import WorkerShutdown from celery.platforms impo...
1343f1e1a4ece3098e3b6875e6169ab3949ce836ccdcd7f32e6cbf244e144439
Python
21,803
485
""" Job control via the DRMAA API. """ import json import logging import os import shlex import string import time from typing import ( TYPE_CHECKING, TypeAlias, Union, ) from galaxy import model from galaxy.jobs.handler import DEFAULT_JOB_RUNNER_FAILURE_MESSAGE from galaxy.jobs.job_destination import Job...
f0ff761ca7c0f6168870c18d1593498b209efe55ec788fa4a5fb3188c88d6df3
Python
21,805
483
from core import * import genotypeio import torch from torch.utils import data import numpy as np import pandas as pd import scipy.stats as stats from collections import OrderedDict import sys import os import time sys.path.insert(1, os.path.dirname(__file__)) def _in_cis(chrom, pos, gene_id, tss_dict, window=100000...
648076c066dd71bd3afb5beb1ae606d7e801d77f5c50bee5d324a84df628b60e
Python
21,808
549
import os import numpy as np import pandas as pd from mirp.settings.generic import SettingsClass from mirp.settings.transformation_parameters import ImageTransformationSettingsClass from mirp.settings.feature_parameters import FeatureExtractionSettingsClass from mirp.settings.resegmentation_parameters import Resegmen...
4f5e13357162d7db235eea4e5eb69cffd936c6c8ac8658c62550cf3707c998bd
Python
21,825
505
# 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...
b4d5a346b30b96ac8b17b78ea62732d6c58fb5da9e0e8fbc204613664708e76b
Python
21,835
622
__author__ = "quentin" # flake8: noqa: E402 from collections import deque import cv2 from .adaptive_bg_tracker import BackgroundModel CV_VERSION = int(cv2.__version__.split(".")[0]) import logging import os import matplotlib.pyplot as plt import numpy as np from scipy.spatial import distance from ethoscope.core.d...
e7488c43f585cb9e1540960eede23fbb0d54814872f8f2506d0d717d72c2eb82
Python
21,837
579
"""Corruption-path regression tests for portable TorchLens bundles.""" from __future__ import annotations import io import json import pickle import re from pathlib import Path from typing import Any import pytest import safetensors # noqa: F401 import torch from torch import nn import torchlens as tl from torchle...
88a668f6a418f4bae08c810426d0fd6a43834f7c7cf8653599a62f5c46a4e92c
Python
21,839
551
from functools import partial from typing import Callable, Optional, Tuple import cutlass import cutlass.cute as cute import torch from cutlass import Boolean, Int8, Int32, const_expr from flash_attn.cute.block_sparsity import ( BlockSparseTensors, BlockSparseTensorsTorch, to_cute_block_sparse_tensors, ) ...
515ba8e62961e5eef97334683d8109add3de8fa0babf9321b6f0a0993c34aab9
Python
21,847
666
"""Hardening tests for ``tl.debug.infer_input_shape`` (round 22). Three mandated properties: 1. NO SIDE EFFECTS: the caller's model (state_dict, training flags, lazy-init status) is identical after any call, across lazy, train-mode BatchNorm, and meta-device models. 2. NO ESCAPE: ``on_failure="return"`` never r...
82920d410a690b148154e33900aec56c8ef8e2ed3ccafdc89e64cada628c92e0
Python
21,860
445
import json import os from math import ceil import pandas from matplotlib.widgets import Slider, RadioButtons # will not work without this imported from mpl_toolkits.mplot3d import Axes3D import mne from mne.datasets import fetch_fsaverage from scipy.stats import scoreatpercentile from mp_dip.utils.multivariate_atom...
8fcac78f0c00ee819f6e87a1456601ed1a992d729ffb243d62f0e9d19ba30784
Python
21,860
470
from os.path import join, exists from ovseg.utils import io, path_utils from ovseg.utils.dict_equal import dict_equal, print_dict_diff from ovseg.data.Dataset import raw_Dataset from ovseg import OV_PREPROCESSED import os import torch from time import sleep, asctime try: from tqdm import tqdm except ModuleNotFoundE...
ed4a478965360430043f2a593e5dd147f15fbd9c0c810c0eda4c501ce8850adb
Python
21,864
690
from flask import Flask, request, jsonify, render_template, send_file import os import json import numpy as np from math import isnan from natsort import natsorted #from pprint import pprint # Our modules import power import data import image import cohort import correlation import session import image_math app = Fla...
b3e0897e1eb1c3b80ea47c2f7f5abcd3fa1a7b86d81ab807e1472665f967c7a9
Python
21,869
500
# pylint: disable=arguments-differ, missing-docstring """Encoder and Decoder functions. Encoders are used during training, which assign training targets. Decoders are used during testing/validation, which convert predictions back to normal boxes, etc. """ from __future__ import absolute_import import numpy as np from ...
23fcd98649886c39bf1ea2c8d96582f6f8d712777990d01d436935c6d537f338
Python
21,874
555
from __future__ import absolute_import import errno import logging import operator import os import shutil from optparse import SUPPRESS_HELP from pip._vendor import pkg_resources from pip._internal.cache import WheelCache from pip._internal.cli import cmdoptions from pip._internal.cli.base_command import Requiremen...
279f188b64070ba8a700890ab8da5414189e2d5986eeb17fd772be8fae634f1d
Python
21,874
493
import copy import logging from collections import defaultdict from dataclasses import dataclass from pathlib import Path from typing import Sequence, Union import numpy as np import pandas as pd import torch from ase import data as ase_data from monty.serialization import loadfn from pymatgen.analysis.graphs import M...
7d19c9731337d0d11252c36b3b79e68aed6ddc4b38d2a07f1d12dd3e52a6ab08
Python
21,907
610
""" Evaluation of simulated models against reference data. Runs one or more models under a reference dataset's conditions and scores the resulting behaviour against the recorded distributions and cycle curves. """ from __future__ import annotations from typing import Any import copy import os import warnings from ....
c62d81eb1941451ffc56d626be76416559b1125e05a11fd0cd638b9a267c5b0d
Python
21,914
685
import argparse from networkx.generators import community from scipy.spatial import distance_matrix, minkowski_distance, distance import scipy.sparse import sys import pickle import csv import networkx as nx import numpy as np import pandas as pd import time from sklearn.manifold import TSNE from sklearn.metrics impo...
efabd5ff527584cfee855b42c34ee6d33abd850a7a75ea41b5c2370f689ec93e
Python
21,916
585
import os import csv import copy import datetime as dt from pyoperant.behavior import base, shape from pyoperant.errors import EndSession, EndBlock from pyoperant import components, utils, reinf, queues class TwoAltChoiceExp(base.BaseExp): """A two alternative choice experiment Parameters ---------- ...
15347f0a70216990a8f2cd0b534421a77587021acde9e4c1bc894d5afb2bb5e4
Python
21,921
591
import numpy as np from keras.src import backend from keras.src import initializers from keras.src import layers from keras.src import testing class SimpleRNNTest(testing.TestCase): def test_basics(self): self.run_layer_test( layers.Bidirectional, init_kwargs={"layer": layers.Simp...
23dab7629c32108d903f6c4931dba21311cd9bf2316cf61c7682d74d5c9cfcef
Python
21,925
599
""" Superclass Manager and Serializers for Sharable objects. A sharable Galaxy object: has an owner/creator User is sharable with other, specific Users is importable (copyable) by users that have access has a slug which can be used as a link to view the resource can be published effectively making ...
a9b418230459f876ff969a76bfc0a9d67b54cffe94237eae76bd1e2771953aec
Python
21,935
439
import unittest from spitfire import Library, Dimension from spitfire.chemistry.library import LibraryIndexError import numpy as np from copy import copy, deepcopy machine_epsilon = np.finfo(float).eps class Slice1D(unittest.TestCase): def test_full(self): l1 = Library(Dimension('x', np.linspace(0, 1, 16...
657b10f7cb575389d56cb89b1ca80eecd7ab5c3778cadc7f1aeed58c2e279646
Python
21,944
410
from __future__ import generators import logging import glob, os, functools import sys import gc os.environ['CUDA_VISIBLE_DEVICES'] = "3" os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3" import SimpleITK as sitk from scipy.signal import medfilt import numpy as np from numpy import median import scipy import nibabel a...
a7af01499945967c02c8cae01044acfa7c1ea65c44491406d74cd30c728253ca
Python
21,945
605
# Author: Christian Brodbeck <christianbrodbeck@nyu.edu> """Plots for color/style legends""" from collections.abc import Iterator from itertools import chain from typing import Any, Dict, Literal, Sequence, Union import numpy as np import matplotlib import matplotlib.axes import matplotlib.cm from matplotlib.colors im...
ed47430dbf498fd267760aa244010b92e5047c3b560c56b58db1b1663da4c297
Python
21,950
514
"""P3D, implemented in Gluon. https://arxiv.org/abs/1711.10305. Code adapted from https://github.com/qijiezhao/pseudo-3d-pytorch.""" # pylint: disable=arguments-differ,unused-argument,line-too-long __all__ = ['P3D', 'p3d_resnet50_kinetics400', 'p3d_resnet101_kinetics400'] from mxnet import init from mxnet.context imp...
87223418472ffc3e214b7b902c6c7751462a69c62e65bb4daef75cc093525ba4
Python
21,952
474
# miscellaneous tools import os import subprocess import sys import pandas as pd from collections import defaultdict import gzip from numpy import unique import numpy as np import pickle #import HTSeq #import pysam #PATH = './' PATH = os.path.dirname(__file__) HOME = os.path.expanduser('~') STAR_PATH = os.path.joi...
e62a86806af8564263b7a3904174df85b3a76d40ebbf0aa7e2b7e83a9ce90555
Python
21,963
627
import os import grain import numpy as np import pytest import tensorflow as tf from absl.testing import parameterized from tensorflow import data as tf_data from keras.src import Sequential from keras.src import backend from keras.src import layers from keras.src import models from keras.src import saving from keras...
0cf64bd5cc30fa04ee162e8958eed9996adab03e8372f8253f5992d27a056f5e
Python
21,964
558
import os import csv import copy import datetime as dt from pyoperant.behavior import base, shape from pyoperant.errors import EndSession, EndBlock from pyoperant import components, utils, reinf, queues import serial import random class Visit(utils.Event): """docstring for Visit, a variant of trial for place pref...
11c398de667b7320f9000a6f537b0b13de245e3f8008494113818510c2c161bf
Python
21,976
656
from rdkit import Chem import re from torch.autograd import Variable import torch import numpy as np from multiprocessing import Pool import pandas as pd from rdkit.Chem.Scaffolds import MurckoScaffold from Metrics.SA_Score import sascorer from Metrics.NP_Score import npscorer from rdkit.Chem.QED import qed from rdkit....
e82529657842627db856117dc668e6e78588549a2a1904dcae99b7dfcfeb4024
Python
21,981
281
"""Все параметры мира в одном месте. Ничего не хардкодим в движке.""" from dataclasses import dataclass, asdict, field import json @dataclass class Config: # --- воспроизводимость --- seed: int = 1 # --- мир --- grid_h: int = 128 grid_w: int = 128 patch_freq: float = 0.05 # ниже = круп...
56f4a0c36f6d2fae02f6c496cd60fc2b439fc8f5de0e266b9cb5a3bf4f1afb0c
Python
21,982
454
"""b5 R45-2 / SF-41: string private-attribute reach-ins are ledgered, not free. ``getattr(trace, "_raw_to_final_op_labels", {})`` is a private reach-in that the linter cannot see: SLF001 flags ``trace._raw_to_final_op_labels`` but NOT its string spelling, so the measured 1771-1777 SLF001 hits UNDERCOUNT the real encap...
e97809afd8fbff0738d746191801a7f64c07263288c2706871d9205320824b05
Python
21,989
497
import functools import gc from multiprocessing import Pool, cpu_count from typing import Optional, Tuple, Union import numpy as np import psutil import scipy from ..logging import logger_manager as lm # --------------------------------------------------------------------------------------------------- # Spatial sm...
a40b49cb47045bcbd59bc45b7c3ca9dc04a4ae7e86698f7b725072941e584c2f
Python
21,992
676
"""Tests for the CodeCarbon CLI main function.""" import io import os import sys from types import SimpleNamespace import pytest import requests import typer from typer.testing import CliRunner from codecarbon.cli import main as cli_main class FakeApiClient: def __init__(self, endpoint_url=None): self....
d7719765f2476192f04e220b3795446379202abf9cfc60bdb9176200332f22b7
Python
21,995
612
"""Tests for streaming out save during ``trace``.""" from __future__ import annotations from pathlib import Path from typing import Any import pytest import safetensors # noqa: F401 import torch from torch import nn import torchlens as tl import torchlens.postprocess as postprocess_module from torchlens import tra...
ad28f728959fe1eed91fff8694071791e7e9bfcd85d7ecb9b786c29676a06c91
Python
21,999
527
import math from collections import OrderedDict from datetime import datetime try: from zoneinfo import ZoneInfo except ImportError: from backports.zoneinfo import ZoneInfo import math import packaging.version import pytest from rpy2 import rinterface from rpy2 import robjects from rpy2.robjects import vector...
af484c4e477b2de78859ddebe97acba87d67599fe27deca57b2400f9f0b6dc87
Python
22,002
454
""" evaluation_07.py — figures, statistics and CSV export Two changes matter relative to the earlier version. Navigation results are keyed by phase as well as by group: navigation = {phase: {group: [TrialResult, ...]}} Previously a single group-keyed dictionary was passed in, so whichever phase was written last o...
4377388725a1436f9c76983e406fa8f94ff07838a898d45d0d8ce154f2398a42
Python
22,026
615
""" behav_analys.py This script contains functions for running and pupil analysis. Authors: Colleen Gillon Date: January, 2021 Note: this code uses python 3.7. """ import numpy as np import pandas as pd from util import gen_util, math_util, rand_util from sess_util import sess_load_util from analysis import basic...
3dd12ab4063cfb4bfdcebbc430efea91a4e33ff64ea6c4f07f8163bda74b1c12
Python
22,028
501
import os import pandas as pd import numpy as np from collections import namedtuple from .swcch import soma_check, general_check, parentindex_check, datatype_check, typeid_check, index_check, spiderleg_check from .swcco import ( contour_convert, swc_sort, set_unspecified_typeID, set_standard_somaID, ...
dada14f4d1c145309152ff49b7fa0970527cce37b9528c1c5bde72bfddc58a7b
Python
22,028
573
""" roi_analys.py This script contains functions for ROI mask and projection analysis. Authors: Colleen Gillon Date: January, 2021 Note: this code uses python 3.7. """ import numpy as np import pandas as pd from util import gen_util from sess_util import sess_load_util from analysis import misc_analys # PRESET ...
2d6c9b8a842cd7e1225c3dca151447d2512b34efff76020f12ca883079fbca4d
Python
22,071
661
from functools import lru_cache from typing import Generator import numpy as np from mirp._features.cm_matrix import MatrixCM from mirp._images.generic_image import GenericImage from mirp._masks.base_mask import BaseMask from mirp._features.histogram import get_discretisation_parameters from mirp._features.texture_fe...
16f13c60db87c051aec086eae82263dc7227207a8c2326c0365f013471c2609f
Python
22,073
526
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license from __future__ import annotations import contextlib import math import os import random from collections.abc import Iterator from pathlib import Path from typing import Any from urllib.parse import urlsplit import numpy as np import torch import to...
cd3ecd50ebfc205eb2ee53065b4e6e48a05be46520f40e7955aa127539d4652b
Python
22,074
724
from numpy import linalg as la def lambda_dist(A1, A2, k=None, p=2, kind="laplacian"): """The function is migrated from NetComp package. The lambda distance between graphs, which is defined as d(G1,G2) = norm(L_1 - L_2) where L_1 is a vector of the top k eigenvalues of the appropriate matrix assoc...
54f624233c2300b545a6b61d90c317fae7c0b06b40599f91fcb467ba4b9b7f6b
Python
22,077
582
import os.path import pytest CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) def _type_converter(type_str: str): if type_str == "int": return int elif type_str == "float": return float elif type_str == "bool": return bool elif type_str == "str": return str ...
21d14097566563ac82edbe914ce64d9676c6835bc84bf29c569f7ddf2cb975a3
Python
22,078
502
"""r57 C3 immunizer -- op-agnostic FakeTensorMode allocation preflight, allowlist DELETED. r55 closed the allocation-bomb class with a ``FakeTensorMode(allow_non_fake_inputs=True)`` per-call projection, but GATED it behind a hand-maintained ``_SIZE_DRIVING_QUALNAME_TAILS`` op allowlist. r56 found the allowlist re-open...
4a259e61207bfcfea8e194a1f4f1c3de47f41e058bede013348a19af61393edc
Python
22,079
619
""" Unit tests for Session Management. Tests secure session creation, validation, and cleanup for authentication. """ import datetime import time import unittest from unittest.mock import Mock, patch from ethoscope_node.auth.session import SessionManager class TestSessionManager(unittest.TestCase): """Test sui...
d563bcb8131fca7e8941f180d66d9fc7aa95b470503e8145467651908ca61852
Python
22,082
525
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # 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 u...
9e87eee70630220cb25c2ff740f7d3c2f9ce07fe8b3037ddff646223b076e77a
Python
22,119
515
# 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...
bed3f5388ca1a58c4f2b20708e3d1714d5a7cd4899bc3eb491800bff882cc612
Python
22,133
573
# --- 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 = "funnel" _path_str = ...
4927f23256b185fbdb5644c3db36536c2dc648f2e0298e72420c2cb0decc32df
Python
22,135
529
import os.path import pytest import numpy as np from mirp.data_import.import_image_and_mask import import_image_and_mask from mirp._data_import.read_data import read_image_and_masks from mirp._images.generic_image import GenericImage from mirp._masks.base_mask import BaseMask from mirp._images.ct_image import CTImage ...
91cfa2502f61a348573d11451e0d583d94f853723de60978b43636bcf0538af6
Python
22,144
535
from typing import Dict, List, Optional, Tuple, Union import networkx import numpy as np import plotly.figure_factory as ff import plotly.graph_objects as go from plotly import callbacks from ...logging import logger_manager as lm class PlotNetwork: def __init__(self, G: Union[networkx.Graph, networkx.DiGraph],...
62a02ac162e8d97191e8a864d540d5a0bca700977dca3c187b2f85aca5c57372
Python
22,145
452
#!/usr/bin/env python3 """Экспериментальный раннер: калибровка, уровень шума, сравнение условий. python experiments.py calibrate # кривая чувствительности метрики python experiments.py noise --seeds 10 # разброс одного условия python experiments.py compare --seeds 20 # se...
ee4f3bc9ae3876a26caf5c11350c53b954f434dc63234deec5be72cf590c8219
Python
22,149
578
import os import numpy as np import pytest import keras from keras.src import layers from keras.src import models from keras.src import ops from keras.src import random from keras.src import testing from keras.src.legacy.saving import legacy_h5_format from keras.src.saving import object_registration from keras.src.sa...
affafadec0475882464cfa235ad7c0627cda3bf543e2a75dbf0be2f2fdb9ed1c
Python
22,167
571
""" simulation_06.py ================ SimPy wheelchair navigation driven by REAL classifier accuracy. Control paradigm ---------------- The decoders are binary (left hand vs right hand), so the simulation uses shared control (Millan et al. 2010; Rebsamen et al. 2010): at each control cycle an autonomous planner propos...
68043aec0ce14452932bdc0093c6537fa90881f8b138f061102b7296a2c8d487
Python
22,174
494
""" Author: Bruno De Santi, PhD Affiliation: Multi-modality Medical Imaging Lab (M3I Lab), University of Twente, Enschede, The Netherlands Date: 20/09/2023 Description: Learning model of MUVINN-reg Acknowledge: The code was adapted from 1) J. M. Wolterink, J. C. Zwienenberg, and C. Brune, “Implicit Neural Representat...
7ddef9e03cdafda81a3f1ee715cf9bbdb936f8ac7b65f079c090fd422db2091a
Python
22,177
504
import math import os import time import torch import torch.nn as nn import numpy as np; from torch.autograd import Variable import scipy import matplotlib.pyplot as plt import scipy.io as sio from sklearn.preprocessing import normalize from sklearn.cluster import KMeans from sklearn.metrics import normalized_mutual_in...
0151f6b27d39a9bb1d73a7063defd4c1ac4d6ac12fecc28d7f1d404a62247f2d
Python
22,179
662
import warnings from pathlib import Path from textwrap import dedent from typing import Generic, List, Optional, Set, Tuple, Type, Union, cast print('Not using') import cyvcf2 import joblib import numpy as np import pandas as pd import pyBigWig import pysam import zarr from natsort import natsorted from numcodecs impor...
908322f6d30adf016e72818a392a3a5f5c9af7ec9548ef163495bb5a55c68c47
Python
22,191
595
"""Regression coverage for batch-4 Lane P cache, I/O, and perf fixes.""" from __future__ import annotations import gc import warnings import weakref from pathlib import Path from typing import Any import pytest import torch from torch import nn import torchlens as tl from torchlens import user_funcs from torchlens....
dd588219fa31eb8d714274d8d48ff35916d384c0be7b60a20e045e2c0e430fce
Python
22,193
499
"""Input alias topology and non-tensor tree contracts.""" from __future__ import annotations from collections.abc import Callable, Iterable, Mapping, Sequence from typing import TYPE_CHECKING, Any, cast import torch from . import _state from ._runnable_state import ( RunResourceCeiling, _guarded_defensive_m...
18873010c94ea4eb3fd4649ab27556d82ae12eab07ff081a74f1f37239a2dda6
Python
22,195
607
import time import unittest from unittest.mock import MagicMock, Mock, patch from ethoscope.stimulators.multi_stimulator import MultiStimulator from ethoscope.stimulators.stimulators import DefaultStimulator, HasInteractedVariable # Optional imports for specific stimulator tests try: from ethoscope.stimulators.sl...
1799d977591c32e88594443779aa0986eca7d2ccd10f81356a162b974be8c3a0
Python
22,206
612
from __future__ import division from os.path import abspath, dirname, join as joinpath import subprocess import pytest import numpy as np from pandas import read_hdf from scipy.special import binom from scipy.sparse import dok_matrix from scipy.sparse.linalg import spsolve from pyrho.utility import (get_table_idx, ...
f28cc7e0a055e00077acb79e3483bf3180175435bb43da41b3e14ebb4227224d
Python
22,206
346
#### Master Script 1b: Calculate summary statistics and missingness of different study sub-samples #### # # Shubhayu Bhattacharyay # University of Cambridge # email address: sb2406@cam.ac.uk # ### Contents: # I. Initialisation # II. Load and prepare summary characteristics of full TIL dataset # III. Calculate summary s...
19a2625722349350f4c53e97abb674354a5b855195668053babeb0498e1004ed
Python
22,209
592
"""Spatial position and occupancy related functions.""" import warnings import numpy as np import pandas as pd from spiketools.utils.data import assign_data_to_bins from spiketools.utils.checks import check_array_orientation from spiketools.utils.extract import create_mask, get_values_by_time_range from spiketools.u...
f60891623a9bfb108c9a0c018f13a8ccedd0b5f49c1235fac5d16b7075caa0b3
Python
22,216
469
#!/usr/bin/env python3 """plot_wafer_region_order.py Top level command-line interface for generating plots showing the ordering of the sections on top of their original locations on a wafer. Copyright (C) 2018-2026 Max Planck Institute for Neurobiology of Behavior This program is free software: you can redistribut...
054029f2c3daa633948827e84d5eb945b3b41e398df49f31fc5e0764d7b49245
Python
22,218
751
import numpy as np import scipy as sp import matplotlib.pyplot as plt import phantominator as ph from skimage.transform import radon, iradon # import cupy as cp from time import time from skimage.metrics import structural_similarity as ssim import sys # cambiar para drive # import DataLoading as dl def TwIST(y, A, AT...
4d4f2f9d630996c254f8b30015abd8d84e620674b717e3c552f6d0cd25883aef
Python
22,218
564
"""P3 proofs: persisted attestation, N1-N5 gates on real surfaces, F6 latch. Persistence round-trips (adopt / derive / no-upgrade / tamper-degrade), the capability gates armed on real products at their real entries, the F6 stop-request latch for every swallowed-signal spelling, Recording and PartialTrace outcome surfa...
9eba0af333268a5e193924706d44371caeda7d95315406ce133a721293527334
Python
22,220
538
""" Deals with key and mouse events SimplyFire - Customizable analysis of electrophysiology data Copyright (C) 2022 Megumi Mori This program comes with ABSOLUTELY NO WARRANTY This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published ...
41a58f8874daf2baec5df170be2065eb23b7e2dd587ac3611fecaf923eaf3bdb
Python
22,223
547
import torch as th import torch.nn.functional as F import dgl import numpy as np import random import dgl.function as fn from torch import nn import pandas as pd ## #the model architecture of graph transformer is modified from https://github.com/BioinfoMachineLearning/DeepInteract def glorot_orthogonal(tensor, scale)...
7cfaaf9b65a7d4e3d787ca6ebb21fec9a79a3f5d10dff4093a45f0fe4f6502bf
Python
22,230
434
"""Mask RCNN Estimator.""" # pylint: disable=consider-using-enumerate,abstract-method,arguments-differ import os import math import time import logging from multiprocessing import Process import numpy as np import mxnet as mx from mxnet import gluon from mxnet.contrib import amp from .... import data as gdata from .....
58d5535ef3fc64bff7b6c1f38ad3aa0431b4a028dfb2e5dd37c17a90ba2101c2
Python
22,243
433
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # Written by Yuichiro Yada #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ################################################ # A code for Fig. 5b-d ################################################ import numpy as np import pandas as pd import seaborn as sns import os...
66de3b670c4f904e549abc371766676152ad499dd3133f6f3806278554a1cda3
Python
22,251
657
"""Portal Module Inspector: kind-aware standalone module stepping and signal plots.""" from __future__ import annotations import logging from html import escape from typing import Any import panel as pn from bokeh.models import ColumnDataSource from bokeh.plotting import figure # Suppress Bokeh patch ...
a214b7b947409629c46f4487ed6d8b6d629c6762c05bf2bf035bb9b30caec1fd
Python
22,279
600
"""Image-translation / generative-GAN family: CycleGAN, CUT, DCGAN, DF-GAN, DiGAN, DeepFillv2. A compact, faithful atlas pack of the distinctive generator/discriminator cores from a cluster of well-known GANs. Each entry reproduces the *distinctive primitive* of its paper at small random-init scale (atlas bar = archit...
2892300bd5ac704e1151cc3e7ca4720341d8b6e921d8187ebbec85dcea2a1ee6
Python
22,285
551
# Copyright (c) 2021 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...
ee2b16b62634ada014e8cd9cb8ae8bdbee634ebbfe661712005d46248600867c
Python
22,287
670
# -*- coding: utf-8 -*- ### Functions for à trous wavelet transforms ### Synonyms: stationary wavelet transform, non-decimated wavelet transform, ### starlet transform import numpy as np from scipy import signal from scipy import ndimage from scipy.ndimage import convolve1d import itertools as itt from .constants...
085d69be8bac36ea3c1fa3a1bf5f0e3134a393aea0a1aefd22ea13f545f0a65d
Python
22,302
507
"""r59 whole-class immunizer -- aggregate replay resource ceiling (allocation-DoS close). r57 bounded per-op allocation BYTES via a ``FakeTensorMode`` projection. r58 found two seams the byte budget is structurally blind to: * free_1 -- ``tensor_split(x, N)`` drives N *empty* output tensors (~0 bytes) off ONE int l...
b84dd2dc5f8867b55396f631a5ac1799450a6f14e17b0aee988bf2a581817ea7
Python
22,310
470
#! /usr/bin/env python3 # -*- coding: utf-8 -*- """ Local streamline HARDI tractography using scilpy-only methods -- no dipy (i.e no cython). The goal of this is to have a python-only version that can be modified more easily by our team when testing new algorithms and parameters, and that can be used as parent classes ...
fac4c7f1cccd1b280c33ced24fc737eee8be9151fe2fe67709aea08074747cb5
Python
22,315
458
import abc import json import six import warnings import h5py import tensorflow import tensorflow.keras.backend as K import tensorflow.keras as keras from tensorflow.keras import layers from tensorflow.python.ops.gen_nn_ops import Softmax from data import DataGenerator from utils import img_to_kspace, kspace_to_img, ...
314f9df18f09c258f7bc60190e3d5f90117f65995d9468280cba93cc68362f5f
Python
22,359
611
"""Reading logic for ome-zarr.""" import logging import math from abc import ABC from collections.abc import Iterator from typing import Any, Optional, TypeVar, Union, cast, overload import dask.array as da import numpy as np from .axes import Axes from .format import format_from_version from .io import ZarrLocation...
7135b4a0a05002f20d71a7416002a0f4dd158e34572da5112117e1dbec5cc391
Python
22,362
556
import logging import os from autouri import AbsPath, AutoURI from .caper_backend_conf import CaperBackendConf from .caper_base import CaperBase from .caper_labels import CaperLabels from .caper_workflow_opts import CaperWorkflowOpts from .cromwell import Cromwell from .cromwell_backend import ( CromwellBackendAw...