sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
fade0a6b881f14e21c447161046a599bd2e66e1d3a841d1b46d71cc012501b0a
Python
14,205
271
"""Junction-nucleotide inference (#461): call resolution, determinism, and back-translation.""" from __future__ import annotations import polars as pl import pytest from vdjdb.annotate import junction class FakeModel: """Just the ``genomic`` tables :func:`junction._resolver` reads.""" def __init__(self) ->...
6ae1d7bc072943131efa894504e3921b70cf751efa700433cdf2b483ea03a68f
Python
14,220
345
import matplotlib matplotlib.use('Qt5Agg') import matplotlib.pyplot as plt from PymoNNto.NetworkBehavior.Input.Activator import * from PymoNNto.NetworkCore.Neuron_Group import * import PymoNNto.Exploration.Evolution_Old.NetworkEvaluationFunctions as EvalF class visualization_recorder(Behavior): def __init__(se...
e9489231672b205a8dda75aceecf782b78f93f5d58f4e720faf3e258e043ec97
Python
14,227
366
from __future__ import annotations import math import torch import torch.nn.functional as F from e3nn import o3 from e3nn.nn._fc import _Layer as E3NNFCLayer from torch import nn def build_lora_irreps( irreps_in: o3.Irreps, irreps_out: o3.Irreps, rank: int ) -> o3.Irreps: """ Choose an equivariant bottl...
0f3498307102dae215935dca049e3a02dda6ab630951305c153fbf273c620680
Python
14,229
271
"""Structure association preserves context; optional domain proof checks complete sequences.""" from __future__ import annotations import io import tarfile import polars as pl import pytest from vdjdb.assemble.evidence import structures ALPHA = ('GQNIDQPTEMTATEGAIVQINCTYQTSGFNGLFWYQQHAGEAPTFLSYNVLDGLEEKGRFSSFLSRSKG...
382d988cb5ab289180da14c3c849b3bf694ebb8c959e2a8ee071d95e8699c4df
Python
14,236
506
""" Generate 2D feature matrix using SMILES Author: Son Gyo Jung Email: sgj13@cam.ac.uk """ import numpy as np import pandas as pd import re import joblib import pickle import os from rdkit import Chem from rdkit.Chem import rdchem from rdkit.Chem import AllChem from deepchem.feat.smiles_tokenizer import BasicSmile...
991dad4fd426fa01f7289ff86584e29b6026e7e722f2cc1f7bcb309b1340a4b1
Python
14,236
231
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'mainwindow.ui' # # Created by: PyQt5 UI code generator 5.12.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): def setupUi(self, MainWindow): Main...
24052c107d2bac4083b2ec8b2ac9fe3356a8c91a348a861189e9aab880141c9d
Python
14,239
466
import argparse import gcsfs import nobrainer import os import os.path as op import tensorflow as tf def build_multi_input_model( width=128, height=128, depth=128, n_image_channels=3, n_qc_metrics=31, neglect_qc=False, ): """Build a multi-input model that concatenates a 3D convolutional ne...
d9df387a2518d51643dc5c11cd646bc8dddf6a18f7aae7709164585818362b27
Python
14,246
358
# Copyright 2020-2025 Intel Corporation # SPDX-License-Identifier: Apache-2.0 """DirectorGRPCServer module.""" import asyncio import logging import uuid from pathlib import Path from typing import AsyncIterator, Optional, Union import grpc from grpc import aio, ssl_server_credentials from openfl.experimental.workfl...
68f894a6b308169f1c48419c563729cf6a53159e462ceffa96dff003268e44aa
Python
14,255
495
import os.path import pandas as pd from uniprotparser.betaparser import UniprotSequence import base64 from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.asymmetric import rsa from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes from cryptography...
789fb3290c3aa86afd7dabe22ed37835586a090bf25ce105ede06984aa164ec3
Python
14,257
366
import torch from torch import nn from torch.autograd import Variable from torch.utils.data import DataLoader, Dataset import os from DeepPurpose import utils, dataset from datetime import datetime import copy import wandb from DeepPurpose.utils import * class EarlyStopping: '''Early stops the training if validat...
9c4488a69b39ee6b2b21c5792d1f94c40e83c9bde2ef44f427045f901fb2c25a
Python
14,265
443
from __future__ import print_function import copy import pprint import torch import numpy as np import matplotlib.pyplot as plt import utils import analysis_utils from dataset_learning_trainable import DatasetLearningTrainable import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from to...
58d23a24fedb0a4211df6202e8f32d944c985e5f83150bde7d4c656df6746fbc
Python
14,291
389
# 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 appli...
3577aff1c2a0f2c96173f808444bcfb480b510657b350e59ba83487b7b8aa8c1
Python
14,303
439
# ============================================================================== # Copyright 2025 Technical University of Denmark # Author: Nikolas Borrel-Jensen # # All Rights Reserved. # # Licensed under the MIT License. # ============================================================================== """End-to-end in...
6ace2d97ace7ed0ee3cc12068a54c6f08702240beefa1216f58828c59b59baa7
Python
14,310
365
import torch import torch.nn as nn import torchvision from torch.hub import load_state_dict_from_url __all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101', 'resnet152', 'resnext50_32x4d', 'resnext101_32x8d', 'wide_resnet50_2', 'wide_resnet101_2'] model_urls = { 'resnet18': '...
6532b65a69d42a77ef3c7de60291bd71375280dc32c66b0355550aadf1a4c03e
Python
14,321
401
""" Test backend abstraction for CPU/GPU operations. Part of functional core - tests pure backend selection and device management. Following model-spec.md Phase 1 implementation. """ import numpy as np import pytest # ============================================================================ # Helper Functions # ...
7a4ccb6d5ccc69b02b989d6d49e44224f1fb284b9ab1bd5b5d05ddc7934492b8
Python
14,328
326
"""Reported observations survive predictions, flank comparisons and missing coverage.""" from __future__ import annotations import hashlib import os import polars as pl import pytest from vdjdb.assemble import assessment as A from vdjdb.schema import EPITOPE_ASSESSMENT_COLUMNS def records() -> pl.DataFrame: re...
626aa490f67a46c8f28c31cc6eb39934b839d2fde4afa692f0c05f1ac3f19098
Python
14,329
381
import numpy as np import networkx as nx import matplotlib.pyplot as plt import igraph as ig # may have to pip install import itertools from tqdm import tqdm def type_mat_rearrange(input_mat): typee = type(input_mat[0,0]) rearranged = np.zeros(input_mat.shape).astype(typee) if input_mat.shape[0]==4: ...
b60e2660eb6d53b7065aa8a3a60415cb6b70b0de983197a9adcac1e0b009b1cd
Python
14,329
371
from multiprocessing.connection import Connection import os import shutil import tempfile from typing import Generator, List, Tuple, Dict, Any, Callable, Type from hypothesis import given, settings import hypothesis.strategies as st import pytest import json from urllib import request from chromadb import config from c...
ead3410ae50367b2c21f53f02275f05e2e2ab6cbad6ca8bd7f465a788ca378c7
Python
14,340
378
from __future__ import absolute_import import os import pandas as pd import numpy as np from scipy import stats from pysurvival import utils from pysurvival.models import BaseModel from pysurvival.models._non_parametric import _KaplanMeierModel from pysurvival.models._non_parametric import _KernelModel class NonParam...
39a5d3756d5f8895fc504b2d1890ab2dd959c4d847c9b11b52b541011e41aff6
Python
14,360
275
"""Is the rewritten motif stage equivalent to or better than the one that shipped? Marked ``release``: needs ``VDJDB_REFERENCE_ZIP``, built tables (``VDJDB_TABLES``, default ``out/tables``) and built motif files (``VDJDB_MOTIFS``, default ``out/motifs``). The motif stage is the one place where byte reproduction is ne...
f76dac384c7f5c26ab8537dcc94e45161487f5a60462f58bfd3c7fb218e6ccd0
Python
14,366
374
# 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 appli...
bad43c703adb85aebcc122bdd818b5da5a374e5789233781ef32c6230574f0d6
Python
14,367
251
"""The evidence table: one row per piece of support for a record. Long, not wide. A record may have any number of pieces of evidence of any number of kinds -- a motif cluster per method, a structure per PDB entry, a supporting publication per replication -- and the wide form would be a table of mostly-empty boolean co...
3dbf5c174173e43d0f09b133c7325278e02fd0becc9562f6a32b1c97323f5c33
Python
14,371
242
""" Parameter continuation and bifurcation detection ================================================ In this tutorial, you will learn how to perform a 1D `numerical parameter continuation <http://www.scholarpedia.org/article/Numerical_analysis#Numerical_solution_of_ differential_and_integral_equations>`_ in PyRates w...
c2e8eb66f67a1dcbe5be1b1c27f73257b1edb15e0c82aa68c36979a1396b2e20
Python
14,373
386
import time import torch from pymonntorch.NetworkCore.Base import * from pymonntorch.NetworkCore.Behavior import Behavior from pymonntorch.NetworkCore.SynapseGroup import * class Network(NetworkObject): """This is the class to construct a neural network. This is the placeholder of all neural network compon...
6202d566a7d553e708ddef01f1fbfc751a557a241a3ca1d77f4d0d7834b8cff3
Python
14,377
242
""" Parameter continuation and bifurcation detection ================================================ In this tutorial, you will learn how to perform a 1D `numerical parameter continuation <http://www.scholarpedia.org/article/Numerical_analysis#Numerical_solution_of_ differential_and_integral_equations>`_ in PyRates w...
3654189bc7878fe18c4079f43a6782ba95af4e1bafbb4c1145e201a9cda31367
Python
14,378
317
''' Module focused on the reduction of the ANN and implementation of the training and testing phases. ''' import torch import torch.nn as nn import numpy as np from smithers.ml.models.rednet import RedNet from smithers.ml.models.fnn import FNN, training_fnn from smithers.ml.utils_rednet import PossibleCutIdx, spatial...
a43e82eb3a8bead0ddb9ae2374d7c384e1f1c039c54d6fd8a7d153d1516dd914
Python
14,385
372
import torch import itertools import copy import numpy as np def get_peak(x, eps=1.E-3, randomize=False): # x_in is shape BxXxY d = x.shape[-1] peak = torch.zeros((x.shape[0], 2), device=x.device, dtype=torch.long) for b in range(x.shape[0]): m = x[b].argmax() initial_peak = [int(m /...
f39cd2d0ba08fe66e24cf1cdea54189d802555cc5720d0046e95f71b242f31f5
Python
14,386
435
# %% """ #### ## ## ######## ####### ######## ######## ###### ## ### ### ## ## ## ## ## ## ## ## ## ## #### #### ## ## ## ## ## ## ## ## ## ## ### ## ######## ## ## ######## ## ###### ## ## ## ## ## ## ## ## ...
590d604c27bc26a130c1ee610e754c7960f806ae22b4d4b477abbb10bce6ae86
Python
14,391
293
import os import sys import json import re import pandas as pd from tqdm import tqdm from soma import aims p = os.path.abspath('../') if p not in sys.path: sys.path.append(p) q = os.path.abspath('../../') if q not in sys.path: sys.path.append(q) from vae import * from preprocess import SkeletonDataset import...
5e9a16c3a34847432f81fc9831e57197d3b5d1973841bc212339fd573ed4ccef
Python
14,422
540
#!/opt/conda/bin/python import argparse import dask.dataframe as dd import matplotlib.pyplot as plt import nibabel as nib import numpy as np import os import os.path as op import pandas as pd import plotly.graph_objects as go import seaborn as sns import warnings from glob import glob from plot_formatting import set_...
189e8d605c31d49b8bfe7a97df2a4e8d3ba507f9f652beea7e21873fb454a272
Python
14,430
399
# regression_test.py - Testing JAGS fits of HDDM models with participant-level regressors in JAGS using pyjags in Python 3 # # Copyright (C) 2020 Michael D. Nunez, <m.d.nunez@uva.nl> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publis...
569ec02c11eecdaf3c6500a52f8719353709796f36e2c3243b770960d4863d9f
Python
14,430
399
"""Read and write DesignMatrix objects. Loads BIDS events and tabular confound files into the frame a `DesignMatrix` wraps, exports NumPy arrays, and round-trips through TSV/CSV or HDF5 (which also preserves the metadata). A private pandas adapter serves nilearn. """ from __future__ import annotations from pathlib i...
dbd4a87a4c707619f1b66f699ced4973caa523f5163101b80870c98c46d78b84
Python
14,436
411
"""`mace_finetuning_select` through its command line. `tests/workflows/test_finetuning_select.py` builds `SelectionSettings` in-process, which covers the selection logic and leaves the CLI itself unexercised: nothing passed `--model`, `--output`, `--device`, `--default_dtype`, `--seed` or the YAML `--config`, so a fla...
3d166a2c4f8ef449f78b3b092b39376ba6d710725da03323ff574dc842ee238d
Python
14,452
368
# 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 appli...
85c16de5f37472aff6fee677c1deb2158a269932537e943a983e01f64dcc8407
Python
14,454
425
import os import numpy as np import collections import torch import torch.nn as nn import torch.nn.functional as F from skimage.transform import rescale from functools import reduce import subprocess from torch.nn.parameter import Parameter from cloudvolume import CloudVolume import torch from torch.nn.functional impo...
5963738fb791859c9d2bdd792f7ed5d5369df460be1ffda95f258085a34fda57
Python
14,456
382
import torch import torch.nn as nn import torch.nn.functional as F from .mol_tree import MolTree, MolTreeNode from .chemutils import enum_assemble, set_atommap from .nnutils import create_var, GRU MAX_NB = 15 MAX_DECODE_LEN = 100 class JTNNDecoder(nn.Module): def __init__(self, vocab, hidden_size, latent_size, ...
9aad3fa87937cbdbcdd071857ae662bdae043eb2e46c1f3fc85d91071aa6e532
Python
14,470
487
import random import numpy as np import pytest import scipy import geomstats.backend as gs from geomstats.test.test_case import TestCase from geomstats.test.vectorization import generate_vectorization_data # TODO: use new strategy for vectorization tests def _convert_gs_to_np(value): if gs.is_array(value): ...
33d5e0b31327255d79365e6a851655381029b2b8674af076e44951cf3d9e9113
Python
14,472
310
"""PubMed records and abstracts: one client, one tokeniser, two committed inputs. The corpus needs a title and an abstract per reference, and the text is an input to the build rather than an output of it (hard rule 5). So this module fetches the records, tokenises them, and writes two files that are **committed, revie...
e45e47a335279b54bcc79ee18eeef9bf9e6df2fa64c3c19e8de3bcc30cf0edad
Python
14,481
356
from __future__ import absolute_import from __future__ import division from __future__ import print_function from pprint import pprint import tensorflow as tf from tensorflow.python.ops import array_ops from tensorflow.python.ops import math_ops import tensorflow_probability as tfp from sleeprnn.common import check...
181078609bd94e06437f0525b22efa4259135b5f47c2696881b34e884c6cc30e
Python
14,495
371
import json import logging import pickle import sqlite3 from threading import Lock from typing import Dict, Optional import numpy as np from openfl.utilities import TensorKey logger = logging.getLogger(__name__) __all__ = ["PersistentTensorDB"] class PersistentTensorDB: """ The PersistentTensorDB class im...
45795e773c460fd937944f6d1dc17a16c47ebcd6a0960a6e82a3b7daf6510aab
Python
14,497
388
""" eeg_preproc.py Author ------ Daniel Schonhaut Computational Memory Lab University of Pennsylvania daniel.schonhaut@gmail.com Description ----------- Functions for reading and processing time domain EEG. Last Edited ----------- 1/26/22 """ import sys import os import os.path as op from collections import Ordere...
96ed7ae5779d3c591b6e2fb66097fc47053b9069d491068060de511fa9ec0068
Python
14,500
390
# # This module contains functions of autoencoder to apply regression on # the EFI measurements. # from __future__ import absolute_import, division from __future__ import print_function, unicode_literals import numpy as np import tensorflow as tf K = tf.keras.backend # For a simple tutorial/example, see e.g. # https...
3b69420a0974430e2506ba0307e3a5e4065710c77fb1ab5a0eb23f5956da5c97
Python
14,502
346
# 2026-10-16 # Reprocess deposited ITRAP count tables with the dCODE chain-graph caller. # The model specification is unchanged; each donor is fitted afresh. These loaders only # reshape deposited GEM or 10x matrices into the frames that caller expects. # ITRAP1 raw.csv has no empty droplets and no negative-control dex...
db89623a0338898a1dca722c424155cc2b410a7b498eb964cf2a25d894c4e080
Python
14,503
345
# This file is a part of the `nequip` package. Please see LICENSE and README at the root for information on using it. import torch from torchmetrics import Metric from . import AtomicDataDict from .modifier import BaseModifier, PerAtomModifier, NumNeighbors from .stats import Mean, RootMeanSquare, StandardDeviation fr...
84ac9992934be32fdacc877556a09fec36d6c1dba84be8acb244eea3b8b3ec52
Python
14,513
390
# This file is a part of the `nequip` package. Please see LICENSE and README at the root for information on using it. from dataclasses import dataclass from typing import Any, Callable, Dict, Final, List, Optional, Union, Tuple import numpy as np import packaging.version import torch from . import AtomicDataDict imp...
d596ad956239a8e936fe4c2da4f4203fe31932b06e32f4cce6ab40e167137799
Python
14,527
308
from PymoNNto.Exploration.Network_UI.TabBase import * from PymoNNto.NetworkBehavior.Recorder.Recorder import * #from Testing.Common.Grammar_Helper import * class sidebar_module_quick_access(TabBase): def __init__(self, module_label='my_module', module_tag='module_tag'): self.module_label = module_label ...
0da3207203a334b31d0cfc1796fe896f9deee398becba20927a415618b06c3f1
Python
14,529
356
import torch.optim as optim import torch import torch.nn as nn import torch.nn.functional as f import torchvision.transforms as transforms import torchvision as tv import torch.utils.data as data import os import matplotlib.pyplot as plt import random from torch.utils.data import Dataset, DataLoader import time import ...
1992441ad89c6a8f9c2f22da1b90d655affd2a279dd32d8aa64c11edfe31b7ba
Python
14,532
366
import numpy as np import tensorflow as tf from tensorflow.keras.layers import Input, LeakyReLU, Concatenate, Activation, BatchNormalization, Bidirectional, LSTM, Dense, Dropout, Conv1D, MaxPooling1D, Flatten, Embedding from tensorflow.keras.callbacks import EarlyStopping from tensorflow.keras import Model from sklearn...
41dae5985a1085157108f53a19ab310b94ff91f32a35ecc2ab961788a0306e63
Python
14,555
345
# This file is a part of the `nequip` package. Please see LICENSE and README at the root for information on using it. import os import torch from nequip.data import AtomicDataDict from .graph_model import GraphModel from ._graph_mixin import GraphModuleMixin from nequip.utils.dtype import ( test_model_output_simil...
04683b8358cfa12f210668ff5aa4b613281db5dc36a47a827d68eb198c6dd8a9
Python
14,583
403
# Copyright (c) 2018 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...
0f6330958f3d58ee9bdc2cfb59ea990988519f6a1926a6741dfbf4b0d1125426
Python
14,596
363
# -*- coding: utf-8 -*- """ Created on Fri Jul 10 16:58:54 2020 @author: Tom """ from tensorflow import keras as k import pandas as pd import numpy as np import preprocess_crop #courtesy of Rustam Aliyev import matplotlib.pyplot as plt from image_data_generator_pat import ImageDataGeneratorPat from negative_log_likel...
1a2f6535dfc17a027b979c451f3386954b6341b678fe1706839690e96b0bb1d5
Python
14,602
398
import matplotlib matplotlib.use("Agg") import pytest import nibabel as nib from nltools.data.simulator import Simulator, SimulateGrid import numpy as np def _small_mask(): """A tiny all-ones brain mask for fast Simulator smoke tests.""" return nib.Nifti1Image(np.ones((12, 12, 12), dtype=np.float32), affine...
7770821c33ead1e95f4ec45879fbc4c92b60abb7f509140244181979d2bc584c
Python
14,604
374
from PymoNNto.Exploration.Network_UI.Network_UI import * from PymoNNto.Exploration.Network_UI.TabBase import * class UI_sidebar_network_selector(): def __init__(self, add_color_dict={'output': (255, 255, 255)}): if type(add_color_dict) is str: add_color_dict={add_color_dict:(255,255,255)} ...
12c02f02bcffbb30c3582e3fc9a73ad336e051022d2e1cb11a8cca455983494f
Python
14,616
423
""" Motor imagery testing. After setting experimental parameters, it runs a trial with feedback by calling the classify() method of a Feedback class object. Trials are repeated until the set number of trials are achieved. Kyuhwa Lee, 2015 Swiss Federal Institute of Technology (EPFL) This program is free software: ...
772456f1fbd3f0e9f54fcf40b9a42247b6615d7c6ceb506c0b116cedc39d04b5
Python
14,622
361
import math import numpy as np import torch import torch_geometric from torch_cluster import radius_graph from torch_scatter import scatter from utils import get_iso_permuted_dataset from utils import get_scalar_density_comparisons from utils import get_iso_permuted_dataset_lpop_scale from e3nn.nn.models.gate_points_21...
ba97e273da5c83c978343d26e7822e2aec32f622cfd430d7ce1bebd46b04ce3d
Python
14,631
367
import torch.utils.data as data import torchvision.transforms as transforms from PIL import Image import os import os.path import numpy as np try: import accimage except ImportError: accimage = None import pdb from mapcrop import MapCrop from augmentation import RandAugment IMG_EXTENSIONS = ['.jpg', '.jpeg', '...
0a2c077711702728e7c246d657c4ccdd6d4f55ae361a5fbbd5348be2a8abb14e
Python
14,634
359
# Copyright 2020-2023 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import os import yaml import logging import tests.end_to_end.utils.defaults as defaults import tests.end_to_end.utils.exceptions as ex import tests.end_to_end.utils.helper as helper import tests.end_to_end.utils.ssh_helper as ssh log = log...
3fc5a6d5ae6c5fd67fd08760b529486324ad64b3cb712e4b067699bae4f9d088
Python
14,636
464
import copy import torch from tqdm import tqdm from corgie import constants, exceptions from corgie.log import logger as corgie_logger from corgie.boundingcube import BoundingCube from corgie.layers.base import register_layer_type, BaseLayerType from corgie import helpers def get_extra_interpolate_parameters(): ...
119258b1ae55490b1abd9d619ddce59497d4ac38b291d30b5d10a9b1b7453360
Python
14,640
382
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Mar 14 12:18:38 2023 @author: egemo """ from .core import core from .group import synapsegroup,neurongroup from .component_utils import (LS_time_dep, LIF_time_dep, quick_activator, ...
224036424283c7acc46875f956c106f3af1377fc7f9db18b36235149691c04dc
Python
14,640
395
"""Plotting functions for Adjacency matrices.""" import numpy as np def _divergent_heatmap_defaults(square): """Heatmap keywords that anchor a signed matrix at zero, or none if one-signed. Seaborn picks a sequential ramp and data-range limits whenever `center` is unset, which leaves a matrix straddling ...
d252542b29ad1b5b326f7bda1549d18695e9618d164822086e0d34a231a49b01
Python
14,680
490
from sleepy.gui.exceptions import UserCancel, NoNavigatorError, NavigatorEmptyError from sleepy.gui.tagging.control.channels import MultiChannelControl, visualize from PyQt5.QtWidgets import QMessageBox import pdb class TaggingControl(MultiChannelControl): def __init__(self, parent, settings): ...
25a5e595ed37459c1ca95c444d8b2300a081621e709d044a36609f8234e2be3c
Python
14,689
393
################################################################################ # Import, Set up MPI Variables, Load Necessary Files ################################################################################ import os from os.path import join import sys import matplotlib import matplotlib.pyplot as plt from matp...
95d710a62653b06b4073386d9af888fe99d1c6cca535a3959acf8011ba53f283
Python
14,694
457
from __future__ import absolute_import import numpy as np import tensorflow as tf import tensorflow.keras.backend as K def _crps_tf(y_true, y_pred, factor=0.05): ''' core of (pseudo) CRPS loss. y_true: two-dimensional arrays y_pred: two-dimensional arrays factor: importanc...
1a6ca274d15efe3de2e96b72bd3dfb9c44e19bdc63fac01c4bf5bb7ba2ff19f5
Python
14,695
469
from typing import Dict, Optional, Union __version__ = "1.6.0" import logging from chromadb.api.client import Client as ClientCreator from chromadb.api.client import ( AdminClient as AdminClientCreator, ) from chromadb.api.async_client import AsyncClient as AsyncClientCreator from chromadb.auth.token_authn import...
01149770818855f7c86c4c7c16e386563758f10be75fa1e5b0f347565389d768
Python
14,700
460
import click from corgie import exceptions, stack, helpers, scheduling, argparsers import json from corgie.log import logger as corgie_logger from corgie.boundingcube import get_bcube_from_coords from corgie.argparsers import ( LAYER_HELP_STR, create_layer_from_dict, corgie_optgroup, corgie_option, ...
5d0a0bfcb044cebc2d63e38049bf31f4f83737d2108dfd2802daae88c07a1dc1
Python
14,703
406
""" PyQt5 Canvas for Neurodecode's StreamViewer. """ import math import numpy as np import pyqtgraph as pg from PyQt5 import QtCore # pg.setConfigOptions(antialias=True) class _BackendPyQt5: """ The PyQt5 backend for neurodecode's StreamViewer. Parameters ---------- scope : neurodecode.stream_v...
b56776d09b8dc9236d56bf0929e5af4d5e3bba52699b51fa9510570bee35881c
Python
14,703
371
# 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 appli...
060f388cdb19811f434d428f6fe456d1e02083324d0305e88558711fdfae44d6
Python
14,708
360
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import matplotlib.animation as animation # Parameters # ----------------------------------------------------------------------------- dt = 0.1e-3 T = 3. # duration, seconds tv = np...
3315c5e059cc934692f2cb6aae2c64021d38d6e58a85e61f0c5a964168e2a081
Python
14,710
418
from PymoNNto.Exploration.Network_UI.TabBase import * from PymoNNto.Exploration.StorageManager.StorageManager import * from PymoNNto.Exploration.Evolution.TxtHighlighter import * from PyQt5 import QtCore from PyQt5.QtGui import * from PyQt5.QtWidgets import * import pyqtgraph as pg import numpy as np from distutils.dir...
72eb0bc2c53424bb5604aa0ed2aa285bd08819dfa70f519ca2ce249703ee0cf6
Python
14,710
370
# 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 appli...
0c3a5f57e828d6bc9a1d00b9d7652672fe1b1aea5bef4c1c37703a31c0ae73b3
Python
14,738
417
import jax import re import jax.numpy as jnp import numpy as np from scipy.special import kl_div from pathlib import Path import os import ast import logging from pathlib import Path from typing import Any, Dict from pandas import DataFrame import random import time import sys from colorama import init, Fore, Back, Sty...
f77b87f9a8cd3559144f6482160cfe5c4eb6bb7eb580e43841555bf5295706e3
Python
14,742
387
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from scipy.signal import firwin import tensorflow as tf from sleeprnn.common import constants def apply_fir_filter_tf_batch(signals, kernel): """For batch of signals""" signals = s...
67132cfa73dae1ee5584de08265d3966f5c189b21779b3ffa1d5b55f4f7030cd
Python
14,752
529
#!/opt/conda/bin/python import argparse import dask.dataframe as dd import json import matplotlib as mpl import matplotlib.gridspec as gridspec import matplotlib.pyplot as plt import numpy as np import os.path as op import pandas as pd import s3fs import seaborn as sns from afqinsight.datasets import AFQDataset from ...
adcea0dd3734b10e4c96ab0265fddca23fb67ca9167103fd1851d21a74e15600
Python
14,753
376
# 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 appli...
2d731c3777f34ed41e080c0bd534ec47582c74946dd103b17d23185db5c4454b
Python
14,762
290
import numpy as np from scipy import sparse from sklearn.metrics import pairwise_distances from suns.PostProcessing.par3 import fastCOMdistance def segs_results(segs: list): '''Pull segmented masks and their properties together from a list of segmentation results from each frame. The outputs are the segm...
14c2992fb2771ee4beca2eecfe19e29445e04bb62abd96cce0d4862a3bd53ae4
Python
14,776
538
#!/usr/bin/env python # encoding: utf8 """ Collaborative Brain Wave Analysis Pipeline (Cobrawap) """ import argparse import inspect import logging import os import re import shutil import subprocess import sys from pathlib import Path from pprint import pformat sys.path.append(str(Path(inspect.getfile(lambda: None))....
81b614f47aeffd01c78186ebfeaad6097ce1fc73511d26d7ea3cf623a3bf38fd
Python
14,793
349
import numpy as np import cv2 import os import sys import glob from ppdet.utils.logger import setup_logger import copy logger = setup_logger('ppdet_cam') import paddle from ppdet.engine import Trainer def get_test_images(infer_dir, infer_img): """ Get image path list in TEST mode """ assert infer_img...
76b395927507919bbec83a7a553c927a721da5f03a252b8907fd13675ca42e0b
Python
14,797
449
# -*- coding: utf-8 -*- import matplotlib #matplotlib.use('Agg') import matplotlib.pyplot as plt plt.rcParams.update({'font.size': 18}) import numpy as np import logging import argparse import os import torch import h5py import sys sys.path.insert(0, os.path.join(os.getcwd(), 'src/models')) from layers import Ne...
97c67ed9d9253a7a2253a8fa6a20efb4b0a68f84e6dfcb1d7440b655fccb07c4
Python
14,798
352
# 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 appli...
c429d9581f7c9d385ad4f73ce1584cd8111010d326de1c2357c9d92fc61f16c1
Python
14,804
352
# Jun 3rd, 2020. Extracted from # https://www.tensorflow.org/addons/api_docs/python/tfa/optimizers/AdamW # Copyright 2019 The TensorFlow 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...
d31d93196b231f7015f39e6b89958a7b3572c3df0595d44ed779e89448b7589f
Python
14,813
396
# 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 appli...
c9464391d0e9ff59de8934c6b31032af89fb7f1ab6c81cc277a256ea31ef9502
Python
14,816
409
"""idmatcher.ai matches identities from two different tracked sessions, see :ref:`idmatcher.ai`.""" import json import logging from argparse import ArgumentParser from pathlib import Path import matplotlib.pyplot as plt import numpy as np from scipy.optimize import linear_sum_assignment from idtrackerai import ListO...
0c34afb45f592c0c276359b7145bd52ed6d203b321c05d07da73f3832bf8450a
Python
14,828
343
# This file is a part of the `nequip` package. Please see LICENSE and README at the root for information on using it. import torch import lightning from lightning.pytorch.utilities.warnings import PossibleUserWarning from hydra.utils import instantiate from hydra.utils import get_method, get_class from nequip.data impo...
8e3ea2fd8ed952b484c87a49105b2d0bca2b07045ef027569cb60c074e5f37b4
Python
14,831
438
import experiment as exp from experiment import session_state from video_system import image_sources, capture_images import arena import schedule import video_system import cv2 as cv import numpy as np import time import datetime import bbox import random from image_observers.yolo_bbox_detector import BBoxDataCollector...
ef3862c766d8c8757f9aa0e4088a1d416f101743bb050dfef4294fbaa2d064c5
Python
14,852
431
# Authors: George Dang <george_dang@brown.edu> # Rajat Partani <rajatpartani@gmail.com> import json from copy import deepcopy from pathlib import Path from time import sleep from urllib.request import urlretrieve import numpy as np import pytest import hnn_core from hnn_core import ( simulate_dipole, ...
81c5bb4af26009630144e86cc478b6b0ca1448dd62d09b5ae127f5d5c4ad2447
Python
14,853
381
# 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 appli...
2f6ff58a20a2f1797b7e9b1b08fedcb2433d62ba904f08fdfe065c2b8a8a4ab8
Python
14,854
406
import logging import pickle from collections.abc import Iterable, Iterator, Sequence from io import BytesIO from itertools import chain, pairwise, product from multiprocessing import Pool from pathlib import Path import h5py import numpy as np from . import Blob from .utils import ( LOGGING_QUEUE, Episode, ...
5251d379599ab8cc205a8bd195979c29ccd0464ac1d03ad7e0f080b75d605fb2
Python
14,882
323
# -*- coding: utf-8 -*- import unittest from functools import partial try: import torch except ImportError: TORCH_AVAILABLE = False else: TORCH_AVAILABLE = True from dival.util.torch_utility import ( RandomAccessTorchDataset, GeneratorTorchDataset, load_state_dict_convert_data_parallel, ...
57ab3147318a5d192ab2702cacf735519499fb73ebc7d1bdc0da376da1e53064
Python
14,885
439
"""Estimators wrapped around R-functions. """ import warnings import itertools import numbers import numpy as np from scipy.stats import pearsonr from sklearn.base import BaseEstimator from sklearn.utils import check_array, check_consistent_length from sklearn.model_selection import check_cv from sklearn.utils.valida...
f36481659d21d7a3ab647aa82eff1068b36d9f22e2a46e89291293e3c4e81b03
Python
14,891
384
import numpy as np import os import pickle from glob import glob import torch import torchvision from torch.utils.data import Dataset, DataLoader import torchvision.transforms as T import torchvision.transforms.functional as F import torchvision.datasets as ds import PIL from PIL import Image, ImageFont, ImageDraw, Ima...
c5332d7772f4cabaee467430118613145ea501cdea55fbdbb973ec2f77932490
Python
14,894
403
""" Notes: - Something to be aware of when grouping tests inside classes is that each test has a unique instance of the class. Having each test share the same class instance would be very detrimental to test isolation and would promote poor test practices. todo: - carefully test TS truncate """ import time i...
ac9d945e7105af6c8e2398461d16936adbe862612e4931114bb79b8ff4d9f3ef
Python
14,896
383
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import math from typing import Any, Dict, List, Optional import torch import torch.nn as nn from fairseq import utils from fairseq.distribut...
7a02ec237405bf45216be24641d347be7c867a5f6b5d29eaf53ae7ea1867f140
Python
14,927
461
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import time import numpy as np import pandas as pd from sleeprnn.common import constants from sleeprnn.data import utils from sleeprnn.data import stamp_correction from sleeprnn.data.dataset import ...
3113189c86227684e9d8b393a9398e6147969ce337cac184746d79e2c60881d2
Python
14,942
359
"""The published foundation checkpoints this suite pins, and how it reaches them. A golden for a foundation model is only worth something if the file it was taken from is the file the test loads. Everything here exists to make that identity checkable rather than assumed: * the **loader call** is data, not prose. ``lo...
b6530a31c69852cd6fb8395942dc8633c02412bd1c3445e8d42fbef508e1ecdb
Python
14,947
381
# Copyright (c) 2020 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 appli...
1fd999cbb30883d44711c41be04496266da0734f13a88033611249a327bb776c
Python
14,953
363
"""Did the vendor kernel actually run? A backend golden compares numbers, and numbers alone cannot tell an accelerated kernel from the plain e3nn path that produced the reference in the first place -- the two are *supposed* to agree. So a value-only assertion is green in exactly the case the golden exists to catch: th...
2ccf000782204fa155ecbce1d022c8a90f424926b1bcf9497d1c153bcd382925
Python
14,967
369
# 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 # # Un...
3e03a954a4e889091a4dac3d1e4d1a64e55115dec9aa4351dde5ac5757f5e6db
Python
14,969
250
"""Compact confidence features from completed VDJdb build tables. Use the shipped legacy score, publication/donor totals, motif membership and mean ipTM. No chunk reconstruction, assay taxonomy, experiment tracing or allele-specific model. """ from __future__ import annotations import math import polars as pl from ...
90ad008fefadf196cb5a35860a885734c160178fe655e2c39908b7d6b12a42b8
Python
14,977
309
#!/usr/bin/env python3 __author__ = 'Frederic Escudie' __edit__ = 'David Baux' __edit__ = 'Charles Van Goethem' __copyright__ = 'Copyright (C) 2019 IUCT-O' __license__ = 'GNU General Public License' __version__ = '1.1.3a' __email__ = 'escudie.frederic@iuct-oncopole.fr' __status__ = 'prod' import os import sys import ...
119b46c491a5362c4e48739f6eb2991153934441fbe5f01a75ee13412132e261
Python
14,985
449
"""The n-dimensional hyperbolic space. The n-dimensional hyperbolic space with Poincare ball model. Lead author: Hadi Zaatiti. """ import math import geomstats.algebra_utils as utils import geomstats.backend as gs from geomstats.geometry._hyperbolic import _Hyperbolic from geomstats.geometry.base import VectorSpace...