sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
872df691e9bf8736fa19edef42b1deee92d57b7f392c8a24792d55fb1df005a0
Python
4,486
135
""" CustomService class definitions """ import logging import time from builtins import str import ts from ts.context import Context, RequestProcessor from ts.metrics.metrics_store import MetricsStore from ts.protocol.otf_message_handler import create_predict_response PREDICTION_METRIC = 'PredictionTime' logger = ...
e51cbef47840f7992418368f597b217ea05163e66fbae33c802d9f25c0fdbbed
Python
4,488
101
"""Detect bursts: cycle consistency approach.""" import pandas as pd from bycycle.utils.checks import check_param_range from bycycle.burst.utils import check_min_burst_cycles ################################################################################################### ##########################################...
d2171c0bf09686ede803c9808ae191f791789dc442b5d473f7373bed900c49b6
Python
4,489
70
from template_generation_tools import generate_base_class_template, generate_curated_class_template, \ generate_ind_template, merge_class_templates, \ generate_cross_species_template, generate_taxonomies_template, generate_app_specific_template, \ generate_obsolete_ind_template, generate_homologous_to_templ...
1862ce9ffa6fd4fa1f1cc69bf777ecc8141e04a3ced94cb02925ea107a2e9a84
Python
4,492
125
from __future__ import unicode_literals import sys import os import random from matplotlib.backends import qt_compat use_pyside = qt_compat.QT_API == qt_compat.QT_API_PYSIDE2 if use_pyside: from PySide import QtWidgets, QtCore else: from PyQt5 import QtWidgets, QtCore # import matplotlib # Make sure that we are...
e44c1c75ab77d3971c889fc398059b295decc289f171d38d0a6b4d3078002022
Python
4,493
125
import tensorflow as tf import numpy as np import keras import os # my scripts from scripts import training_util from scripts import configurations as cfg from scripts import preprocess from scripts import data_handler as dh from scripts import fastq_preprocess from scripts import models_util from script...
06a34282411abf31aaf0dc555cb7ca63aef1a3931b48abb1520d54b4191049e7
Python
4,496
92
#!/usr/bin/env python import pandas as pd def reciprocal_best_hits_blastp_or_diamond_blastp( x_to_y_blastp_results, y_to_x_blastp_results, outfile): """ This function finds reciprocal best blastp hits between two samples. The input is a blastp results file where x was blasted against y, and ...
36ec2f285bfe7ef2d0785bcb0c41ae02f1b67b7b7981855781e05098737d18c3
Python
4,496
110
from IPython.core.debugger import set_trace import numpy as np import tensorflow as tf from src.utilities.findiff.findiff_general import solver_arguments from src.solvers.findiff.findiff_solver import fd_solve ######################################################## """ Common along with testcase specific arguments...
d6e5a1b04f77286e0df70896a0c744a24517c5fa11732ce75c392d8c01a1a442
Python
4,496
155
# Copyright 2018-2025 # Institute of Neuroscience and Medicine (INM-1), Forschungszentrum Jülich GmbH # 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/LICE...
336962e0f3e225fdbb74e7376f6c9c09f1dfec0775016c4161cf4ea5215acc93
Python
4,498
111
# Copyright 2018-2025 # Institute of Neuroscience and Medicine (INM-1), Forschungszentrum Jülich GmbH # 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/LICE...
72beef0923a07c924cc42d4a4c752ef88e1161ce1d1671d7ba0ac186596410a3
Python
4,498
104
import json import pytest from siibra.retrieval.bids import ( find_bids_sidecars, load_bids_metadata, parse_bids_filename, ) from siibra.retrieval.repositories import LocalFileRepository @pytest.mark.parametrize("name, entities, suffix, extension, datatype", [ ("sub-01/anat/sub-01_T1w.nii.gz", {"sub...
811e15e71af80a32214b30e05bbded315ed18d4f767fe1e52a9e3eff49dc08d5
Python
4,499
133
#from __future__ import division #from __future__ import print_function #import warnings #warnings.filterwarnings("ignore") import time import argparse import pdb import pickle import os import shutil import glob import pandas as pd import itertools import numpy as np import matplotlib.pyplot as plt from tools import ...
ec77f79eb8d1e03007627cfa9347a04283c6a249fec4b496d488a7ff3be96ffb
Python
4,500
125
import sys import socket import struct import numpy as np from functools import reduce from os import listdir from datetime import datetime from functools import reduce from time import sleep from dataReader import DataReader from parameterSetup import ParameterSetup # sends mock signal to online.py by con...
1092effa50a40aa761db87c4d274067760333db53b69a501c8e7845fe4465846
Python
4,502
146
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import random import sys from ray.rllib.utils.compression import unpack_if_needed, pack_if_needed from ray.rllib.utils.window_stat import WindowStat class CustomValueReplayBuffer(object):...
8fe18b047b6ddec9349789c695a4e5b5ff68c3055b359054687d0f40c8f7fbf2
Python
4,502
147
import math import numpy as np from . import blend from ..geometry import * class ForwardScanner(object): """ Forward scanner. """ def __init__(self, dataset, scan_spec, **params): self._init() self.dataset = dataset self.scan_spec = dict(scan_spec) self.params = param...
13fecb41d9d8554ea8997732d8b3d7b529731894318256b71c3c5e5719c4e9c4
Python
4,503
124
# -*- coding: utf-8 -*- from pyqtgraph.Qt import QtGui, QtCore from pyqtgraph.pgcollections import OrderedDict from .TableWidget import TableWidget from pyqtgraph.python2_3 import asUnicode import types, traceback import numpy as np try: import metaarray HAVE_METAARRAY = True except: HAVE_METAARRAY = False...
c3301b93569f8f2b9cb61894e95cc254ea3e860261b6eb67ad3c58f2300b4e3b
Python
4,503
136
# Copyright 2019 DeepMind Technologies Ltd. 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 appl...
6bdf21ad7d023dac1cdee69e8282137bad6b3e84e1ff02d3f7a2e5673c5a1e4a
Python
4,504
133
# Copyright (c) OpenMMLab. All rights reserved. import os import os.path import pickle import numpy as np import torch.distributed as dist from mmcv.runner import get_dist_info from .base_dataset import BaseDataset from .builder import DATASETS from .utils import check_integrity, download_and_extract_archive @DATAS...
f08851f47d6f888c9a027398f608d43e4248d1dc6d721733ed056e26b5dd037d
Python
4,504
135
import torch import torch.nn as nn import torch.nn.functional as F import dgl class GATLayer(nn.Module): def __init__(self, in_dim, out_dim, e_in_dim, e_out_dim): super(GATLayer, self).__init__() self.embed_node = nn.Linear(in_dim, out_dim, bias=False) self.attn_fc = nn.Linear(2 * out_dim ...
f3d6e0ac7cfe2fb42fb9e760bcbc53dd5a9f1073f2f50d2f8f4e2f4a429d5c05
Python
4,504
86
""" @file: main_config.py Created on 24.09.18 @project: crazyara @author: queensgambit Main Config definition file used for the project. Adjust the paths accordingly. """ # define the default dir where the training data in plane representation is located # e.g. for supervised learning default_dir = "/data/planes/" d...
33d13f482222af51f61a7506d4601a9e18add2411c582d8d2cb8c0d2bf91cb70
Python
4,505
145
import numpy as np from ..external.six.moves import range from numpy.testing import assert_array_equal import pytest from .. import algorithms as algo @pytest.fixture def random(): np.random.seed(sum(map(ord, "test_algorithms"))) def test_bootstrap(random): """Test that bootstrapping gives the right answe...
7c741a78dd76e7b85746b19ad3d70f28649140bb3f0c5d9bdbf802d79ee0a956
Python
4,506
148
from __future__ import print_function import numpy as np from .augment import Augment from .geometry.box import Box, centered_box from .geometry.vector import Vec3d from .perturb import Perturb __all__ = ['FillBox', 'BlurBox', 'NoiseBox'] class BoxOcclusion(Augment): """ Box occlusion. Args: p...
a5ad6ac0ebff68ec51a0280b02227a6902561c966a2cead9bd5e6d33ca171101
Python
4,507
109
"""Unit tests for the cached volume constructors `from_nifti` and `from_array`. The space registry and the siibra cache are patched, so no network access is needed and nothing is written to the user's cache. """ from hashlib import md5 from types import SimpleNamespace from unittest.mock import Mock, patch import nu...
e811b4ae8bffa2e608e2f91a21fd5d12fd18a0d5d484013893cd01e02b99b346
Python
4,508
118
import numpy as np from numba import njit from hmm_functions import HMMParam, write_HMM_to_file, Simulate_transition from helper_functions import find_runs # ---------------------------------------------------------------------------------------------------------------------------------------------------------------...
2b9af8dd3315a2ab9010919fc3d6ae1e85c8134e33eb0afa80df2dcc90d93b68
Python
4,510
132
""" Compare the simulation speed of the different backends William Nourse September 9 2021 The correct term is Babes, sir """ import numpy as np import nengo import time import pickle from sns_toolbox.neurons import SpikingNeuron from sns_toolbox.connections import SpikingSynapse from sns_toolbox.networks import Netw...
b090bb1ddac03119ca34b75954a7b55ba8cd87835a03cc2bcb1b7dbcd3f924d4
Python
4,510
93
import logging import time import grpc from google.protobuf.empty_pb2 import Empty from minio import Minio from mprl.utility_services.cloud_storage import DEFAULT_LOCAL_SAVE_PATH from mprl.utility_services.payoff_table import PolicySpec from mprl.utility_services.protobuf.population_server_pb2 import Confirmation, Ev...
d5aeea4d70c8bd7229eec39bcc79d2350b227c5dbbf77758c99c20a9b1078ad3
Python
4,511
131
# Copyright (c) OpenMMLab. All rights reserved. import argparse import fcntl import os from pathlib import Path from mmcv import Config, DictAction, track_parallel_progress, track_progress from mmcls.datasets import PIPELINES, build_dataset def parse_args(): parser = argparse.ArgumentParser(description='Verify ...
8865ad567f36fe68590ae027759d454b52a976ac9b549c6db8b3d0309ced99e4
Python
4,513
124
import re import sys from setuptools import setup def find_version(filename): _version_re = re.compile(r"__version__ = '(.*)'") for line in open(filename): version_match = _version_re.match(line) if version_match: return version_match.group(1) __version__ = find_version('neurondm...
e2a99b4fbc43b37bd46cab3babfbbf9dae4529a910351135f332af0856a4ce3c
Python
4,516
206
# SPDX-License-Identifier: LGPL-3.0-or-later """ Public building blocks for the DPA4/SeZM descriptor. This package re-exports the helper functions, embeddings, equivariant layers, and quaternion-based Wigner-D utilities used by the DPA4/SeZM descriptor and model. This package is the dpmodel (array-API) port of ``deep...
f1fe20c926ce2204654a25c995c5657b9316c2b4d81075ee4db0f8df833a3919
Python
4,516
119
from datetime import datetime from typing import Any, Optional, Union from flair.trainers.plugins.base import TrainerPlugin from flair.trainers.plugins.metric_records import MetricName from flair.training_utils import init_output_file class LossFilePlugin(TrainerPlugin): """Plugin that manages the loss.tsv file ...
1d6689be4d6f18a02bb4f78a552299fbea51524815df628e33cd6eec353c41f9
Python
4,518
44
""" Vector strength for models with SAM tones, different input configurations. 17 Aug 2021 version. Results are a printout from DataTablesVCN after selecting the data runs. Run started at: 2022-07-07-11.54.52 WARNING: This table is automatically written by figures.py generate_VS_data_file and should ...
993540198b922fafde34414e89094fc5365453ae03a14f6faf1a008ab2f628e2
Python
4,518
135
from torch_geometric.data import InMemoryDataset from torch_geometric.data import Data as DATA from tqdm import tqdm import pandas as pd import numpy as np import torch import os from torch.utils.data import DataLoader, Dataset import re class Pre_DTADataset(torch.utils.data.Dataset): def __init__(s...
16a08a2ef4848a59d601f0ea137ae890a2619340d4393e7b16ed21f2d65ea269
Python
4,521
129
from argparse import Namespace import json from pathlib import Path from pyontutils.core import makeGraph, qname, OntId, OntTerm from pyontutils.config import auth from typing import Union, Dict, List import yaml from IPython import embed resources = auth.get_path('resources') def convert_view_text_to_dict() -> dic...
f8c7b079cc8b0e020d561af092fa7e477533edb05f3d07fdb2a3a283b269ef80
Python
4,522
151
"""Tests for transcript pair discovery.""" from pathlib import Path import pytest from corset_tools.dist_calc.pairs import read_blast_reciprocal_pairs, read_pairs from corset_tools.exceptions import InputFormatError def test_read_pairs_handles_ragged_input(data_dir: Path) -> None: """Comments, ragged tabs and ...
a9e9c5e354580153676c67822ea6c545269dfbdef8fd0f7076f88e4db3c105d7
Python
4,523
98
from pyontutils.utils import * from pyontutils.core import * from pyontutils.closed_namespaces import * edge_cases = { #Definitions 'definition:': 'definition:', 'skos:definition': 'definition:', 'definition': 'definition:', 'NIFRID:birnlexDefinition': 'definition:', 'NIFRID:externallySourcedDe...
029d80cc07e4c1b424337ce31020968ac5a4007fc26ced762b037b70c52afd52
Python
4,524
145
# noqa: INP001 import inspect import importlib_metadata # -- Project information ----------------------------------------------------- from sphinx_github_style import get_linkcode_resolve version = "0.15.1" release = "0.15.1" project = "flair" author = importlib_metadata.metadata(project)["Author"] copyright = f"202...
48649cb36254f4daa503bb252b2351ff291e0403374f6905f6e65c973cb732b6
Python
4,524
132
# Copyright 2022 DeepMind Technologies Limited # # 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 agr...
0d4685626620f9483eea5f98fe6fcd8914df959a411ad8b8fe1e1cc4697f2c5b
Python
4,525
130
import unittest import numpy as np from numpy.linalg import norm import os import pickle import hbip.predict import hbip_reproduce as mn from hbip import preprocess as pp def base_model_path(name): return os.path.join("./models", name) def model_files(name): return [ os.path.join(base_model_path(na...
2d52107f89029250d85cca947443598b7c36af85cd4bbf825e4f3d6b6133e309
Python
4,525
137
# 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 a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
883e0e0d78c5f0cf60c00c34af531508aa4a3163ffe98647c1346c967bad1ee4
Python
4,530
197
# Copyright 2019-2020 The ASReview 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 appl...
d506b0a46d722e3019688789cb8447886fc1611860ffd0c47ce345186eb2f31f
Python
4,535
116
# Copyright (c) ONNX Project Contributors # # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np import pytest from onnx import TensorProto, checker, helper, numpy_helper, version_converter from onnx.reference import ReferenceEvaluator CASES = [ ("ReduceSum", 13, 12, [2, 2]...
8559b804ec5ca3fa08431e8ebfb0b09e00816d52ceace9558a2ef7721ebb350a
Python
4,536
101
from expert.src.model import Model from tensorflow.keras.callbacks import CSVLogger, ReduceLROnPlateau, EarlyStopping from expert.src.utils import read_genus_abu, read_labels, load_otlg, zero_weight_unk, parse_otlg, get_dmax from tensorflow.keras.losses import BinaryCrossentropy from tensorflow.keras.optimizers imp...
b86183bf2c1b759aa9e1811bea5ffc63e5e9bef7e263878cb84c4ebda115563e
Python
4,536
88
# -*- coding: utf-8 -*- # Written (W) 2008-2012 Christian Widmer # Written (W) 2008-2010 Cheng Soon Ong # Written (W) 2012-2014 Daniel Blanchard, dblanchard@ets.org # Copyright (C) 2008-2012 Max-Planck-Society, 2012-2014 ETS # This file is part of GridMap. # GridMap is free software: you can redistribute it and/or m...
5dd2d105ef9681665d27fbc5b7dafc854f25a70f1693c3a8cfcb214299281367
Python
4,537
127
""" 4. Running Bycycle on 2D Arrays =============================== Compute bycycle features for 2D organizations of timeseries. Bycycle supports computing the features of 2D signals using :class:`~.BycycleGroup`. Signals may be organized in a different ways, including (n_epochs, n_timepoints) or (n_channels, n_timep...
7b9cf2fe3c3994130de635a705ce69f200ee75bc0dc6a91bc5cc01ca2630d95b
Python
4,537
129
# Copyright (c) ONNX Project Contributors # # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations from typing import NamedTuple import ml_dtypes import numpy as np from onnx.onnx_pb import TensorProto class TensorDtypeMap(NamedTuple): np_dtype: np.dtype storage_dtype: int name: str ...
f6ad2f5629d976265673ffb3a16b7ae8970f3df3638e6a1a1ae168b488b87180
Python
4,537
137
# 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 a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
28dc20394a89e653c1b0ec610a3d5072dd558d97b96d0c423c0c0d85957bcf0f
Python
4,543
155
import sys import os import subprocess import numpy as np def main(): mot_path = "/MOT" target_folder_path = "data" for top_level_folder in ["train", "test"]: top_level_folder_path = os.path.join(mot_path, top_level_folder) for trace in os.listdir(top_level_folder_path): trace...
76be2215b95b6ab48d38e4e8906458ffa4f82c108d0a82f33b644473236a973c
Python
4,548
129
# Copyright (c) OpenMMLab. All rights reserved. import copy import torch import torch.nn as nn from mmcv.runner import OptimizerHook from mmcv.utils.parrots_wrapper import _BatchNorm from ..utils import allreduce_grads from .utils import cast_tensor_type class Fp16OptimizerHook(OptimizerHook): """FP16 optimizer...
3ec342e8a7df7e42a49a802d0be392a4c7083dc266003e17a731a492389b2b17
Python
4,551
136
# Copyright 2019 DeepMind Technologies Limited # # 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 agr...
6ffa99f23913918b6e5691b869d87f364a699f4f78a65556892177ee03fd44db
Python
4,552
121
# Copyright 2019 DeepMind Technologies Limited # # 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 agr...
dd547a1d1ae973dca0389cecb3a319d530d64f201abcf036c539294fd54b836e
Python
4,557
203
# Copyright 2019-2021 The ASReview 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 appl...
7366132ced596dc2ab4b5384aba5e45bb4c7ecae131b8a7c106646166175483d
Python
4,560
129
# Copyright 2019 DeepMind Technologies Limited # # 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 agr...
816790cc8467e49ad814b716ffe5f97e3ce7ced4bc1ccbece743714293088933
Python
4,562
129
import timm import torch import torch.nn as nn from torchvision import models from utils.func import print_msg, select_out_features def generate_model(cfg): model = build_model(cfg) if cfg.train.checkpoint: if cfg.dist.distributed: loc = 'cuda:{}'.format(cfg.dist.gpu) weights...
76478263eaed33dcd05ae6846465fe8f031176ade8818f2b627ce320b5e05a14
Python
4,564
125
# -*- coding: utf-8 -*- # # Copyright © 2013 Charles E. Vejnar # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://www.mozilla.org/MPL/2.0/. # """Interface with the `ReadKnead <https://git.s...
d9855b1c6ab8c3eaf748c0278d30a82bd70b547101dee85986741319603e2fcf
Python
4,566
148
""" @authors: stanislas chambon / Alexandre Gramfort goal: edf annotation reader Modified: Alexander Neergaard Olesen, Stanford University, 2018 """ import re import numpy as np import pandas as pd import xmltodict def read_edf_annotations(fname, annotation_format="edf/edf+"): """read_edf_annotation...
c73fb3919662a7deee46b3ca9806b9a428464c57653eafb5913d7e23cda49b2f
Python
4,567
118
# Copyright 2019 DeepMind Technologies Ltd. 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 appl...
3bc35b691107cea241cca9ce7dd3802cb21778d95ecea9f31f88a98b5e540513
Python
4,569
158
# Copyright (c) ONNX Project Contributors # # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations __all__ = [ "C", "ONNX_DOMAIN", "ONNX_ML_DOMAIN", "AI_ONNX_PREVIEW_DOMAIN", "AI_ONNX_PREVIEW_TRAINING_DOMAIN", "has", "register_schema", "deregister_schema", "get_sch...
bd10141343eabb166780b1b3aecdfd276d6e2582d47c8c2ad66bdc50ede2cd0c
Python
4,572
136
# SPDX-License-Identifier: LGPL-3.0-or-later import tempfile import unittest from pathlib import ( Path, ) import h5py import numpy as np from deepmd.utils.data_system import ( process_systems, ) from deepmd.utils.path import ( DPH5Path, DPPath, ) class PathTest: path: DPPath def test_numpy...
3384df3fb1784021d45e6806a9bcf8d19a0b60946ea35c97f844f6d3b00b5346
Python
4,573
122
"""RNG reproducibility, seed-type equivalence, thread safety, and non-pollution of ``numpy.random`` global state. These tests pin the behaviour contract that PR #178 established when the code base moved from the legacy ``numpy.random.seed`` / ``np.random.randint`` (global-state) pattern to per-call ``numpy.random.Gene...
c51d1952a1a02bfd7b3e5e530f4a88c152460973c381e3b4438f1972b770bcf5
Python
4,576
158
#!/usr/bin/env python3 -u # copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Implements outlier detection from pyOD.""" import numpy as np from skbase.utils.dependencies import _check_soft_dependencies from sklearn.base import clone from sktime.detection.base import BaseDetector __author__ = ...
1a0105effae3f9e38555cd5cfbebafe23b54dc457529df7136c211fbb6a43b63
Python
4,577
138
# -*- coding: utf-8 -*- #import os #os.environ["CUDA_VISIBLE_DEVICES"]= "3" # # Description : # Patching training data for QSMnet # # Input : # RDF : the tissue field # QSM : the COSMOS susceptibility # x : Serial number of subjects # y : the orientation of each subject # z : the number for data augmentation ...
edbde9fbb286f5326ee1b1486b3c1c21c5ce01941a04355eb51f320f7623f8f9
Python
4,581
136
# Copyright 2019 DeepMind Technologies Limited # # 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 la...
ad0df930e6203de1c99451818ed269f19d6460f7949465eff89721d1b3c0f75f
Python
4,582
144
# Copyright (c) ONNX Project Contributors # # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np import onnx from onnx.backend.test.case.base import Base from onnx.backend.test.case.node import expect class Clip(Base): @staticmethod def export() -> None: node =...
076083e9c0a123b9d5b83db99f8615645df78e57e392274ce86c70905b25691e
Python
4,584
139
import fnmatch import os import random from typing import List import networkx as nx import numpy as np import torch from torch_geometric.data import HeteroData from torch_geometric.utils import to_networkx def get_mcs(pairs_list: List[HeteroData]) -> np.ndarray: MCS = [] for hetero_data in pairs_list: ...
c8d42bf8a5ed5c671732e655c95f96e04e8d89de3e7cf8f31803df9c76b12994
Python
4,584
114
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc import lock_server_pb2 as lock__server__pb2 class LockServerStub(object): # missing associated documentation comment in .proto file pass def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. ...
cdaf3048b05a3a4bbb7b88f4d3f278379338c88640022efbab94cb27d19ecc39
Python
4,585
93
# Copyright 2019-2026 The AmpliGraph Authors. All Rights Reserved. # # This file is Licensed under the Apache License, Version 2.0. # A copy of the Licence is available in LICENCE, or at: # # http://www.apache.org/licenses/LICENSE-2.0 # from ampligraph.datasets import GraphDataLoader, NoBackend from ampligraph.data...
d44b28690aeff872d33178346b955f2eb189b1176cc60d0aeb3c1b3f6f400cca
Python
4,586
156
"""Tests for bcblib.imaging.math.""" import numpy as np import nibabel as nib import pytest from bcblib.imaging.math import ( binarize, threshold, dilate, erode, apply_mask, apply_inverse_mask, add, subtract, multiply, _dilate_array, _erode_array, _mask_in_array, _m...
5fb1722a07616a8ddecd25906743008c3c65421df4e52fb86b80fadf445a33e7
Python
4,588
129
# Copyright 2018-2025 # Institute of Neuroscience and Medicine (INM-1), Forschungszentrum Jülich GmbH # 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/LICE...
ccb6b821ac22f4414c88e471fb22370c66f542ed0c939519dc8651e7ff9bfa07
Python
4,591
140
# Copyright 2026 DeepMind Technologies Limited # # 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 agr...
dbfa4f25ada978c48795dded459e04dd4efcc7e03e6422ba6ad1ecaa70925951
Python
4,601
138
#%% [markdown] # # *C. elegans* connectomes #%% import datetime import time import networkx as nx import numpy as np import pandas as pd from graspologic.plot import adjplot from pkg.data import DATA_PATH from pkg.utils import create_node_data, ensure_connected, select_lateral_nodes FILENAME = "process_c_elegans" D...
c8b025da072e5eb7a91131beebb39f02e36dd5b71712ac8a7745fb87b2bd3f9d
Python
4,605
125
# Copyright (c) OpenMMLab. All rights reserved. import torch.utils.checkpoint as cp from ..builder import BACKBONES from ..utils.se_layer import SELayer from .resnet import Bottleneck, ResLayer, ResNet class SEBottleneck(Bottleneck): """SEBottleneck block for SEResNet. Args: in_channels (int): The i...
dfaeaa154fcea6cc8e29f36d33f3a2915242954eeb1979f12f7784660ae4193a
Python
4,606
154
# -*- coding: utf-8 -*- """ Created on Fri Aug 2 17:50:36 2019 @author: daniel """ # -*- coding: utf-8 -*- """ Created on Thu Dec 15 17:48:41 2016 @author: daniel """ from neuron import h import d1msn as msn #import iMSN import spillover_experiment as pe import pickle import parameters as p import matplotlib.pyplo...
5804ecef8bdfffc72f8e0978d1b27cff0d29bd3027d7ccbd9a781117284707bd
Python
4,607
110
""" Two iteration weighted average smoothing of each surface measure. Parameters: --------- ndl: vertex neighbors from {h}.pial.neighbor.asc file nb: number of neighbors from {h}.pial.neighbor.asc file each surface measures from their corresponding text files (SI,H,K,k1,k2,thickness) Returns: ------ ...
84b36d9785220d090dc573f6890254006b9bd2a7964fc3f727e28ad532c899be
Python
4,607
102
# Copyright 2019 DeepMind Technologies Limited # # 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 agr...
a2e676d59e1082e0d8111ac020d3c03d89ada32d04278a29a2a6922495a62cdb
Python
4,607
186
# Copyright 2026 DeepMind Technologies Limited # # 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 agr...
ef9f4e7eca2058a35c7ff0feb832f9f88d2d3db5ba2f5f4f92f838b9e274f135
Python
4,607
115
""" Inspect file structure for simulation output Print a report to the terminal. This module is part of *vcnmodel*. Support:: NIH grants: DC R01 DC015901 (Spirou, Manis, Ellisman), DC R01 DC004551 (Manis, 2013-2019, Early development) DC R01 DC019053 (Manis, 2020-2025, Later development) Copyright 2...
c08590e55cca92309a36414e4f0bb78395d171cb26c8675f3713a079c303d781
Python
4,608
125
# Copyright 2019 DeepMind Technologies Ltd. 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 appl...
7555feba0724285ae6528c02bdd223840ef68129c92b92b339e867c11bde5640
Python
4,616
180
import numpy as np from scipy import interpolate from scipy.optimize import brentq def poli2(x, p1, p2): x1, y1 = p1 x2, y2 = p2 a = -(y1 - y2) / np.power(x1 - x2, 2) b = -2 * a * x1 c = y2 - a * np.power(x2, 2) - b * x2 return a * np.power(x, 2) + b * x + c def csigma(x, p1, p2): x1, ...
27e612ed47ab46359eda338fef2fea65716e637a8ad6e9ee5934285a3b1138a7
Python
4,620
141
""" @file: alpha_vile.py Created on 30.03.23 @project: CrazyAra @author: queensgambit Description of the AlphaVile architecture for the sizes tiny, small, normal and large. """ import random from DeepCrazyhouse.src.domain.neural_net.architectures.pytorch.rise_mobile_v3 import RiseV3 def get_alpha_vile_model(args, m...
0de0cfbe61c0acbc018b244c64b99d662b81f755fbcb40fd81d17b68915a82cf
Python
4,621
117
import os import dotenv as de import numpy as np import pandas as pd import torch from atom3d.datasets import LMDBDataset from atom3d.util.voxelize import dotdict, get_center, gen_rot_matrix, get_grid from torch.utils.data import DataLoader de.load_dotenv(de.find_dotenv(usecwd=True)) class CNN3D_TransformMSP(obje...
c999b0963340e252e899a2d853fcb3203b7bcf727bae5a23bda1f9b0864984e1
Python
4,622
148
#!/usr/bin/python """ Basic test of cnmodel decorator on simple cell Uses LC_bushy.hoc and XM13 mechanisms. """ __author__ = "pbmanis" import sys import numpy as np import timeit import pyqtgraph as pg import cnmodel.cells as cells import cnmodel.decorator as Decorator from cnmodel.util import pyqtgraphPlotHelpers...
303dfb32205b0756ffdd417c5bd4d21c498431e26928f23bb823633dfb67910d
Python
4,623
121
from unittest.mock import patch import torch from mmcv.utils import digit_version from mmcls.datasets import build_dataloader class TestDataloaderBuilder(): @classmethod def setup_class(cls): cls.data = list(range(20)) cls.samples_per_gpu = 5 cls.workers_per_gpu = 1 @patch('mmc...
a89291d04fc0b08ecc83019468fb8c3469ecc8f5c5efb147b7447c609cf1fd3b
Python
4,625
143
import pandas as pd import numpy as np import matplotlib #matplotlib.use("Agg") import seaborn as sns from matplotlib import pyplot as plt import sys colors2 = sns.color_palette("Set1", 12)[6:] colors = [(0.6, 0.6, 0.6)] * 12 def read_dfs(i, j): df = pd.read_csv(sys.argv[i], sep="\t", index_col="sample") ...
ed8dec9e17549e17631e5d96ab983ff024cae7c94d0e9329415aab11ddfa701d
Python
4,626
129
import os import copy import math import numpy as np from sklearn.metrics import confusion_matrix import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from torch.nn.utils.rnn import pad_sequence from model import AcrNET device = torch.device("cuda:0" if torch.cuda.is_availa...
eaf736da05f8d68ae8c86fa2117e2ac18dbe8b9b5295931c39e9a8867c54552a
Python
4,628
147
# Copyright 2023 DeepMind Technologies Limited # # 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 agr...
eff17d1fc8ba31c562d443c5baccc1cc21657119376fa84e96f659137aece242
Python
4,630
139
# coding=utf-8 # Copyright (C) 2021. Huawei Technologies Co., Ltd. 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 # # ...
fdbc0064cb5105d5380bfd09ace519dfb143197ac1b27b2de788611f8b00a946
Python
4,630
117
""" Evaluate models on synthetic data: experiments with the initialization of model weights. """ import os import numpy as np from six.moves import cPickle from tensorflow import keras from gradient_correction import helper, explain, model_zoo, geomath import tfomics #-------------------------------------------------...
c48667274973c33e65cbfd3594dfa82620273485bd54f707389d3cc99e0d46a4
Python
4,631
142
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) # Ported from skchange (BSD-3-Clause), original authors: johannvk """Rank-based change score for multivariate data.""" __author__ = ["johannvk"] import numpy as np from sktime.detection.base._base_interval_scorer import BaseIntervalScorer from s...
44f61f4f6acc78de04de2a5dac46cc9dc53b394692ba6e1c6d2f9bd3219fec8c
Python
4,632
93
from __future__ import print_function import numpy as np from parameterSetup import ParameterSetup def labels2ID(params, y_seq): return [params.correctedLabel2depthID[params.labelCorrectionDict[y]] for y in y_seq] def getEpisodeLengths(params, y_seq): episodeLengths = [[] for _ in range(len(params.correctedLa...
4dee0945d1b470d28d2860312fd7f887e660bbd0588b9492de435699c2e9b05e
Python
4,632
118
# Copyright 2019 DeepMind Technologies Limited # # 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 agr...
97370d1f6cf97363b089e349479c7946962bbd22f961c39a699cacd3dcfa1d47
Python
4,639
138
# Copyright 2019 DeepMind Technologies Limited # # 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 agr...
e6ff13eb460c374e656a527026224cc4b03d0e509b2e05050e5e30a671c48165
Python
4,639
123
""" @file: validate_train_results_util.py Created on 03.12.23 @project: CrazyAra @author: queensgambit Utility functions for validate_train_results.ipynb """ import sys sys.path.insert(0, '../../../') import chess import numpy as np from copy import deepcopy import chess.svg from IPython.display import SVG import tor...
70d8afdb417b07b088563a6575d7b1cbdf34fa49e971f00a42affccf97f6c483
Python
4,640
155
from __future__ import annotations from typing import cast from typing import NamedTuple from typing import TYPE_CHECKING import numpy as np from optuna.logging import get_logger from optuna.study import Study from optuna.trial import FrozenTrial from optuna.trial import TrialState from optuna.visualization._plotly_...
54bff25844504b8bbde6dca22d16f27fddf17ea907cc756a81b427ad62b7cf61
Python
4,641
156
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Output formatting utilities for detection results. Convert raw detection outputs (change point arrays, segment intervals) to the ``pd.DataFrame`` format expected by sktime's ``BaseDetector.predict()``. """ import numpy as np import pandas as p...
87483acdf1e850385e1b69338473aca9377e4e59787ac025a6cdbf7667cea7a8
Python
4,641
156
# In Nomine Functions Team # distributed under license: GPL 3 License http://www.gnu.org/licenses/ import json import r2pipe class RadareFunctionAnalyzer: def __init__(self, filename, use_symbol, depth): self.r2 = r2pipe.open(filename, flags=['-2']) self.filename = filename self.arch, se...
64cc70ea62bf13f58a79d3aeddd4c01da63217cc85e7ca45689b59de59f4b7fb
Python
4,642
155
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright © 2023 Charles E. Vejnar # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://www.mozilla.org/MPL/2.0/. # """Interface with the `m...
2d1075a4f010de2d4e90c8d35145a7d4b905f464bf97c09ddc93e3bf369ddd2f
Python
4,643
144
# Copyright 2019 DeepMind Technologies Limited # # 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 agr...
670a4bd50eed762cd6bc2c39a0c6935c9968246c200f57e00098f080e9a1133e
Python
4,643
170
#!/usr/bin/env python __doc__ = """ Miscellaneous Utils Nicholas Turner <nturner@cs.princeton.edu>, 2017 """ import importlib import datetime import shutil import types import os import re import torch from torch.autograd import Variable import numpy as np import h5py, tifffile __all__ = ["timestamp", ...
403209b896041e7e2351061deb7ff67f10d15518cca94e4cc2cfd6d6b8942555
Python
4,644
136
#!/usr/bin/env python # bax_to_bam 0.0.1 # Generated by dx-app-wizard. # # Basic execution pattern: Your app will run on a single machine from # beginning to end. # # See https://wiki.dnanexus.com/Developer-Portal for documentation and # tutorials on how to modify this file. # # DNAnexus Python Bindings (dxpy) document...
ec5d230989e4e4f593d72349ae1e10a148976cae3a4bd0ad23df26bac49ea2c2
Python
4,645
140
# tifffile/numcodecs.py # Copyright (c) 2021-2022, Christoph Gohlke # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, #...
f381810ff23fd2eacef7d60941bf150558a8c6ec288af73170ef610076f1a258
Python
4,651
146
""" Helper Module containing functions called by SFA_Func 03 13 2023 Code by R.W. DiTullio and C Parthiban """ import numpy as np import scipy as sp import matplotlib.pyplot as plt import scipy.stats as stat from sklearn.decomposition import NMF #################################################################...