sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
67e89db3cc019b7bf9f9b78997468b569e79c5ae8f7c0abea361a389c7e0ec35
Python
21,470
497
# -*- coding: utf-8 -*- import numpy as np from sklearn.decomposition import PCA from sklearn.manifold import Isomap from sklearn.manifold import SpectralEmbedding import functions.time_functions as tf import copy from scipy.linalg import svd import functions.prediction from scipy import stats from typin...
189516d399d83527920e202bc0153f44c8f46d23b1053fa5794028c433620fd6
Python
21,471
627
import os import numpy as np from seriate import seriate import gzip from scipy.spatial.distance import pdist from calc_stats_ms import N_ton, distance_vector, min_dist_ref, s_star_ind, num_private, label from seriate import seriate from scipy.spatial.distance import pdist, cdist from scipy.optimize import linear_su...
31fc7fc8f0f958bda0184895b6f077493ffc5cca006d37b9c2c0b3398554152d
Python
21,481
593
"""Functions and classes for data preprocessing Provides functions to turn multiple alignments from fasta files into 'neural-network-readable' representations that can be transformed into tensor datasets using the child classes of *torch.utils.data.Dataset* """ import errno import os import warnings import psutil imp...
9da4939c3a241c9f7f88f355b407f591f5c7b5679d2c798d89c8c9dc8b18b973
Python
21,541
535
"""Glass-brain, slice, flatmap, timeseries, and histogram plots for `BrainData`.""" import os import warnings import numpy as np from nltools.utils import _find_stack_level from .utils import _result_from_array DEFAULT_SLICE_CUT_COORDS = { "x": list(range(-50, 51, 8)), "y": list(range(-80, 50, 10)), "z...
b7e98f502910423a029c6cb6fb4b0ebee82b03ae9f7a3fe5c7828656280158f5
Python
21,634
572
"""Export one loaded SanPy ``bAnalysis`` current-clamp recording to NWB. This is a standalone development script. Edit ``ABF_PATH``, and ``NWB_PATH`` in the ``__main__`` block before running it. run with: uv run --with pynwb scripts/nwb/export_sanpy_banalysis_to_nwb.py """ from __future__ import annotations im...
dc6b358ce830a7452ef287b1f5ad8791620a894f1c0e8adc2b97748dff9062f1
Python
21,643
648
"""Riemannian and pseudo-Riemannian metrics. Lead author: Nina Miolane. """ from abc import ABC import joblib import geomstats.backend as gs import geomstats.geometry as geometry from geomstats.geometry.connection import Connection from geomstats.vectorization import check_is_batch EPSILON = 1e-4 class Riemannia...
421df4904e9cb36051cd129214592e3b7e201b1fbfc36481145468e33b81266b
Python
21,646
616
#!/usr/bin/env python ''' Keisuke Suzuki <ksk@chain.hokudai.ac.jp> 2023-01-27 ''' import os os.environ['GLOG_minloglevel'] = '2' # suprress Caffe verbose prints import settings import site site.addsitedir(settings.caffe_root) import caffe import numpy as np import math, random import sys, subprocess from IPython.dis...
2cc0d55e60613f5a56a0f6a6e80adab3fe00970fbdeb31ae3c73c17ef2a8ae92
Python
21,684
498
import torch import numpy import pickle import datetime import pytorch_lightning as pl from os.path import exists from sklearn.decomposition import PCA from sklearn.manifold import TSNE import pandas as pd from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import torch.nn as nn import torch.nn.fu...
f3570ee67c012a5a42da48d5d28585993c055a192bef41eae599a5b52af45067
Python
21,715
514
import os import time import pickle from utils import * from rdkit import RDLogger RDLogger.DisableLog('rdApp.*') # caution: Kekule form (no aromatic bonds), lower case, what about [cs], ccs? # length of 2 only Elements_2 = ['He', 'Li', 'Be', 'Ne', 'Na', 'Mg', 'Al', 'Si', 'Cl', 'Ar', 'Ca', 'Sc', 'Ti', '...
f15dd174fb10df0ec1562e21d9c5f0c1d54d8c110021f8be86c65f9babcafdb4
Python
21,732
464
""" Visual feedback with online decoding Kyuhwa Lee Swiss Federal Institute of Technology Lausanne (EPFL) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at you...
5d1da5c57686c6db1ad1e8c144bdd9caec268244141a6aa8dc97979467fff921
Python
21,789
711
from PyQt5.QtWidgets import QApplication, QLabel, QGridLayout, \ QSizePolicy, QWidget, QPushButton, QFileDialog, QLineEdit, QDialog, \ QProgressBar, QMessageBox, QCheckBox, QListWidget, QTreeWidgetItem, QTreeWidget from PyQt5.QtGui import QPainter, QKeyEvent, QDoubleValidator, QIntValidator from PyQt5.QtCore im...
dde9730309f28e941ee41cba3a0ea15c9312b9d25f4f34e41b50e2ecbc8a4fe8
Python
21,804
372
import sys import numpy as np from scipy import sparse from scipy.io import savemat, loadmat import time import multiprocessing as mp from suns.Online.functions_online import merge_2 from suns.PostProcessing.seperate_neurons import watershed_neurons, separate_neuron from suns.PostProcessing.combine import unique_neuro...
85dc3b5b84f8dc6a17fab7f7ca3e155648b5097808630a11ca8b43f355eb2e48
Python
21,879
427
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
11a607533679eed7fc92bba278794e111af19e7ade7d8e1ffd01908f85ea3661
Python
21,891
365
import os import sys import numpy as np import NALSM_GEN_SUPPORT as sup import spatial_network_builder_lib as snb class build_networks: def __init__(self): self.main_Path = os.getcwd() self.codePath = self.main_Path self.dataPath = self.main_Path + '/networks' np.ra...
c87b652a005b537484003e1fdf58d37444ccf4139c3492c3ed331e7fef2f1732
Python
21,910
597
import numpy as np from utils import * import torch.nn as nn import torch import wandb import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable from scipy.cluster.vq import kmeans2 from joblib import Parallel, delayed def get_evs_stim_bifurc(Ks, evs): """ Sort the eigenvalues fo...
3aedee889f23a0892f6332036d2df3a556baacc338bb8cdb5c759d57d1535914
Python
21,912
451
# Copyright (C) 2022-2024 TU Darmstadt # SPDX-License-Identifier: Apache-2.0 # ----------------------------------------------------------- # Primary author: Phillip Rieger <phillip.rieger@trust.tu-darmstadt.de> # Co-authored-by: Torsten Krauss <torsten.krauss@uni-wuerzburg.de> # ---------------------------------------...
6a6b1b5e13f008be983cf986527172d019b5a96f7fbb96025c2719e624fc7d34
Python
21,949
539
from __future__ import absolute_import import warnings import numpy as np import pandas as pd import os import copy from sklearn.preprocessing import StandardScaler from pysurvival import utils from pysurvival.models import BaseModel from pysurvival.models._survival_forest import _SurvivalForestModel from pysurvival im...
7b526c72afb59f4311ff4a5479e3230a2a68b062c596302b533949842946cb2e
Python
21,950
378
# %% import sys import os import random import time import glob import numpy as np import h5py from scipy.io import savemat, loadmat import multiprocessing as mp import tensorflow as tf import gc os.environ['KERAS_BACKEND'] = 'tensorflow' # os.environ['CUDA_VISIBLE_DEVICES'] = '0' # Set which GPU to use. '-1' uses onl...
5264a5f3528745c577aa6f0b9578f9268d339ccd916c97eea6df04b90478e656
Python
21,965
478
import tensorflow as tf import variational.activations as variational_activations class VariationalLayer(tf.keras.layers.Layer): def __init__(self, # weight_prior, variance_parameterisation_type, activation=None, use_bias=True, ...
39680d1be51ec4bc02d1b0fd7304cacf36c1817def7c138b507af14b154b5ead
Python
21,993
607
# 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 app...
3a461707af034db6aeb87891fc80c0f911c75171e288fbae73f204ca3293882a
Python
22,001
500
# 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...
10124987854594587a5662373b96495c45b49b46f8c9c2b27d8c1b7be002706b
Python
22,024
567
import math import pytest import geomstats.backend as gs from geomstats.geometry.spd_matrices import SPDMatrices from geomstats.test_cases.geometry.connection import ( ConnectionComparisonTestCase, ConnectionTestCase, ) from geomstats.test_cases.geometry.mixins import DistTestCaseMixins from geomstats.vectori...
f84209559faaa2404100dbc73c50ea0af65a4f431f2c073ee4331b13c3815c96
Python
22,025
532
# 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...
ae3d3672288bd24be023051c426ab84abd552da245aa538e8ea949050b06b214
Python
22,047
596
from __future__ import absolute_import import torch import numpy as np import copy import multiprocessing from pysurvival import HAS_GPU from pysurvival import utils from pysurvival.utils import neural_networks as nn from pysurvival.utils import optimization as opt from pysurvival.models import BaseModel # %matplotli...
7ef76b8f2c7ad2456f7b1682c82ebbc6eb3ab0bd999ea1ff1b6ce1fca02610f4
Python
22,053
527
import argparse import json import os import sys import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from pydfc import data_loader from pydfc.data_loader import find_subj_list from pydfc.ml_utils import find_available_subjects, load_task_data from pydfc.task_utils import ( ...
bd5cd86ede8fa26dd9c23bfb535a5fbd553a7b3af73f7172a4bed99392cfad3d
Python
22,081
655
import itertools import math import geomstats.backend as gs from geomstats.geometry.special_orthogonal import SpecialOrthogonal from geomstats.test.data import TestData from .base import LevelSetTestData from .lie_group import LieGroupTestData, MatrixLieGroupTestData from .mixins import ProjectionMixinsTestData def...
b12c4e79ae7e24656ecd6e052bcdbaeecb293aa3b5251725948ee8cfc6ea067b
Python
22,087
638
from __future__ import absolute_import import numpy as np from numpy.testing import assert_allclose from nose.tools import assert_equal, assert_true, assert_raises, raises import pycircstat axis_1arg_test_funcs = [pycircstat.astd, pycircstat.avar, pycircstat.mean, ...
7ad05ae3da058ce17a8204c9b4522ce5047cf4896e99008a2acf034a15048bf1
Python
22,108
378
# %% import sys import os import random import time import glob import numpy as np import h5py from scipy.io import savemat, loadmat import multiprocessing as mp import tensorflow as tf import gc os.environ['KERAS_BACKEND'] = 'tensorflow' # os.environ['CUDA_VISIBLE_DEVICES'] = '0' # Set which GPU to use. '-1' uses onl...
81ee80a878305ca8d18bc5f5e9d4531664dc6d2ada36bcf4b6a15f071dacfcb0
Python
22,114
510
""" This program trains a CNN on image patches from a stem cell microscopy dataset with 4 classes. CNN's are trained with and without the addition of generated image patches """ from __future__ import division import torch import torch.nn as nn import torchvision.transforms as transforms import torch.utils.data.sampl...
3d5c22e99a107adc90017210d1abbe379a9034878b16afd569b80e4312694064
Python
22,116
602
"""Permutation tests and dependence measures for square matrices. `matrix_permutation_test` is the Mantel test: it asks whether two square matrices (e.g. two representational dissimilarity matrices, or a brain and a model similarity matrix) are correlated, building the null by permuting the rows and columns of one mat...
7f44b7c265b341ae803ae18c36f22988d911d2cc571604a46e7188a2448d7ddf
Python
22,124
749
import unittest import torch import torch.utils.data as tud from reinvent.models.transformer.core.dataset.paired_dataset import PairedDataset from reinvent.models.transformer.core.vocabulary import SMILESTokenizer from tests.models.unit_tests.libinvent.transformer.fixtures import mocked_vocabulary from tests.test_dat...
14988b3c33f7b3c7ab29bb99a8da60ac41e8c0913cd06a35cf82cc663b0bc83e
Python
22,168
487
"""Test suite for basic backend simulation functionalities. """ # external _imports from typing import Union import numpy as np import pytest # pyrates internal _imports from pyrates import integrate # meta infos __author__ = "Richard Gast, Daniel Rose" __status__ = "Development" ########### # Utility # ###########...
ccc2849b77c08934e6bbf3d12a18018bd865a91e10b9f20c6a3788d48c22d670
Python
22,198
555
from typing import List, Literal, Optional, Tuple import torch from torch import nn from .._weights import download_weights from ..modules import Conv2dBlock, Conv3dBlock, UNetAttentionConv, _get_padding def _flatten_z_to_channels(x): return x.permute(0, 4, 1, 2, 3).reshape(x.size(0), -1, x.size(2), x.size(3)) ...
dd2a1358003a985b815b56bf262a7356871af60f56bd3f5b10ff26f98ddf773a
Python
22,208
432
"""The dashboard's panels, in matplotlib. Five of the dashboard's eight figures are ordinary geoms. They are drawn here instead of in R, in the style the VDJdb papers already use: `~/vcs/manuscripts/2026-vdjdb-update` has no R at all -- every published figure is matplotlib with an Arial 7pt / 0.6pt-linewidth rcParams ...
6def0646c7870859436257ad79eaed61e0d2f318ce76ed2da35ed6eb84dda89b
Python
22,224
613
"""Embed the NicePool linked-plot component in a SanPy plugin.""" from __future__ import annotations from collections.abc import Mapping, Sequence from typing import Any import pandas as pd from PyQt5 import QtWidgets import sanpy from sanpy.bAnalysisResults import get_plot_result_definitions from sanpy.interface.p...
87ef781ae5b15b539a6068aa4bda81f0b128ff858597c517bf0191882dc33f6c
Python
22,252
605
"""Provide standalone statistical functions for Adjacency matrices. Each function takes an Adjacency instance as its first argument (`adj`). """ import numpy as np def _similarity( adj, data, plot=False, method="2d", n_permute=5000, metric="spearman", include_diag=False, nan_policy="...
cd06d0bd6a7f55b932dcbb8788d2792b307ae754a361f7bb738fa2d90f5a8dcc
Python
22,257
499
# -*- coding: utf-8 -*- """ This script resimulates observation data from the ground truth of the `LoDoPaB-CT dataset <https://doi.org/10.5281/zenodo.3384092>`_ with a different setting: * A fan beam (2d cone beam) geometry is used instead of 2d parallel beam. * 5% Gaussian noise is added to the post-log obser...
d5050b41ed467e59c718e935a9d8aedac2c8a20d5023aaa8184f77956d226b37
Python
22,263
503
import io import json import click import pandas as pd from uniprotparser.betaparser import UniprotParser, UniprotSequence from sequal.sequence import Sequence from curtainutils.common import read_fasta def lambda_function_for_diann_ptm_single_site( row: pd.Series, modified_seq_col: str, e...
1d31ce3434e7a0f986f960f2cd7ac4b0dbb49c489dc4d8695c5cc2dc7b7e2c4b
Python
22,290
634
# in this script to fellow fairly closely Zou et al # but the create a equivariant descriptor for each type # of tree topology from the beggining # We use a an embedding "across sequences" instead to # within sequences. # this is an optimized version of the lstm network import numpy as np np.random.seed(1234567) # ...
33ec2863f2bb6846c3457778c50a56f0e514d08b0bddb15e157360d93fd1bbf9
Python
22,322
551
import argparse import ast import dataclasses import logging import os import urllib.request from copy import deepcopy from typing import Any, Dict, List, Optional, Union import torch from mace.cli.fine_tuning_select import ( FilteringType, SelectionSettings, SubselectType, select_samples, ) from mace...
8e107f6c10b9c9e7112ecdbecd529c32bdf5a4ff53dc0fdbcc89dc30d3497058
Python
22,389
395
"""Junctions that contradict the germline anchors of the V and J they name. VDJdb's ``cdr3`` is junction space: Cys104 through Phe/Trp118, **both anchors included**. A submission in IMGT CDR3 space, one carrying framework past an anchor, or one with a mis-read anchor residue is none of those, and it passes every rule ...
592dd42c546cfe749709a2a03c1bb2d42e72ff203d2ddb7449e42b60914f0881
Python
22,401
665
# 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...
043fb08c14696e38260c965fbf0eb7c028fc43b1b334ebfbdc1d19864d760bbb
Python
22,501
537
"""Classes for fiber bundles and quotient metrics. Lead author: Nicolas Guigui. """ import geomstats.backend as gs from geomstats.geometry.riemannian_metric import RiemannianMetric class QuotientMetric(RiemannianMetric): """Quotient metric. Given a (principal) fiber bundle, or more generally a manifold wit...
bdfc2ab37ddfc06bc22928facb1d597fdf7ad54b305a84ab27800045a54b1202
Python
22,501
536
# Copyright (c) 2023 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...
e57b783a402a41d25ebb1325a3807d1b22297bc084cb91e2ef2f2853ab78a90c
Python
22,513
642
### COMMAND FORMATS __description__ = \ """ PyCmdMessenger Class for communication with an arduino using the CmdMessenger serial communication library. """ __author__ = "Michael J. Harms" __date__ = "2016-05-20" import serial import re, warnings, multiprocessing, time, struct class CmdMessenger: """ Basic...
dbb71ade319fadd43b8d9da5121facf519e8144125d0713ef60fc46f69e6bc1d
Python
22,566
597
"""Unit tests for mace/tools/multihead_tools.py. Covers the pure/offline pieces: HeadConfig construction and defaults, dict_head_to_dataclass (head-dict overrides vs. args fallbacks + the missing-train_file error), prepare_default_head with the real arg parser, and both branches of prepare_pt_head (neither branch down...
d83ee2f75811f96ad9a681838b8065430f59360282cd3ad230fa3c3c16a8fd2a
Python
22,585
635
"""Generate m sequences. Loosely translated from http://fmriserver.ucsd.edu/ttliu """ from __future__ import annotations import math import numpy as np from rich import print class Msequence: """Create instance for an order of experimental trials.""" def __init__(self): # read in taps file and co...
f7f3e08a0119404efcd675f174c0634a192605700f5f34d811be40372a3690ed
Python
22,586
544
import warnings import numpy as np import nibabel as nib import pytest from nltools.data import BrainData from nltools.templates import get_brainspace class TestBrainDataInit: """Test BrainData initialization, resampling, and template auto-detection.""" def test_init_resample_true_mismatched_spaces(self): ...
c1c6f5470c411b3eb096ece74eb722f96498a96f59aa4914e056ea3cf4a8975e
Python
22,609
569
from typing import TYPE_CHECKING, Optional, Union, List, cast from chromadb.api.types import ( URI, CollectionMetadata, Embedding, PyEmbedding, Include, IndexingStatus, Metadata, Document, Image, Where, IDs, GetResult, QueryResult, ID, OneOrMany, ReadLeve...
f77cff339ecb49d71baae3e47c2296c95fb45deb03deb24b8e4c0c1225935574
Python
22,633
579
""" ResNet code gently borrowed from https://github.com/pytorch/vision/blob/master/torchvision/models/resnet.py """ from __future__ import print_function, division, absolute_import from collections import OrderedDict import math import torch.nn as nn from torch.utils import model_zoo __all__ = ['SENet', 'senet154', 's...
a5a248d355d92d193c259e28c69d66f1bb57e684625c1c320a9ad9b792cb701b
Python
22,641
437
""" File containing the wavefunction model & function to build the model """ import haiku.experimental import jax import jax.numpy as jnp from typing import Optional, Dict, Callable, Any, Tuple, Union, List import haiku as hk import logging from deeperwin.configuration import ( ModelConfig, JastrowConfig, ...
575bb6103696ac9fc902e3f822739d7b80d7bde28347c27483af108a78f3589b
Python
22,647
601
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon May 1 15:05:23 2023 @author: shah """ from tensorflow.keras.layers import Dense, Layer import tensorflow as tf import numpy as np import collections from tensorflow.keras import Model from tensorflow.keras.layers import ( Dropout, Softmax, ...
00cd9b4ee69abe67b67d704fc0ba2058bf0f78404a414866093244940c27ddd5
Python
22,674
458
"""IMGT segment nomenclature (#389): mechanical respellings only, never a guess.""" from __future__ import annotations import polars as pl import pytest from vdjdb.curate import nomenclature as N @pytest.mark.parametrize("call,expected", [ # the /DV genes IMGT names once for both loci -- 1,377 chains write the ...
863fc5f489824126711145fcc4c7f53244aafa47b23787bf585641ff24fa6b2d
Python
22,689
631
import click import os import math from corgie.block import get_blocks from copy import deepcopy from corgie import exceptions, stack, helpers, scheduling, argparsers from corgie.log import logger as corgie_logger from corgie.layers import get_layer_types, DEFAULT_LAYER_TYPE, str_to_layer_type from corgie.boundingcub...
f36b0a9d016979ae4fdc6ae4168043fa9b60b78038483fefb802d3dd318cc2f0
Python
22,719
447
import numpy as np # import tensorflow as tf import tensorflow.compat.v1 as tf tf.disable_v2_behavior() import os import sys import time import NALSM_CONSTRUCTOR_MNIST as construct import NALSM_PARALLEL_SAVE as parasaver import NALSM_SIM_SUPPORT as runSupport # NEW PARALLEL FILE import NALSM_GEN_SUPPORT as su...
9c44727d93d02a985aaba2c7f0854e3081dc2ae64a08241222194799cb44877e
Python
22,734
645
import torch import torch.nn as nn import numpy as np import os import sys file_dir = os.path.dirname(__file__) sys.path.append(file_dir) from initializers import * class RNNCell(nn.Module): def __init__(self, params): """ Full rank RNN cell Args: params: dictionary with model...
53c7d79e846cabc53c8ccde3673d1901abf52b94b21f844ab9b99bb05aa26342
Python
22,756
713
import httpx from typing import Optional, Sequence from uuid import UUID from overrides import override from chromadb.auth import UserIdentity from chromadb.auth.utils import maybe_set_tenant_and_database from chromadb.api import AsyncAdminAPI, AsyncClientAPI, AsyncServerAPI from chromadb.api.collection_configuration ...
190235a0ec0611a0427f7198dee329b2db49317b4f2b771d9bd88e693838821a
Python
22,758
632
# 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...
57c7ed9c5794c09c6ea016a177908e1fc951c57fe6e267528edabc26397a9f72
Python
22,773
478
#!/usr/bin/env python3 # Script parse sniffles2 vcf files and extract useful information # USAGE: cat sv_file.vcf | python3 sniffles2_vcf_parser.py # important imports import sys import argparse import random # Version def the_version(): print(f'sniffles2_vcf_parser.py\nversion 0.1') # log output def logger(...
826c6f5ec4184de943424de206468d7ebced584c0d63c3bd4efcbfbc904348c2
Python
22,838
574
import copy import torch import numpy as np import torch.nn as nn from tqdm import trange from sklearn.model_selection import StratifiedKFold from torch_geometric.loader import DataLoader from sklearn.svm import SVC from sklearn import preprocessing from sklearn.metrics import accuracy_score from sklearn.model_selecti...
6c1271803b6359deec65007646ef2768b483437df3623d670c43dba315cf7656
Python
22,864
547
"""Module that implements the CWT using a trainable complex morlet wavelet""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf from sleeprnn.data.utils import get_kernel def compute_cwt( inputs, fb_list,...
a886f827e10c40d1960fd48212d21717120b5b59bafac8a237c9c8dc8490f095
Python
22,871
605
"""Main user interface for FISSA. Authors: - Sander W Keemink (swkeemink@scimail.eu) - Scott C Lowe """ from __future__ import print_function from past.builtins import basestring import collections import glob import os.path import sys import warnings import numpy as np from scipy.io import savemat from . ...
c428d20424cd181c2beb3d3c9d3ae78372b739c45fd746f9a9f2d184a0d68de7
Python
22,902
559
import os import shutil from overrides import override import pickle from typing import Dict, List, Optional, Sequence, Set, cast from chromadb.config import System from chromadb.db.base import ParameterValue, get_sql from chromadb.db.impl.sqlite import SqliteDB from chromadb.segment.impl.vector.batch import Batch from...
eaa2350761aff19b443285697120c5091457fe39a1f729305efda301043319d9
Python
22,904
489
""" FES feedback with online decoding Kyuhwa Lee Swiss Federal Institute of Technology Lausanne (EPFL) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your o...
4b9f5e76d6e717a6041665d78368b97039d7c101e43a353bd6c325cdff1586ea
Python
22,913
534
#*----------------------------------------------------------------------------* #* Copyright (C) 2024 ETH Zurich, Switzerland * #* SPDX-License-Identifier: Apache-2.0 * #* * ...
7b1f281557364dfcc09639ee869c26c7acbfda6ddabade3297616bcf6052c5c6
Python
22,924
609
# -*- coding: utf-8 -*- # OS stuff import os import sys import warnings from pathlib import Path # Computational stuff import numpy as np import matplotlib as mplb import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec, GridSpecFromSubplotSpec from matplotlib import font_manager as fm from matplotli...
13c7b43b066f91904ad3c19008ed11f0e909278e8a973619d0feb678f520d1ec
Python
22,939
543
"""General linear model estimator built on Nilearn's `run_glm`. `_Glm` fits one run represented by a `(DesignMatrix, y)` pair. It knows nothing about `BrainData`, masks, NIfTI images, events, or multi-run orchestration: the caller supplies a precomputed design (including any intercept column) and a preprocessed respon...
598af276189c478cff0c6aa0cb87db1275bb9f82c3fd7d52ef18557c4c64ecae
Python
22,946
557
# Copyright (c) 2023 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...
7d6960f721754e8ac52c2a9eb69f289d17cd2ef6a272e7e1b211223cc6e82413
Python
22,950
655
""" Label Object and functions dealing with labels """ import copy import numpy as np from typing import List, Tuple, Union from scipy.sparse import csr_matrix, issparse from scipy.optimize import linear_sum_assignment import matplotlib as mpl from mpl_toolkits.axes_grid1 import make_axes_locatable f...
846b0e47093d8cd78436a6bd9a0bea970cc9d3c359d28477f5530fa9a7457fab
Python
22,950
623
# 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...
f59c772ec902bdf803779ab833444988e3d29084e33a76d74744f09f33654cb9
Python
23,000
583
"""Module that defines as base model class to manage neural networks.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import json import os import numpy as np import tensorflow as tf from sleeprnn.common import pkeys from sleeprnn.common import constan...
f1d4e8d43db99b912a73bbfacddff6c6680c23a0cf87d718a31d8739babd7882
Python
23,001
562
import json import os import cv2 import ffmpeg import numpy as np import pandas as pd import torch from scipy import signal from scipy.spatial.transform import Rotation as R from sklearn.metrics import f1_score, recall_score from torch.utils.data import DataLoader from utils.hand.AD import cal_error_frame_ratio from u...
5cdbdb33fbcba2bc6732f469432fba52adf95013cad50523b8c135cab2e079d9
Python
23,003
579
"""Module that stores several useful keys to configure a model. """ from . import constants """ Input pipeline params batch_size: (int) Size of the mini batches used for training. shuffle_buffer_size: (int) Size of the buffer to shuffle the data. If 0, no shuffle is applied. prefetch_buffer_size: (int) Size of ...
3b8db1cf252c03236ec6226e41966dec7b460fd5a66d261e6c853a79123c6071
Python
23,009
614
########################################################################################### # Data parsing utilities # Authors: Ilyes Batatia, Gregor Simm and David Kovacs # This program is distributed under the MIT License (see MIT.md) ###################################################################################...
a8a3c5883866243a0fd2441f9eebf35dfb969b1bd625691cab7e4870bed91f40
Python
23,045
636
from PymoNNto.Exploration.UI_Base import * from PymoNNto.Exploration.StorageManager.StorageManager import * from PymoNNto.Exploration.Evolution.SSH_Functions import * from PymoNNto.Exploration.Evolution.EvolutionPlots import * from multiprocessing import Process, Queue, Pipe import shutil import os class QHLine(QFrame...
96faa832bafe5ef9dda3bb29905b5fdd7b175ec5b9073a43a98482aae12fff42
Python
23,057
668
"""Brain visualization — surface plots and flatmaps.""" import os from pathlib import Path import matplotlib.pyplot as plt import numpy as np from nilearn.plotting import plot_surf_stat_map from nilearn.surface import vol_to_surf def _resolve_stat_map_defaults(data, *, cmap=None, vmin=None, vmax=None): """Resol...
30b8c6ddeac4b1f9672dba81b568951d587152fecdcd3448ada77543922ae811
Python
23,091
282
#!/usr/bin/env python3 # # Sniffles2 # A fast structural variant caller for long-read sequencing data # # Created: 18.10.2021 # Author: Moritz Smolka # Contact: moritz.g.smolka@gmail.com # import os import sys import datetime import argparse from sniffles import util VERSION="Sniffles2" BUILD="2.2" SNF_VERSION="S2_...
3c447f2cb20596614e51cd4ac8b90964e90264d407063edb0d4642037380ce32
Python
23,097
615
import pytest import geomstats.backend as gs from geomstats.geometry.special_orthogonal import ( SpecialOrthogonal, _SpecialOrthogonal2Vectors, _SpecialOrthogonal3Vectors, ) from geomstats.test.random import ( LieGroupVectorRandomDataGenerator, get_random_quaternion, ) from geomstats.test.vectoriza...
d0fe7e0363453c439dbcb514bd0d30d5912173dc5547cbeea0495aa767f202c0
Python
23,110
568
# -*- coding: utf-8 -*- # OS stuff import os import sys import warnings from pathlib import Path from tqdm import tqdm # Computational stuff import numpy as np import matplotlib as mplb import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpecFromSubplotSpec from matplotlib import ticker import matplot...
716f5972f07dd1c461572c73cb147a1a1cb517615ddc2cc0448bb4ee7fc04ed5
Python
23,124
606
#!/usr/bin/env python3 from ast import literal_eval from typing import List, Tuple import torch import torch.nn as nn import torch.nn.functional as F from fairseq import checkpoint_utils, utils from fairseq.data.data_utils import lengths_to_padding_mask from fairseq.models import ( FairseqEncoder, FairseqEnco...
747edb74c448c6c89367802bcc8e337f7124f5bd7a9ef4265df77f3f197bfdb9
Python
23,140
501
import os import random import logging as log import coloredlogs import cv2 import hydra import numpy as np import torch import yaml from common.itemloader import ItemLoader from omegaconf import OmegaConf from sklearn.metrics import roc_auc_score, balanced_accuracy_score, accuracy_score from tqdm import tqdm from ad...
aa5b5b0de777988cb40cbb78578d142d07e24e9e6a1527a604a71fc74f098b10
Python
23,177
557
import json import pandas as pd import matplotlib.pyplot as plt import numpy as np from os import path from os import mkdir from csv import writer from datetime import datetime from sys import exit class JSLog: def __init__(self, experiment_name, sub_dir = None): configuration_path = path.join( ...
6533ff31e216381135c41bfbd71eacdbfe1c6cced81ad570e782c7599729a4be
Python
23,199
700
"""Graph Space. Lead author: Anna Calissano. References ---------- .. [Calissano2020] Calissano, A., Feragen, A., Vantini, S. “Graph Space: Geodesic Principal Components for a Population of Network-valued Data.” Mox report 14, 2020. https://mox.polimi.it/reports-and-theses/publication-results/?id=855. ""...
0ff798db79b3eaf5e6fdc0977dfb90d58932a69b62abce5c7b12b37df7f3a81b
Python
23,250
695
""" Main BANKSY functions Nigel 3 dec 2020 updated 4 mar 2022 updated 8 Sep 2022 """ import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns from typing import Union, Tuple, List import scipy.sparse as sparse from scipy.sparse import c...
26b5703703b0db43ce06865e935e0e66bbf5ed72f2a333e7585503854bca3496
Python
23,279
402
import io import numpy as np from scipy import sparse from scipy import signal from scipy.io import savemat, loadmat import time import multiprocessing as mp from suns.PostProcessing.seperate_neurons import watershed_neurons, separate_neuron from suns.PostProcessing.combine import segs_results, unique_neurons2_simp, g...
8dec61b0ccb82862d5c6eee6e7567b0fda6b9c896f1bf91f9bb4511d2ce0a081
Python
23,311
673
import numpy as np import scipy.stats as stats import pandas as pd from sklearn.decomposition import PCA from sklearn.manifold import TSNE from umap import UMAP from sklearn.covariance import MinCovDet import matplotlib.pyplot as plt import seaborn as sns from shapely.geometry import Polygon from itertools import co...
ee7291df27c1cd0d76ae2b3d217da697725aae70ea63e04ab850d050331b8157
Python
23,315
379
"""Every motif metric, for three fixed sources, recorded and gated on every build. The motif stage is the one place where the release cannot be reproduced byte for byte, so its acceptance criterion is a set of measurements rather than a digest (``docs/clustering.md``). Those measurements were being computed inside tes...
1804e78642dc7ea8e24e6315c0d6ab444ed3b49cce25bfb06cde95439a48c2d1
Python
23,332
531
######################################################################################################################## # This script takes pairs of JSON files exported from EPPI reviewer using identical coding schemes on the same group of # papers. Each JSON file includes annotations for a coder. The script produ...
ed0d941d7b380c4986961af44b0340d6c163cd45d4fa53b16e5b77c5726c8da9
Python
23,342
498
"""The reference corpus: the MHC dictionary, the token families, the weighting, and the two queries. The weighting is checked against ``sklearn.feature_extraction.text.TfidfVectorizer`` rather than only against itself, which is the reason :mod:`vdjdb.corpus.build` uses that library's conventions: an implementation agr...
3aa4cd149cd012f067af500045b5c8c25b7479ad5b4fd6941df1c31142ea2b25
Python
23,355
569
# -*- coding: utf-8 -*- # OS stuff import os import sys import warnings from pathlib import Path from tqdm import tqdm # Computational stuff import numpy as np import matplotlib as mplb import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpecFromSubplotSpec from matplotlib import ticker import matplot...
c661bdb92cec8cc90d262bb6ef6ae52a59f1f7f60b3440936bc5e4f9c2dc8d03
Python
23,417
554
# 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...
a05235e7315f738cf6335a503dcfe630b619824b322b7c4811a5c8fdd4cfda50
Python
23,447
678
""" Streaming image data between processes Author: Tal Eisenberg, 2021 The following classes use shared memory buffers to generate and process image data in an asynchronous manner using multiple os processes. - ImageSource: a multiprocessing.Process that writes image data to a shared memory buffer. - ImageObserver: a...
469d74f3c66c77dfe19cea1dfc4a05ee4ce4d0aca169d987fbb406a6451e22d5
Python
23,473
485
from __future__ import absolute_import import numpy as np import tensorflow as tf import tensorflow.keras.backend as K from color_ops import rgb2hsl_tf, rgb2yiq_tf class NCC: """ Local (over window) normalized cross correlation loss. """ def __init__(self, win=None, eps=1e-5): ...
d155cf3dca9540d8a7fe982a3cdb03a80ff1a47754f6aa8ab4645b6853f74b1c
Python
23,510
560
from PymoNNto.Exploration.Network_UI.Network_UI import * from PymoNNto.Exploration.Network_UI.TabBase import * def pol2cart(theta, rho): x = rho * np.cos(theta) y = rho * np.sin(theta) return x, y def cart2pol(x, y): theta = np.arctan2(y, x) rho = np.hypot(x, y) return theta, rho class DrawIt...
60478f935f38285fed60da79c4b0581548da33eedad2b141e94c1cfd23d043bd
Python
23,524
679
""" Streaming image data between processes Author: Tal Eisenberg, 2021 The following classes use shared memory buffers to generate and process image data in an asynchronous manner using multiple os processes. - ImageSource: a multiprocessing.Process that writes image data to a shared memory buffer. - ImageObserver: a...
198eaca413e5708148698fe2d5166656045f6174a416291d566842b95aa4c31b
Python
23,554
556
# Copyright 2020-2025 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import os import shutil import subprocess from glob import glob import logging import importlib from pathlib import Path import json import tests.end_to_end.utils.defaults as defaults import tests.end_to_end.utils.exceptions as ex from test...
869a6ffaca02b477cbe0cf75c321ecf8dae355a48572091f549128751657b135
Python
23,555
571
"""Adding graph convolution encoding on top of the transformer encoder, utilizing `baseFunc.py` and `buildGraph.py` for DGL graph construction, and implementing the split of graph convolution encoding within `transformer_layer.py`.""" import math from typing import Dict, List, Optional import torch import torch.nn as...
66fa82209bed776bf614f860940031a11005ff48bb9f44af3f06a2b43f2ddccc
Python
23,576
612
# 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...
020104c08bf9dfc78a8a77b2497953a04ad1821f8c4ce72e3f33471cb650783d
Python
23,579
708
from Bio import SeqIO from sgt import SGT import pandas as pd import os os.environ['TF_CPP_MIN_LOG_LEVEL']='3' import numpy as np import tensorflow as tf import sys import time import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import argparse # Create a parser parser = argpars...
92c819d5a7e865cff7c380f5a4157af801bf4491c3a25ba766120251f871b080
Python
23,587
642
from chromadb.api.types import Embeddings, Documents, EmbeddingFunction, Space from chromadb import __version__ from typing import List, Dict, Any, cast, Optional import os import numpy as np import numpy.typing as npt from chromadb.utils.embedding_functions.schemas import validate_config_schema import warnings class...