sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
3e041623cfecd4061a8d0d268ce7b6e101f0c2ca9b73995fad91fbc7c0b71966
Python
10,448
340
# --- 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 Tickfont(_BaseTraceHierarchyType): _parent_path_str = "scatterternary.marker....
15d918b114392e5e203b7aa436cde10420da737865fa4012ff41e91103ee7ffb
Python
10,449
272
from typing import Optional, Union try: from typing import Literal except ImportError: from typing_extensions import Literal import gpytorch import numpy as np import pandas as pd import torch from anndata import AnnData from gpytorch.likelihoods import GaussianLikelihood from numpy import ndarray from scipy....
585e99f9c705a5924f28a5496bb026e0a7e7b3dcd936f16a94d2cc743a5a9069
Python
10,449
316
__author__ = 'quentin' import os import logging import datetime import json import traceback import random import subprocess import time import urllib.request, urllib.error, urllib.parse import http.client class WrongMachineID(Exception): pass try: from netifaces import ifaddresses, AF_INET, AF_LINK excep...
96c91a05ca9fddb3d9ba91b4df67ee2dfefa418bf9c29010ea3b225da739e818
Python
10,450
264
from __future__ import absolute_import import collections import logging import os import re from pip._vendor import pkg_resources, six from pip._vendor.packaging.utils import canonicalize_name from pip._vendor.pkg_resources import RequirementParseError from pip._internal.exceptions import InstallationError from pip...
9a5cf13f742ae3f2b760eb8f334110c6df756ebb030f575890fda446ee0a31d4
Python
10,450
341
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Textfont(_BaseTraceHierarchyType): _parent_path_str = "histogram2dcontour" ...
3ae7da1c666c715d8df4f6e2b9af702964abf2c12872d55bdbd5c094c99bbf14
Python
10,452
297
import os import re from datetime import datetime, timedelta, timezone from time import monotonic, sleep from unittest.mock import ANY import pytest from celery import uuid from celery.utils.nodenames import anon_nodename from celery.worker import state as worker_state from .tasks import add, sleeping NODENAME = an...
90b45ec144014697b3629d4322448cb8ccf009106d19fb8b00b30eb006839125
Python
10,455
346
from anndata import AnnData from typing import Optional, Union import numpy as np import pandas as pd import networkx as nx from scipy.spatial.distance import cdist from stlearn.utils import _read_graph from sklearn.metrics import pairwise_distances def global_level( adata: AnnData, use_label: str = "louvain"...
8614ddf0101ae1907a5de25ea727919c8a110082939e426a65c3473103d51563
Python
10,457
258
import glob import os import numpy as np import pandas from astropy.stats import circmean from mne import fit_dipole, create_info, EvokedArray, make_ad_hoc_cov from mp_dip.old.config import RESAMPLING_FREQUENCY from mp_dip.utils.interpolate_head_features import INTERP_SIZE from scipy.signal import convolve2d from sc...
3479b04b21df5dba7ecc0bc8792bc941afd4f098b8372a3a2d0949fe857ffc2f
Python
10,458
232
import os import torch from collections import OrderedDict from abc import ABC, abstractmethod from . import networks class BaseModel(ABC): """This class is an abstract base class (ABC) for models. To create a subclass, you need to implement the following five functions: -- <__init__>: ...
50ff349455d9c59d4318e275f24b8e7e6ad856726183910d0b8d6488c1845cc6
Python
10,459
271
#!/usr/bin/env python3 from DeepRegFinder.preprocessing_functions import _bed_to_saf, process_histones, ChannNormDataset from DeepRegFinder.prediction_functions import * from DeepRegFinder.traineval_functions import prediction_loop from DeepRegFinder.nn_models import create_model from torch.utils.data import Dataset, T...
c82ffe723c18d5f88065d50538d25244902c19a4f3ae30bd2de765d72421a4e5
Python
10,462
214
from typing import Optional import pytorch_lightning as pl from pytorch_lightning import Callback from pl_bolts.models.regression import LogisticRegression from torchmetrics.functional import pairwise_cosine_similarity import torch from torch.utils.data import TensorDataset, DataLoader from metrics.metrics import co...
42fc4b1a4f8fe3502dfaca6e2d1a52d970bda385a774445e5c1ef59cb3ce3c30
Python
10,465
325
from __future__ import annotations import json import os import random from copy import deepcopy import matplotlib.pyplot as plt import numpy as np from tqdm.auto import tqdm from ..utils import COLORS from ..utils import transform_gt_into_pr from .count_curve import calc_scores from .count_curve import count_point ...
630311db14475a70d687d070a90019a93576960b1aaf9c670aecef12301294dd
Python
10,465
258
#!/usr/bin/env python # coding: utf-8 # overall goal ------------------------ # the goal is to put only one HLA allele in testing data, while make sure that # the tcrs in training + validation do not have overlap with those in test # still want to sample according to frequency matching # put one target HLA allele in ...
abfbb16f7774820a2e8cf69cf15ae04209bc49d44c4de1b68825938262e4ef82
Python
10,469
214
import numpy as np import os import sys import ntpath import time from . import util from . import html from subprocess import Popen, PIPE if sys.version_info[0] == 2: VisdomExceptionBase = Exception else: VisdomExceptionBase = ConnectionError def save_images(webpage, images, names, image_path, aspect_ratio...
bf8a597da51053c88e5336af57f7fd7cb6a99b11945d382d5c934bc103afbc12
Python
10,469
258
"""A09 listA row 24: every tabular/file export carries capture-honesty facts. One shared source (torchlens._capture_honesty) feeds every exporter in torchlens.export, the debug DataFrames, Trace.to_pandas, the accessor tables, and the fastlog tables -- through the format-appropriate slot (comment preamble, metadata bl...
01a932ac6a62ac9c77cd949bb3cb21d6a8be739cbeb7a10013a67d77cd8302d4
Python
10,470
226
# 均匀采样效果较差 import json import numpy as np import os, sys import random from collections import Counter from sklearn import preprocessing from sklearn.metrics import f1_score from sklearn.metrics import confusion_matrix import torch import torch.nn as nn import torch.nn.utils.rnn as rnn_utils import torch.nn.functional ...
bf0857d7991194a0434c156f1084976735438c456dc299668fc361eefab1eec6
Python
10,472
159
from __future__ import print_function import sys from bisect import bisect_left from collections import defaultdict from math import pow, sqrt from svim.SVSignature import SignatureTranslocation, SignatureInsertionFrom, SignatureClusterBiLocal from svim.SVCandidate import CandidateDuplicationInterspersed from svim.SV...
efdf04d8073379f88459b4064cd0a45879d19abed8c19086b4f59fd9518d129e
Python
10,475
254
from __future__ import print_function, unicode_literals, absolute_import, division from six.moves import range, zip, map, reduce, filter from six import string_types import numpy as np import argparse import warnings from packaging.version import Version from ..utils.tf import keras_import, BACKEND as K keras = kera...
194d6be2c2b9798a6e32c8a27f196b0fc6a430d3e529e30f6a3b16643a753bdb
Python
10,477
252
"""Tests for how XCP-D derivatives are written. The 4D denoised BOLD outputs are written in worker processes rather than on nipype's main thread, and every derivative niworkflows rewrites or copies is compressed with ISA-L instead of zlib. """ import gzip import nibabel as nb import numpy as np import pytest from ni...
1cdab4db672d7302ccba8905ae74f07e0641df5f03652b4132a3ef29184fc482
Python
10,479
262
# -*- coding: utf-8 -*- """ Created on Tue Aug 2 14:47:43 2022 @author: Lenovo """ from scipy import signal import numpy as np import math import matplotlib.pyplot as plt from random import randint,seed import os class tools: def __init__(self): self.my_dict={10:{0:{"Idle":[[1.73,5.014],...
4aae17dfe6606c118327c9998d129d570c70889ad86f6120ce712a789f0d7ab7
Python
10,480
319
from collections import Counter import itertools from permacache import permacache, stable_hash import tqdm.auto as tqdm import numpy as np from sklearn.linear_model import LogisticRegression from modular_splicing.data_for_experiments.standardized_sample import ( standardized_sample, ) from modular_splicing.eval...
cddbe1ee424458e63c30949173d78c977e23bdc7721c16743e3e4af7ff398c16
Python
10,480
416
"""Statistical-mechanics neural machines, 1980-2002. Paper: Gardner 1988, "The space of interactions in neural network models"; Kinzel and Kanter 2002, "Interacting neural networks and cryptography". Tiny sign, erf, parity, and spin-glass modules expose the canonical order parameters and energies while omitting traini...
0388a094129a577f1e9fd958915fce361b679f0bb7cf760ccf21b381ecc25b07
Python
10,481
286
#!/usr/bin/env python """ tune_servo.py -- Interactive servo angle tuning for Rev D Magpi hopper. Run this script directly on the Raspberry Pi to find the correct up_angle and down_angle values for a panel's hopper servo. Once you have good values the script can write them into this box's own panel_config.json as hopp...
978dd26bf7ebdea4cd767dfb45588d3a3db511c90a22ffa02710ed575bf33c14
Python
10,482
270
#!/usr/bin/env python3 """ Hard-reject commit messages or push payloads that contain semantic-release major-bump triggers (Conventional Commits ``!`` markers or ``BREAKING CHANGE:`` footers). TorchLens stays on the 2.x family per the locked project release policy. The PyPI 1.0.0 and 2.0.0 slots have already been burne...
8ffb496c76cd9cffb2c4060b18e9caeb16deae3998a74a67b2bbe2d18f25144e
Python
10,483
263
"""Round-18 PARAM host-escape parity: bring PARAMETER host-escape handling to parity with the (already-correct) registered-BUFFER handling on BOTH axes -- untracked host WRITE and read-only host READ. Params were inconsistent with buffers: * Too LOOSE on writes (F2, CRITICAL). A zero-copy numpy alias of a PARAM acqui...
8638bbad04491b73e70b2e5334e07115eeb1090f17f0e39a3d73026cf6d3fd69
Python
10,485
267
from multiprocessing import Pool from utils import mapper, valid_smiles, read_smiles_csv, get_mol, canonic_smiles, compute_scaffolds, fingerprints, calc_self_tanimoto, side_no_sca_change, mol_passes_filters import argparse import pandas as pd from utils import canonicalize_smiles_from_file import numpy as np def fract...
03f98b55faacd145066a1ebf7d635bdc3293dc6bc185229aeeaa7610102bc966
Python
10,486
327
# %% ''' Perform statistics on connectivity results when considering the contigency awareness ''' from nilearn import plotting from numpy.ma import mask_rowcols import pingouin as pg import seaborn as sns import h5py import numpy as np import pandas as pd import matplotlib.pyplot as plt from bct.nbs import nbs_bct im...
d99d942a1ae872a841b4c2d5c60807e0756d79905b106983986710548c783834
Python
10,487
341
# --- 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 Grouptitlefont(_BaseLayoutHierarchyType): _parent_path_str = "layout.legend...
33b6f45fed0cbcbba9a79b889ff323294523ce36859b52952ab53e1a689a2262
Python
10,488
341
#!/usr/bin/env python """ Small library with cheminformatic functions based on openbabel and pgchem. Copyright 2012, Bjoern Gruening and Xavier Lucas """ import glob import re import subprocess import sys import tempfile from multiprocessing import Pool import numpy as np try: from galaxy import eggs ...
4d50125cd6e0257187f4fbd771cc2828c483f5e4261b2a7de9aeaeedd40281af
Python
10,489
224
#!/usr/bin/env python3 -u # -*- coding: utf-8 -*- import os import argparse import json import pandas as pd import numpy as np from datetime import datetime from sklearn.model_selection import train_test_split from sklearn.svm import SVC from preprocessing import get_zmap_dataset, features_from_df, preprocess, Featur...
b1fde9a64e38bec2defa76d3e8e0e302791adcdd2a4927a65311ac05e6ae9e79
Python
10,493
341
# --- 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 Grouptitlefont(_BaseLayoutHierarchyType): _parent_path_str = "layout.hoverl...
e29152fde0971d1c099423587c57ebd45ffd8a1599f1ef5337dee773555e830a
Python
10,493
303
"""Saved-graph double-VJP projective gradient regression tests.""" from __future__ import annotations from collections.abc import Callable from pathlib import Path import pytest import torch from torch import nn import torchlens as tl from torchlens.backends.torch._tl import is_decorated_function from torchlens.bac...
650be0c8cd007e69812aad4e74e52503a49ce91b5d2dd8e5a3091b3c41defc04
Python
10,495
414
import json import os import shlex import numpy as np with open("../data/rbnsp_motifs_split.json") as f: rbnsp_split_half = json.load(f) with open("../data/rbnsp_motifs_split_90.json") as f: rbnsp_split_90 = json.load(f) with open("../data/rbnsn_motifs_split_90.json") as f: rbnsn_split_90 = json.load(f)...
4910213e018c790e1983fca9d067b2765f2fc194bf634fb569ec4ec1d7665900
Python
10,496
377
#!/usr/bin/env python3 import dataclasses import re import secrets import subprocess import time import requests import typer from pydantic_settings import BaseSettings, SettingsConfigDict from typing_extensions import Annotated # TODO: use pydantic settings class FiefSettings(BaseSettings): fief_main_admin_api_...
de41ee8bb9f904f160de2c8ff56d672d95245e317151e84fae1b684a9f46f9aa
Python
10,498
211
from __future__ import division import unittest import numpy as np from wyrm.types import Data from wyrm.processing import segment_dat from wyrm.processing import swapaxes class TestSegmentDat(unittest.TestCase): def setUp(self): # create 100 samples and tree channels data ones = np.ones((100,...
ad67eeba13d927fa82c6898f7e2fd843c2971094e3654b94ac1d35713e347a8a
Python
10,502
341
# --- 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 Font(_BaseLayoutHierarchyType): _parent_path_str = "layout.annotation.hover...
bad3eb15b99e6a8cd426d012d43d51c6bcecd92d1d6aeb76fd6039a2a8874073
Python
10,504
276
import torch import os import glob import subprocess import flirpy import flirpy.io.seq from flirpy.io.fff import Fff import numpy as np import imageio.v3 as iio import cv2 import time import csv from datetime import datetime from tqdm import tqdm # Define the paths script_path = r"C:\Users\jland\anaco...
c14f7fdc83afb82a7e5392480815f3df412db3d2d9bf8e641980fa15b7c9abfc
Python
10,507
359
import h5py import numpy as np import torch from torch.utils.data import DataLoader from torch.nn.functional import softmax import torch.nn as nn import torch.nn.functional as F import os from utils import ( extract_dist, list2seq, permute, ) from random import shuffle import itertools, operator from tqd...
37ea6528af4a233755147aad3a202dc06bf82bdc3d7cfcecdf79e96742a1cd8e
Python
10,508
273
from typing import Callable, Optional, Tuple, Union, Literal import numpy as np import torch import torch.nn as nn from pytorch_lightning import seed_everything from pytorch_lightning.core import LightningModule from pytorch_lightning.utilities.model_summary import ModelSummary from tqdm.auto import tqdm from .base._...
9798478a6ff53312f8b90f94889e3191591b2df22b031e357afd82920696d00e
Python
10,508
263
# -*- coding: utf-8 -*- """ Created on Tue Aug 2 14:47:43 2022 @author: Lenovo """ from scipy import signal import numpy as np import math import matplotlib.pyplot as plt from random import randint,seed import os class tools: def __init__(self): self.my_dict={10:{0:{"Idle":[[1.73,5.014],...
cec8810ffeeb362334737bb08dfd69a8781a5258ae715bf7eb5b6283c748f755
Python
10,508
289
from abc import abstractmethod import numpy as np import tensorflow as tf from tensorflow.python.ops import random_ops from tensorflow.python.ops import stateless_random_ops from tensorflow.keras.initializers import Initializer import sys from pdb import set_trace # Typing from typing import Optional INIT_TECHNIQUES =...
696dded6668fee33a2c3fed505aa954b983ca79f39a92d456d018ee3306a389f
Python
10,517
324
"""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 from scipy import stats import numpy as np import sys import warnings from .independence_tests_base import CondIndTest class ParCorr(Cond...
d1d2ea439caf6c03321463432dde4dc951a8838718f147eb5d32cfc58224ce0f
Python
10,518
263
""" run_pipeline.py — full experiment, healthy controls and post-stroke patients 1. Load data_loader_01 per-subject trial arrays with real labels 2. Reject preprocessing_02 artifact rejection, flatten to (X, y, subj) 3. Phase 1 amplification off, classify, simulate navigation 4. Phase 2 ...
e1b0d283baf4514a5c7334b28971ee8ce3e55b06e00efdbadb52a94cdd09b177
Python
10,519
342
# --- 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 Labelfont(_BaseTraceHierarchyType): _parent_path_str = "contour.contours" ...
07c5067a575500aee54478337b4dedb5a7269a94261377b7539c269fecaeddc7
Python
10,520
303
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # 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 applicab...
e8e5146d754b7577adba1f064d553def6f70ea3da97d19ef5695b9a9e6490b02
Python
10,522
268
""" Copy-paste from monai 0.8.1 in order to unselect classification layers and return intermediate outputs """ import torch import torch.nn as nn from collections import OrderedDict from typing import Callable, Sequence, Type, Union from monai.networks.layers.factories import Conv, Dropout, Pool from monai.networks.l...
733362fc02a6e5db5e954bae8495f0c2e7dd94906ceb0563443f4c6aff2bbc41
Python
10,524
280
import torch import torch.nn as nn import torch.nn.functional as F from torch.optim import Adam from sklearn.metrics import roc_auc_score, average_precision_score import scipy.sparse as sp import numpy as np def sparse_to_tuple(sparse_mx): if not sp.isspmatrix_coo(sparse_mx): sparse_mx = sparse_m...
c2f39e45fae1a277ce8af661168faae69eb65770e44097e86d81dc1bf7f5a5a7
Python
10,527
340
from types import SimpleNamespace from unittest.mock import patch import pytest from codecarbon.core import hardware_cache from codecarbon.external.hardware import CPU from codecarbon.external.ram import RAM def make_tracker(**overrides): defaults = { "_tracking_mode": "machine", "_force_cpu_pow...
29e7e91d66c2bc159edda7725cc49299d2344eaf802349fcb4194a53c491966e
Python
10,529
244
"""07. Train YOLOv3 on PASCAL VOC ================================ This tutorial goes through the basic steps of training a YOLOv3 object detection model provided by GluonCV. Specifically, we show how to build a state-of-the-art YOLOv3 model by stacking GluonCV components. .. hint:: You can skip the rest of th...
e80cc5640d086c10da0649ca62ae5756347b5183bf2e51028538d73dc157dfb3
Python
10,530
286
""" Test module for verifying proper filtering of invalid devices in the ethoscope scanner. This module tests that devices with empty names, empty IPs, or empty device IDs are properly filtered out and do not appear in the device list. """ import time from threading import Lock from unittest.mock import MagicMock, Mo...
5a710f3164b5d6cec43aca3a811b9f036a727cada8ccbfebad23b58ca76fe536
Python
10,531
288
"""Extraction planner, plan table, run door, and npz oracles (F20). The brainpipe centerpiece (memo section 3): two real probes, per-site linear byte fits with batch-invariant detection, budget arithmetic that refuses instead of shrinking (D-10), full-signature plan keying (D-15), the trace-only engine gate (D-11), th...
6f221fa5272f202dcd0b97de5b6bcd655b6e3e80c710f16796c31ca96b8c6878
Python
10,531
259
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Nov 5 16:22:54 2021 @author: fcheng """ import glob import os import numpy as np import pandas as pd from eval.image_process import img_process from eval.identify_line_orientation import principalOrient_Radon_var, create_region_mask, crop_region ...
0717fbbf4bfde47edb2e0a99c4cedcbc41ba3984d84ee8ca67c44b041fb7da71
Python
10,532
318
"""Corpus fixture loaders + the O14 admissibility instrument (memo B9/B10). The vendored fast path is 32 distinct CC0/public-domain photographs (licensing verified per image; see ``MANIFEST.jsonl`` + ``LICENSES.md``), deterministically expanded to a 128-row fixture through seeded crops, flips, and channel gains. The p...
7ae69efd1c3627ca1fdd32b9af5548cd08ca1bb5c1f8dce4aaf0ff581c6852ef
Python
10,532
341
# --- 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 Font(_BaseLayoutHierarchyType): _parent_path_str = "layout.scene.annotation...
b3fc9c24bfbde9d59bf1fa5fdc64a89b3297ad338624aa9fe4f904ed0ec2c3f4
Python
10,533
247
""" This module contains the _Flamelet2D class that provides a high-level interface for nonpremixed three-stream flamelets. This is unsupported at the moment but it's pretty close to being useful... """ # Spitfire - a Python-C++ library for building tabulated chemistry models and solving differential equations # Copyr...
33de18bc635155c313d872200e954c4b9f0603e22edf460b96cc42c621410e1c
Python
10,537
240
import os import torch import torch.nn as nn import torchvision import json from torchvision.models import resnet50, ResNet50_Weights from torchvision.models.detection import MaskRCNN from torchvision.models.detection.rpn import AnchorGenerator from src.data.Data_alignment import prepare_dataloader from src.utils.utils...
d99abb6b4a3146728fbcea1d01b2de0d309f383b9a7e00bf742356115f7eb675
Python
10,537
318
from typing import List, Literal, Optional, Tuple, Union, cast import numpy as np import polars as pl import pysam import seqpro as sp import zarr from more_itertools import split_when from numcodecs import ( Blosc, VLenBytes, VLenUTF8, blosc, # type: ignore ) from numpy.typing import NDArray from tqd...
afa7d3e91aa62422b6aef0a776c5bba025795187c4babae25cf58a0fdcd5b680
Python
10,539
287
# -*- coding: utf-8 -*- """ Scipy version > 0.18 is needed, due to 'mode' option from scipy.misc.imread function """ import os import glob import h5py import random import matplotlib.pyplot as plt from PIL import Image # for loading images as YCbCr format import scipy.misc import scipy.ndimage import numpy as np im...
1945cb2cfb30527d86f05443e02b1e78a36c26021ed6adb707e8dc1b1a1caa36
Python
10,541
290
#!/usr/bin/env python # ============================================================================= # MODULE DOCSTRING # ============================================================================= """ Utility classes to wrap command line tools. The module provides a class :class:`.CLITool` that provides boilerp...
6f93adba39a10d3af9152ab440a4011e51841bcbf60640984c03b4e95b39d479
Python
10,545
278
#!/usr/bin/env python3 """ File: plot_double_total_ieqtl_barplot.py Created: 2022/07/06 Last Changed: Author: M.Vochteloo Copyright (C) 2020 University Medical Center Groningen. A copy of the BSD 3-Clause "New" or "Revised" License can be found in the LICENSE file in the root directory of this sou...
5b00cf0a1328978886e8bb89035a39f30d6635380ed84ced929890b41533c7cf
Python
10,546
296
# ruff: noqa: F401 import sys from typing import TYPE_CHECKING if TYPE_CHECKING: from ..graph_objs import Waterfall from ..graph_objs import Volume from ..graph_objs import Violin from ..graph_objs import Treemap from ..graph_objs import Table from ..graph_objs import Surface from ..graph_o...
9acc804a4e05b94ec7825981d3c2735446f22eff0513adfa89cd0c58f5fd83d8
Python
10,546
300
""" @author: Olivier Sigaud A merge between two sources: * Adaptation of the MountainCar Environment from the "FAReinforcement" library of Jose Antonio Martin H. (version 1.0), adapted by 'Tom Schaul, tom@idsia.ch' and then modified by Arnaud de Broissia * the gym MountainCar environment itself from http://incomple...
c6cc0543bfe68697539aaaadf7fb812879eda47df9ae25a85cc669b703768a13
Python
10,547
242
""" This module define Model_factory """ # Obliger d'utiliser le sys path append car le structure de chargement de model_ENCODER # doit etre la meme que lors de la sauvegarde dans l'ancien projet import sys import logging import torch from models_architectures.transformer_classif_per_prot import ( TransformerClass...
63b1df41f46346a98bb97fd77f4e54ce7ca5737af4f3c7a9bbf13ff39d6731dd
Python
10,548
287
import streamlit as st import pandas as pd import networkx as nx import plotly.graph_objects as go import altair as alt import duckdb @st.cache_resource def load_data(): """ Defines the database connection to the NOCICEPTRA duckdb database """ try: print("Try to connect to the database") ...
b05a829218098b861297281e9bac4e07040ba30a40200f28f627f0d87a51dbe9
Python
10,549
286
#!/usr/bin/env python """Peak finding for an already-converted XPS NeXus file. Reads the default NXdata group's signal/axes (energy vs. intensity) out of an existing NeXus/HDF5 file, runs ``scipy.signal.find_peaks`` on the intensity, and appends one NXfit/NXpeak group per detected peak carrying the peak's energy (``da...
daa4d600e3a2d32f846a528db6170df18ebb879cb6fd277a3821ccc2ba8c7525
Python
10,550
342
# --- 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 Labelfont(_BaseTraceHierarchyType): _parent_path_str = "contourcarpet.contour...
3760f7d47f74e46c7ab7f6ef365a5fa152941912cef3141ce337ef41a8feb8cd
Python
10,551
231
import os import gymnasium as gym try: import kortex as keras_cortex except: import keras_cortex as kortex import tensorflow as tf from tensorflow.keras.layers import TimeDistributed as TD # from tensorflow_core.python.keras.utils import plot_model from tensorflow.keras.utils import plot_model from angorapy...
16f1a0f07cb68d710b230492db4b56a3892a30669eec6576fd2258f7c463798a
Python
10,553
337
""" Spatial distributions for placing agents and sources. Generates the initial coordinates of a group of agents or sources, either along a circle or rectangle, uniformly within a disc, or on a regular grid. """ from __future__ import annotations from typing import Any, List, Optional, Sequence, Tuple import numpy a...
411a5d143e0b0402fbaa75135f697ffca9b2c2d0bdf994b088f947d47c7de5ba
Python
10,553
273
"""Phase 0 capture-unification schema and emission tests.""" from __future__ import annotations from dataclasses import dataclass from typing import Any import pytest import torch from torch import nn import torchlens as tl import torchlens.postprocess._materialize as materialize_mod from torchlens.ir import Device...
b7b62f81e96f937f2f51ff0a6c3ede3a4eb49c70d96845c092a6b9a82265cebb
Python
10,553
272
from functools import partial from typing import Callable, Optional import torch from torch import Tensor, nn from torch import distributed as torch_dist from lightly.utils import dist def negative_mises_fisher_weights( out0: Tensor, out1: Tensor, sigma: float = 0.5 ) -> Tensor: """Negative Mises-Fisher wei...
f176a7c57aa5f33a018b9633dad3a5bf2370e8f56baf355af597959521ee5abd
Python
10,553
284
"""Django-specific customization.""" import contextlib import os import sys import warnings from datetime import datetime, timezone from importlib import import_module from typing import IO, TYPE_CHECKING, Any, List, Optional, cast from uuid import uuid4 from kombu.utils.imports import symbol_by_name from kombu.utils....
f305413b3f44cd77f73f1f2b608d1f457b8a3fbad34dee2a0e6d591a4d66f887
Python
10,555
268
"""Tests for spiketools.spatial.occupancy""" import numpy as np import pandas as pd from spiketools.spatial.occupancy import * ################################################################################################### ##########################################################################################...
6314dd2479a18a03a61facbf250063ea57409325f7cd2d34ddf5dea0fbdf86ea
Python
10,556
305
import pytest import numpy as np from ripser import ripser from sklearn import datasets from sklearn.metrics.pairwise import pairwise_distances from scipy import sparse import itertools def makeSparseDM(X, thresh): """ Helper function to make a sparse distance matrix """ N = X.shape[0] D = pairwi...
b58bef76b4ed955bb88d1840a15fe6f5f97c8837b495d2535b4b95f24aeaa4ba
Python
10,556
295
# SOURCE: vendored from ZouJiu1/Dorefa_Pact @ fbbab6f7c834fbdad6c55194c0d24bf2a8fcce7e # Files: quantization/dorefa.py (DorefaWeightQuantizer, needed as a pact.py import # dependency) + quantization/pact.py (PactActivationQuantizer, QuantConv2d, QuantLinear, # add_quant_op, prepare) -- the actual PACT (Parameterized Cl...
66380039f54b586de7e73b468d7ed6addee8a1dbf92e1c1fc505a68f6b20b70b
Python
10,557
146
#### Master Script 2c: Compile TIL correlations and statistics of different study sub-samples #### # # Shubhayu Bhattacharyay # University of Cambridge # email address: sb2406@cam.ac.uk # ### Contents: # I. Initialisation # II. Compile and save bootstrapped TIL correlations and statistics # III. Calculate 95% confidenc...
5b3a6244c709b4102e921f79a949ac82f0db99efd59e671c464731fdfceab63d
Python
10,559
398
import importlib.metadata import click import pytest import flask from flask import appcontext_popped from flask.cli import ScriptInfo from flask.globals import _cv_app from flask.json import jsonify from flask.testing import EnvironBuilder from flask.testing import FlaskCliRunner def test_environ_defaults_from_con...
517b493bc4b06b1f6aa67f59c47b8a9dbe78b64b6a92cbd8aa22a53b615bf283
Python
10,560
296
import itertools from typing import Tuple import numpy as np from matplotlib import pyplot as plt from .support_function import * def step2_final_estimation( basic_estimate_img: np.ndarray, noisy_image: np.ndarray, param: tuple, mask: np.ndarray, verbose: bool = False, ) -> np.ndarray: """ ...
c25177a3727bece2732ad284f519d9335876bab6a37554c4070b4d04a1e61fbe
Python
10,560
383
import torch import torch.nn as nn import warnings from torch.autograd import Function from typing import * from torch.cuda.amp import custom_fwd, custom_bwd try: import pointnet2_ops._ext as _ext except ImportError: from torch.utils.cpp_extension import load import glob import os.path as osp impo...
f799a591a82b4df5f1a2a82429250fce26433c28eac021b1226ed3d96002af02
Python
10,563
351
""" Base class for every object in a simulation. Defines the identity, grouping and lifecycle shared by agents, sources and environment objects, and their registration with the simulation model. """ from __future__ import annotations from typing import Any import param from .. import util from ..param import Neste...
5a21e3229f1c0788c3bcf7a0dd72cb369c6406bdb8720597fd471593d9b73e60
Python
10,564
282
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created in November 2018 @author: Nathan de Lara <nathan.delara@polytechnique.org> @author: Quentin Lutz <qlutz@enst.fr> @author: Thomas Bonald <bonald@enst.fr> """ from typing import Union, Optional import numpy as np from scipy import sparse from sknetwork.clusteri...
a1accc54a41cf6f52cee25f28e4259d87ad6397bef9ea97837183bd237e114cf
Python
10,565
357
# coding=utf-8 # Copyright 2025 The Google Research Authors. # # 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 applicab...
49aa36ce5f37f13419755cf51538400bdcf730f2b19b5f0dc721fdca02e99c42
Python
10,568
268
"""Episode full-surface differential oracle + the gap-9 cross-tier token pin. Three independent production paths over the SAME episode are compared on their full public surface: 1. the SESSION product (one wrapped capture, the ruled representation), 2. the FLOOR product (N observer-discipline per-step captures in a B...
c75774623e076ad42c4bdba9e2e3447bf0baa7d033a1901169096fa93a103776
Python
10,569
230
from ipywidgets import widgets, interactive import matplotlib.pyplot as plt import urllib.request, json from model_analysis_folders import all_model_info from ipywidgets import Output, GridspecLayout from IPython import display from IPython.display import Image from IPython.core.display import HTML from scipy.io imp...
98a9e618416ec7609fc5249bfaf17d16c2662bd34239c209db5299216ab1b4d4
Python
10,571
274
""" Author: Derek van Tilborg -- TU/e -- 25-05-2022 Code to compute activity cliffs - ActivityCliffs: Class that takes care of computing activity cliffs - find_fc(): Calculate the fold change - get_fc(): Compute the pairwise fold change ...
ff96a908b868c5b5549cb87f3ddd31fdefc83d1ae3d6a8f793d16b5459e502c2
Python
10,573
275
from paddle.nn.initializer import XavierNormal import paddle.nn as nn import paddle import paddle.nn.functional as F class exchange_bilinear(nn.Layer): def __init__(self,params): super(exchange_bilinear,self).__init__() self.p = params self.output_dim = self.p.fusion_dim self.Hidde...
83181a5b143c4d8e6661e65fa39407d17c0bb2d4af04e1caef233d3bd9c74665
Python
10,574
220
#!/usr/bin/env python """Hybrid policy networks that utilize both visual and unstructured input data.""" import os import gymnasium as gym try: import kortex as keras_cortex except: import keras_cortex as kortex import tensorflow as tf from tensorflow.keras.layers import TimeDistributed as TD # from tensorfl...
d74250cc4bb8e34750c26ce2055c04a147d74d0ec62719f7a7be958ef10f8730
Python
10,574
300
#!/usr/bin/env python3 """ File: create_ieqtl_upsetplot.py Created: 2022/07/05 Last Changed: Author: M.Vochteloo Copyright (C) 2020 University Medical Center Groningen. A copy of the BSD 3-Clause "New" or "Revised" License can be found in the LICENSE file in the root directory of this source tree....
11299ea01c7a5364009e1e408f01a38c6059e4eb1befad78968d53d6f4d0f781
Python
10,575
342
# --- 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 Labelfont(_BaseTraceHierarchyType): _parent_path_str = "histogram2dcontour.co...
a6fdba80b5d97c337441d3cf0548ad2d69b8d1d21c21b9656176a440784742d4
Python
10,575
223
import sys from torch.utils.data import DataLoader, TensorDataset import torch import torch.nn as nn import torch.optim as optim import numpy as np from sklearn.metrics import roc_auc_score, precision_score, recall_score, average_precision_score, confusion_matrix import optuna import build_dataset import splitters from...
7c1af2482baecb097e704d61fc83355cc223b28efecc54f2782f1bc31186aa96
Python
10,576
348
from __future__ import annotations from enum import Enum from typing import Any, Literal, cast import numpy as np from numpy.typing import NDArray from ._utils import DTYPE, SeqType, cast_seqs, check_axes from .alphabets._alphabets import NucleotideAlphabet from .seqpro import _k_shuffle # type: ignore[missing-impo...
be0226f07465174d065b588c2baa8811156a12cfc272a3aae62bce64c885173f
Python
10,578
253
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Sep 24 10:57:59 2021 @author: Audrey Mazancieux This script stimates a general linear model (GLM) at the subject level for all stimuli in the local-global task on several ROIs time series. Other regressors include V4 time serie, movement parameters,...
984055fec8fb36f5070087e31897526612da547a9bdf5bed2b966ea0f31c7b10
Python
10,579
229
"""procrustes.py Implements full affine and optimally constrained affine fitting with the same interface as required by scikit-learn. Copyright (C) 2018-2026 Max Planck Institute for Neurobiology of Behavior This program is free software: you can redistribute it and/or modify it under the terms of the GNU General ...
db2126b7db85158344996b30aaa0e8c84f80cc27274d533ecdb4239ae9e3748a
Python
10,579
254
# 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...
20fe3ae2e47287b7e57fe2c3c1389555f29eac5ec7b5d7f1d777957729ae29ec
Python
10,583
298
"""F08 auto-ladder acceptance: rungs, folds, elision, multi-pass, partition. Summary memo 3.1/3.4 build requirements: the identity partition holds at every depth/fold/elision; the strict fold signature splits on trainability and dtype drift; elision is deterministic, protected, totals-conserving; the multi-pass row mo...
908720c3af6eb3b012f70ca061c497b943d4fe15e4f9ece9478fc5fc07e971ce
Python
10,584
329
import pickle import itertools import os import sys import glob import matplotlib.pyplot as plt import numpy as np from pathlib import Path import matplotlib.pyplot as plt import matplotlib.backends.backend_pdf sys.path.append('../../code/') sys.path.append('../../analysis/') # import utils plt.rcParams['figur...
cbe094ced70f83f6cfa485ea76eedbe23ea1b293c4b227f6171a07bef7ecc667
Python
10,586
304
"""Evaluation code for BDD100K instance segmentation. predictions format: BitMasks """ import copy import json import os from multiprocessing import Pool from typing import Dict, List, Tuple import numpy as np from PIL import Image from scalabel.common.parallel import NPROC from scalabel.common.typing import ( D...
439cefc5e9678f89bb7ffbb776b7fd9161cf49872e20282af79e7e06668cfab7
Python
10,588
322
import numpy as np 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.SimpleRNN, init_kwargs={"units": 3, "dropout": 0.5, "recurrent_dropout": 0.5},...
1e3585bd4e0ff62f5a07bdce698bf727772ead469cc1a7d6910f72e19167aa65
Python
10,590
258
#!/usr/bin/env python3 """ INGEST_TEMPLATE.py — Scaffold for ingesting a new EEG-AD cohort. This is a starting point for adapting the methodology to a cohort not listed in the paper. Fill in the four TODOs below — the rest is generic wiring. The output is a per-subject feature JSON matching ``docs/INGEST_CONTRACT.md``...
d6e8c7fec73c05ae55be4aa77eb55ccde494f913ec5bda18de0352d97066d417
Python
10,591
285
#!/usr/bin/env python3 from DeepRegFinder.traineval_functions import * from sklearn.metrics import precision_recall_fscore_support from DeepRegFinder.nn_models import create_model from sklearn.preprocessing import label_binarize import torch import argparse import torch.nn as nn import numpy as np import pandas as pd f...
977b61989fcf18bc9fec41afdc4572712a7bc74311c67e919ac5aa30c497ba5c
Python
10,592
277
#!/usr/bin/env python3 """ File: compare_tvalues.py Created: 2021/11/19 Last Changed: 2022/02/10 Author: M.Vochteloo Copyright (C) 2020 University Medical Center Groningen. A copy of the BSD 3-Clause "New" or "Revised" License can be found in the LICENSE file in the root directory of this source t...