sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
d38b3ef6cfa97d4026e5370a0a6e40e0e9d49bf385f7194cf4c1fbc19d35cf24 | Python | 7,055 | 217 | # 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... |
5a292dc6030119bf69332b4e737a50a66fee22073151df7600b616e8c98ebe8c | Python | 7,056 | 191 | """Delegator mixin that delegates all methods to wrapped classifiers.
Useful for building estimators where all but one or a few methods are delegated. For
that purpose, inherit from this estimator and then override only the methods that
are not delegated.
"""
# copyright: sktime developers, BSD-3-Clause License (... |
289db01ce88bea283696ec31ff752fb8008744e96e3942a9b5d5451f67915b57 | Python | 7,060 | 226 | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... |
59aa6eb08aee02672c31e507164b01ea577e9cabaebf9294e93fa6b9bce2f895 | Python | 7,060 | 194 | # SPDX-License-Identifier: LGPL-3.0-or-later
"""Format-independent configuration of training data groups."""
import logging
from collections.abc import (
Mapping,
Sequence,
)
from dataclasses import (
dataclass,
)
from typing import (
Any,
TypeAlias,
)
from deepmd.utils.data_path import (
Data... |
56d5abb4c27622e385c544dde1b377bf569dba2f571474c9e3c7990b02eb39ee | Python | 7,062 | 190 | """Operations to obtain different combinations of a molecular system.
"""
from itertools import combinations
def conf_defect_create_multiple(system, substitutions, opt='mult'):
"""Given a determined system, create all the possible combinations of its
atoms.
Args:
system (obj:`molecule.Molecule`):... |
bb62bd154a2809d10010bcca1e2fcaaf3d2ba23c7610e1c51e84b6e4af9db772 | Python | 7,066 | 166 | import configargparse as cfargparse
import os
import torch
import onmt.opts as opts
from onmt.utils.logging import logger
class ArgumentParser(cfargparse.ArgumentParser):
def __init__(
self,
config_file_parser_class=cfargparse.YAMLConfigFileParser,
formatter_class=cfargparse.... |
71aedfbe020929f6ae33ba9106547878ca9dc4c01e4369d186dd71da3b5da3ec | Python | 7,067 | 207 | import multiprocessing
import os
import os.path as osp
import time
import dill
import numpy as np
import pandas as pd
from rdkit.Chem import MolFromSmiles
from sklearn.ensemble import RandomForestRegressor
from molucn.evaluation.explain_color import get_scores
from molucn.evaluation.explain_direction_global import ge... |
18860298675c9b6cf6e913333124f9ff71031d2588acb7a75895edee0d1afcda | Python | 7,072 | 200 | import pytest
import pandas as pd
import numpy as np
import scanpy as sc
from anndata import AnnData
from palantir.presults import select_branch_cells
import palantir.presults
def test_select_branch_cells_basic():
"""Test basic functionality of select_branch_cells"""
# Create test AnnData
n_cells = 100
... |
a0fdb8e1ad66198cb91ca176f0ff6ed096c6b3a8c4e933f7838079a37b71a9d2 | Python | 7,073 | 179 | import argparse
from github import Github
import os
# Input variables from Github action
GITHUB_TOKEN = os.getenv('GITHUB_TOKEN')
PR_NUM = int(os.getenv('PR_NUMBER'))
WORK_DIR = os.getenv('GITHUB_WORKSPACE')
REPO_NAME = os.getenv('GITHUB_REPOSITORY')
SHA = os.getenv('GITHUB_SHA')
COMMENT_TITLE = os.getenv('COMMENT_TIT... |
f6dc35d2f3115848b28fc98e8e8251197c4d9280ed4ed240a06805e13ae1df62 | Python | 7,073 | 157 | # 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... |
af3170cc12f28c1e456019bbd79127245a028d29fdf9cc6eae0307e3e2dc0093 | Python | 7,075 | 149 | import pickle
import numpy as np
from scripts.preprocess import Seq, MultiSeq
def get_data(config):
print('Reading data')
if config.transfer_learning:
dir_path = f'data/{config.pre_train_data}/' # TODO - use tl data
conf = False
else:
dir_path = f'data/pre_train/{config.pr... |
621fcd873a7eae359c3ad0c379e14b917c8ff338070c1c3ce55a0c81b2bfa2e7 | Python | 7,086 | 142 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Main script of the pipeline. Run this only. Brief instructions are as follows:
mesh_pial_white: decimates and smoothens the pial and white triangular surface meshes
mesh_alpha: alpha surface is generated and saved as .ply from the pial surface
cort_thick: calculat... |
92cc1cccdec16d28567e059b58d238226bc6c40284556d0983fc8114984a1713 | Python | 7,086 | 202 | # SPDX-License-Identifier: LGPL-3.0-or-later
"""Numerical safeguards around the gradient of a training step.
Two hazards are handled here, both of which have to be addressed without
slowing the step down.
A gradient that is large but still representable can overflow the sum of
squares of a naive L2 reduction, so a fi... |
65eb2d814a33d3d78bb9aa1cd9232f24cc49d623557cfce873f5f269e076fddf | Python | 7,088 | 171 | # 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... |
6b1ea2b79d2e0f6793748f1400ee0987776417f810d7e0e55455243cdd904e02 | Python | 7,091 | 222 |
import numpy as np
import torch
import csv
from typing import Tuple
from skimage import io
import matplotlib.pyplot as plt
FIG_SIZE = (6,10)
FIG_SIZE_SUBPLOT = (12,20)
IMG_DIM = (1024, 1280)
IMG_DIM_R = (1280, 0)
def load_annotations(annotations: str, flip_right: bool = False) -> Tuple[list, np.array, int]:
... |
08de2c9870ef1b18a8d8ac24f041421ac5754148f48a6c58135993d01a85bd94 | Python | 7,095 | 183 | #!/usr/bin/env python3
import re
from pathlib import Path
from collections import namedtuple, OrderedDict
import rdflib
import requests
from pyontutils.scigraph import Vocabulary, Graph
from pyontutils.obo_io import OboFile, Header, Term, TVPair
from pyontutils.core import makePrefixes, createOntology
try:
breakpo... |
8a4b5ef2d851731abcd690148b2f3add67757c421679158a3701524ea139cf30 | Python | 7,099 | 204 | # 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... |
11aafcff3015d03c811bcd92a4e53c88a374b966798f5f4ffda707c2e4109995 | Python | 7,107 | 184 | import os
import h5py
import math
import numpy as np
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Geometry import Point3D
from openmm.unit import *
import torch
from torch.utils.data import Dataset
from torch_geometric.nn import radius_graph
from torch_geometric.data import Data
from torch_geometri... |
e9139e6877d9f3ab2eb3f17f278eb3ad23d32c8f057dc18f77e69ffe2e75d398 | Python | 7,112 | 163 | # -*- coding: utf-8 -*-
"""
Created on Thu Aug 31 15:44:21 2017
@author: daniel
"""
import parameters as p
from neuron import h
from random import randint
import time
import sys
class Experiment(object):
def __init__(self):
self.inc = []; self.istim = []
self.enc = []; self.estim = []
... |
ae88cfefa687c6a4c8bb91efe8751b5312cf2d34c3b3c5f35c41acea439cb3a3 | Python | 7,115 | 186 | """Dependency-free checks for the reorganized release contracts."""
from __future__ import annotations
import ast
import csv
import json
import re
import statistics
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
def _text(relative_path: str) -> str:
return (ROOT / relative_path).read_text... |
e66ae963f35afc2bfb814f2336e8a7587c7a7623f91aca7a99e2438e181d8b7f | Python | 7,116 | 129 | """Frozen, nested source-only preparation for the 2026-09 unified benchmark."""
from pathlib import Path
import json
import numpy as np
from scipy import sparse
from .conservative_train import make_context, source_split
from .data import load_dataset, choose_input_genes, normalize_log_cpm
from .matrix_benchmark impor... |
327064f240408e1eba8234bc3e241674ea10048a2476d421096730e874d0e4f8 | Python | 7,121 | 157 | """
Evaluate models on synthetic data: classification and interpretability performance.
"""
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
#------------------------------------------------------... |
d7d67b5bc782bbbde207c9a72485141aa48e6db49e0824f588b3285bfe6393d8 | Python | 7,121 | 184 | """Utilities for loading datasets that are unapproved of in the main repo.
Old code, delete.
"""
__author__ = [
"Emiliathewolf",
"TonyBagnall",
"jasonlines",
]
import numpy as np
import pandas as pd
from sktime.datatypes._panel._convert import (
from_nested_to_2d_np_array,
from_nested_to_3d_nump... |
26e1a775231073454739fd55907daae760a5a83f1bcf48511b253623095b475d | Python | 7,122 | 169 | # 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... |
83b575feeb32e8ad19687cf6a33ca937c0877094eb158fa9c84d69d272fd399f | Python | 7,123 | 206 | # 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... |
e934dcfe4b5374968c0541abffae6c7caaa065a41994584b420d372d92ba24aa | Python | 7,123 | 222 | #!/usr/bin/env python3
"""run rdflib performance tests
Usage:
rdflib_profile [options]
Options:
-s --setup run setup only
-p --pipenv setup pipenv
-l --local run tests in the parent process rather than forking
"""
from __future__ import print_function
import os
import sys
import string
... |
bd24dacd83d3f00621381acdee4cb97695dd1022f7b2af54038f1d137e3adf01 | Python | 7,125 | 234 | from __future__ import print_function
import numpy as np
from .augment import Augment, Blend
from .flip import FlipRotate
from .track import Track
from . import utils
__all__ = ['Misalign','MisalignPlusMissing',
'MisalignTrackMissing','SlipMisalign']
class Misalign(Augment):
"""Translational misalig... |
ee7f08448e58542b0146e055c3763a12080cfd3635972048a4124dfb6a221222 | Python | 7,127 | 211 | # coding=utf-8
# 2021.03 modified (1) golem(def) to GOLEM(class)
# (2) replace tensorflow with pytorch
# 2021.03 added (1) get_args, set_seed;
# (2) BaseLearner
# 2021.03 deleted (1) __main__
# Huawei Technologies Co., Ltd.
#
# Copyright (C) 2021. Huawei Technologies Co., Ltd. A... |
2228cb0c02d7ff485507ca44d9d1db0550b760fb6606cbe8bc1a73bfb5237392 | Python | 7,129 | 198 | # Copyright (c) OpenMMLab. All rights reserved.
import os.path as osp
import pickle
import shutil
import tempfile
import time
import mmcv
import numpy as np
import torch
import torch.distributed as dist
from mmcv.image import tensor2imgs
from mmcv.runner import get_dist_info
def single_gpu_test(model,
... |
193c7429ed0763b3a906bce66a0a7efe98320784323204a4f2f4faa29b4aecf0 | Python | 7,130 | 221 | # 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... |
cf624d1c52bc8238807b4738f5d0b35831afca40ba14ca23f1d40944dc8080ab | Python | 7,133 | 181 | import argparse
import logging
import os
import time
import datetime
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader
from model import GNN_PPI, MLP_PPI
from data import PPIDataset, CollaterPPI
from scipy.stats... |
0978f3f7c2c0a0e9de722dc05e13ea6cad735829a7741a3a90ee06eaaeaab1ee | Python | 7,135 | 136 | # Copyright 2007 Zachary Pincus
# This file is part of CellTool.
#
# CellTool is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
"""Add landmark points to contours from a given set of images.
In so... |
fb4c71659a24237773904058552d3b709aea20b4cc64ac9b0d63b268135da879 | Python | 7,137 | 142 | """Seasonal-Naive normalised aggregate over GIFT-Eval configs.
GIFT-Eval reports one MASE / CRPS pair per (dataset, term) config. The headline
number used throughout this project is the geometric mean of those values after
dividing each by the Seasonal-Naive baseline for the same config, so that
datasets on wildly dif... |
86ab46609f20a38aefd5b573d4b102bc7665c8987a6c5863ce05b2a802003316 | Python | 7,141 | 205 | import os
import h5py
import torch
import pytest
import numpy as np
from PIL import Image
from os.path import join as pjoin
from dnnbrain.dnn import core as dcore
from dnnbrain.dnn import models as db_models
from dnnbrain.dnn.base import VideoClipSet
DNNBRAIN_TEST = pjoin(os.environ['DNNBRAIN_DATA'], 'test')
TMP_DIR ... |
9d4cceecb66b075a941efff2871716ef41a303a631620ba30171730db418a7ff | Python | 7,144 | 151 | """
@file: input_representation
Created on 26.09.19
@project: CrazyAra
@author: queensgambit
Input representation for all available lichess chess variants board states (including crazyhouse)
which is passed to the neural network
"""
import numpy as np
import DeepCrazyhouse.src.domain.variants.classical_chess.v2.inpu... |
0d6792ae3f66781933452719a2c7b41d517c934d05f947d0bd3ac1a98901275a | Python | 7,148 | 158 | import pickle
import numpy as np
from os import listdir
from os.path import dirname, abspath
from stagePredictor import StagePredictor
from statistics_processing import recompMean, recompVariance
from algorithmFactory import AlgorithmFactory
from parameterSetup import ParameterSetup
from sequentialPrediction import vot... |
6492d905be92d3c600ef19ab8ec04c912367a8225f0840a5509ac08cb19cd7cf | Python | 7,148 | 181 | import sys
def superclasses_bug_fix(term_data):
if term_data.get('superclasses'):
for i, value in enumerate(term_data['superclasses']):
try:
term_data['superclasses'][i]['superclass_tid'] = term_data[
'superclasses'][i].pop('id')
except:
... |
f15b622624225be982e17aa75b6e5364fe5b8cc5e0bf1eef0fc3c70addece963 | Python | 7,148 | 224 | """Helper classes for organizing docopt programs
Usage:
clifun-demo [options]
clifun-demo sub-command-1 [options] <args>...
clifun-demo sub-command-2 sub-command-1 [options] <args>...
Usage-Bad:
Example:
clifun-demo [options] <args>...
clifun-demo cmd [options]
Reason: <args>... ma... |
03ae754e0eb7dbf6bf73fca3c6cf85256fdda2e432cd2241a020da7787b1a559 | Python | 7,151 | 188 | # 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... |
21292b934e08e97f7eec7b9538418dba7bb4a899b1ef42412cd42b3a2dffdfe2 | Python | 7,151 | 209 | # SPDX-License-Identifier: LGPL-3.0-or-later
"""The three Uni-Mol v1 pretraining heads.
Ported from Uni-Mol (https://github.com/deepmodeling/Uni-Mol) at commit 90f52c4,
MIT licensed:
Copyright (c) DP Technology
This source code is licensed under the MIT license found in the LICENSE
file in the root direct... |
1103adfe6c590d75676d6138ed18450788ed30937df9c856d8434173de994151 | Python | 7,153 | 119 | from collections import OrderedDict
from vp_suite.model_blocks.traj_gru import Activation
from vp_suite.model_blocks import TrajGRU
from vp_suite.models.precipitation_nowcasting.ef_blocks import Encoder_Forecaster
class EF_TrajGRU(Encoder_Forecaster):
r"""
This is a reimplementation of the Encoder-Forecaster... |
07108a5981238fe0b82627dd329b401c9dd46461e33d69a35d97bdea6150be42 | Python | 7,155 | 247 | # 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 ReduceSum(Base):
@staticmethod
def export_do_not_keepdims() ->... |
9d708c93d3eea613bebe0ec2bbbcfb49b8ab7beb9e306ae92afad76809504b59 | Python | 7,156 | 209 | from __future__ import annotations
from contextlib import AbstractContextManager
from contextlib import contextmanager
import os
import socket
import sys
import threading
from typing import Any
from typing import Generator
from typing import IO
from typing import TYPE_CHECKING
import fakeredis
import optuna
from opt... |
77dc6b61e22051460a2af3e42995eb29932a71a60d7052a860df39563c43c5a6 | Python | 7,167 | 243 | # 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... |
f136b4da01620ac00c781abc6a829f1382e374932b1558992c3e0f8984411d0c | Python | 7,168 | 200 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed May 4 11:43:01 2022
last update 3/11/2023
@author: sudhanshu
"""
import sys
sys.path.append('..')
from prediction_utils import load_model, predict_for_protein_and_mask2, command_run
import time
import os
from data_preparation.pdb_2_interaction_file_con... |
ff77fc36b3a099aae4fe98f0e244cd226b80ba4d987a46f8e5fde1739bd8553a | Python | 7,170 | 201 | # 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
def grouped_matmul(
input: np.ndarray,
weights: np.ndarray,
grou... |
93267fea39625ae171f7b97922bda4d8b64609f8764a69a4a81d1b4387e25268 | Python | 7,171 | 171 | # 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 load_wn18, load_fb15k, load_fb15k_237, load_yag... |
4f4c4ebdfa63192425a26666a76b3e7f8d4971f4cb8770d30369c43cb9d66e3e | Python | 7,172 | 207 | import os
from datetime import datetime
import shutil
import sys
from pytz import timezone
# cellline folder, test, K562, A549, HUH7, NB4 or SKNMC
if len(sys.argv) >= 2 and not sys.argv[1].split("/")[-1].startswith("run"):
cellline = sys.argv[1].split("/")[-1]
elif len(sys.argv) >= 2:
cellline = sys.argv[1].sp... |
fe2e9a2e7b57e38972a6a51b9933593cd1a3ba3e8bcf41a6307294a8e0d608ae | Python | 7,173 | 207 | import os
from datetime import datetime
import shutil
import sys
from pytz import timezone
# cellline folder, test, K562, A549, HUH7, NB4 or SKNMC
if len(sys.argv) >= 2 and not sys.argv[1].split("/")[-1].startswith("run"):
cellline = sys.argv[1].split("/")[-1]
elif len(sys.argv) >= 2:
cellline = sys.argv[1].sp... |
b45776bda5735b440abb2a47bfe9f7382826b264c3e8aed6596b4fad574bdb49 | Python | 7,174 | 189 | import numpy as np
import matplotlib.pyplot as plt
from scipy.ndimage import rotate
# equal scaling solution from @AndrewCox from https://stackoverflow.com/a/63625222
# Functions from @Mateen Ulhaq and @karlo
def _set_axes_equal(ax: plt.Axes):
"""
Set 3D plot axes to equal scale.
Make axes of 3D plot have... |
5342e1f3208fb185a669c5d84b63f381ce6eececbe62f840b4fd9168e54e6041 | Python | 7,182 | 194 | from __future__ import annotations
import numpy as np
import pytest
import torch
from optuna._gp.gp import ConditionalGPRegressor
from optuna._gp.gp import GPRegressor
from optuna._gp.gp import warn_and_convert_inf
import optuna._gp.prior as prior
from optuna._gp.qmc import sample_from_normal_sobol
@pytest.mark.par... |
8d0888238d8bd5d71eaf2af3941fb2274be1caeb588677f241506648f4ddda4a | Python | 7,182 | 226 | """Tests for the edger-summary subcommand."""
from pathlib import Path
import pytest
from corset_tools.edger_summary import (
add_membership_columns,
filter_de_table,
run_edger_summary,
summarise_membership,
write_annotation_records,
)
from corset_tools.fileio import read_cluster_map, read_fasta
... |
090878583279f9958053083042ec3e3fd31b2e3d181ada8307887209cbf998fe | Python | 7,183 | 208 | import os
from datetime import datetime
import shutil
import sys
from pytz import timezone
# cellline folder, test, K562, A549, HUH7, NB4 or SKNMC
if len(sys.argv) >= 2 and not sys.argv[1].split("/")[-1].startswith("run"):
cellline = sys.argv[1].split("/")[-1]
elif len(sys.argv) >= 2:
cellline = sys.argv[1].sp... |
3b25b5e1ee79d8614c123be77b3ca479dc94a54638b5d1dab11a4f60ad8f54d4 | Python | 7,188 | 234 | import shutil
from pathlib import Path
import ants
import pytest
import torch
from omegaconf import DictConfig
import hsf.engines
import hsf.factory
import hsf.fetch_models
import hsf.multispectrality
import hsf.roiloc_wrapper
import hsf.segment
import hsf.uncertainty
from hsf import __version__
def test_version():... |
6f6e8ce9ac3427263791830bac05ad49da998ceffe2914c6506eeb7b367c1667 | Python | 7,188 | 201 | # SPDX-License-Identifier: LGPL-3.0-or-later
from typing import (
Any,
)
import torch
from deepmd.pt.loss.loss import (
TaskLoss,
)
from deepmd.pt.utils import (
env,
)
from deepmd.pt.utils.env import (
GLOBAL_PT_FLOAT_PRECISION,
)
from deepmd.utils.data import (
DataRequirementItem,
)
from deepmd... |
44be0692137a3f8b23501f3b5c985eddcd4caf9a7c67aa912281e31722fafe20 | Python | 7,189 | 190 | '''
architecture for sft
'''
import torch.nn as nn
import torch.nn.functional as F
class SFTLayer(nn.Module):
def __init__(self):
super(SFTLayer, self).__init__()
self.SFT_scale_conv0 = nn.Conv2d(32, 32, 1)
self.SFT_scale_conv1 = nn.Conv2d(32, 64, 1)
self.SFT_shift_conv0 = nn.Conv2... |
6651fd9ae42cd9939514132ee33fadd9e22f163966dcffefae11d98379578b78 | Python | 7,193 | 183 | # Functions for sampling points from a 2D segmented image
import os
import warnings
import itertools as it
from typing import List, Iterator, Tuple
import numpy as np
import numpy.typing as npt
from skimage import measure
import tifffile
from scipy.spatial.distance import pdist
from pathos.pools import Proc... |
12de68b96e9fe801fccd61a69c3b34f29001641ba47cf2bc8b310d157056232c | Python | 7,196 | 220 | # 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... |
bb741453f737c7cf0e2e90d7bccbcf129218f302f7164963ccfd5cf3974c3938 | Python | 7,196 | 229 | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... |
208fb2ae2b161e69b0c0b5fce1c14fe1268aa63cd7964334a2daee4fe92150b0 | Python | 7,202 | 239 | # 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... |
629971b3b51ff10591b700e75df78b4f862d290117e9124c1167b5d17bf53209 | Python | 7,203 | 208 | """Testing feature_kind inference with categorical data"""
__author__ = ["Abhay-Lejith"]
import pandas as pd
from skbase.utils.dependencies import _check_soft_dependencies
from sktime.datatypes._dtypekind import (
DtypeKind,
_get_feature_kind,
_get_panel_dtypekind,
_get_series_dtypekind,
_get_tab... |
4d8987ba2c9908f399e53ca714e5cb8a743fdd3bd8443bba5bb53a2b33bb4713 | Python | 7,205 | 215 | import numpy as np
from graspologic.utils import largest_connected_component
import pandas as pd
def get_paired_inds(meta, check_in=True, pair_key="pair", pair_id_key="pair_id"):
pair_meta = meta.copy()
pair_meta["_inds"] = range(len(pair_meta))
# remove any center neurons
pair_meta = pair_meta[pair_... |
8394744cb4361d8dae9ce3d46c6ab5ba04bc97f2e53e6ddb184a80214b192c66 | Python | 7,206 | 208 | """Martrix Profile classifier.
Pipeline classifier using the Matrix Profile transformer and an estimator.
"""
__author__ = ["MatthewMiddlehurst"]
__all__ = ["MatrixProfileClassifier"]
import numpy as np
from sklearn.neighbors import KNeighborsClassifier
from sktime.base._base import _clone_estimator
from sktime.cla... |
36052f6a109fb929d965bc295194fe4c8fb12ba39d423b9e269e117475cc793d | Python | 7,208 | 223 | # -*-coding:utf-8-*-
# from __future__ import absolute_import
import torch.nn as nn
import torch.nn.functional as F
import math
def conv1x1 (in_planes, out_planes, stride=1):
return nn.Conv2d(in_planes, out_planes, kernel_size=1, stride=stride, bias=False)
def conv1x15 (in_planes, out_planes, stride=(1,2), pad... |
ed60b801aec4faf3e1435677c751f9db907c4d289f56b5ede0721d5f6566c086 | Python | 7,214 | 194 | import os
import numpy as np
from math import sqrt
from scipy import stats
from torch_geometric.data import InMemoryDataset, DataLoader
from torch_geometric import data as DATA
import torch
class TestbedDataset2(InMemoryDataset):
def __init__(self, root='/tmp', dataset='davis',
xd=None, pocket_g... |
598e6ac07adb2b3f186319876707fc4ac40a9b00904da2c963d4d11e561cae32 | Python | 7,219 | 197 | # 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... |
abffd2fc1ee16de133550a606e3b884d3c06262038d9829a8cb64d5d49034798 | Python | 7,220 | 201 | # SPDX-License-Identifier: LGPL-3.0-or-later
"""Run native-spin conventions through a real host or CUDA Kokkos plugin.
Each MPI process uses the same GPU, so two-rank coverage needs only one device.
Host-staged communication deliberately does not require CUDA-aware MPI.
"""
from __future__ import (
annotations,
)... |
ca312982bf604a8567615ca5f662bb30f71126b244dca0fab247efe6d52f7b44 | Python | 7,220 | 219 | """
Cell and Spot Label Processing Module for pciSeq
This module provides core functionality for processing and analyzing spatial transcriptomics data,
specifically handling the relationship between cell segmentation and RNA spot detection.
Key Functions:
-------------
- inside_cell: Maps RNA spots to their containin... |
96e3de36445e4bc33e57e2320a6d676b3900e71ae29d2d3381cb05e7f2b7a61e | Python | 7,223 | 208 | """Binary segmentation change point detector."""
from collections import deque
import numpy as np
import pandas as pd
from sktime.detection.base import BaseDetector
__author__ = ["Alex-JG3"]
class BinarySegmentation(BaseDetector):
"""Binary segmentation change point detector.
This method finds change poi... |
0fe4618283343aec7f30c79019c4714aa45c3f0ff5f9e622593d15a7fe5d5756 | Python | 7,226 | 200 | """
The Eigenangle Test is introduced in Gutzen, Grün, Denker (2023)
doi:10.1016/j.biosystems.2022.104813
"""
import numpy as np
from scipy.linalg import eigh
from scipy.integrate import quad
import matplotlib.pyplot as plt
import seaborn as sns
import sciunit
import math
from networkunit.scores import to_precision
im... |
6807afc305e0c437742c5dc42282b0f31ec547496be66840480fb5734564d374 | Python | 7,226 | 172 | # 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... |
f3edbe0212a0a8e82048afb974d307ee8e5bb2318b6717ddc6885e8dd733bf5a | Python | 7,230 | 224 | #!/usr/bin/env python3 -u
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""Tests for `evaluate` function for TSC.
`evaluate` performs cross-validation for time series
classification, here it is tested with various configurations.
"""
__author__ = ["jgyasu", "ksharma6"]
__all__ = ["TestEvalu... |
73303683ac342c769f55e3dcbd962264ea6a1c04cb29272c9424a41df641b94d | Python | 7,234 | 212 | # 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... |
74fc851c8ae4830738a4c15c9a366135ba8a730f11cda250bb08d31a568093a2 | Python | 7,234 | 202 | # SPDX-License-Identifier: LGPL-3.0-or-later
"""Backend-independent resolution of the training-step schedule.
A run length is expressed either directly in optimizer steps
(``training.numb_steps``) or as a number of passes over the training data
(``training.numb_epoch`` for single-task runs, ``training.num_epoch_dict``... |
88388b803dc5098eae079b24a13a062831e36d79f870787590465d30d2768e12 | Python | 7,234 | 210 | import tqdm
from enum import Enum
####
class Events(Enum):
EPOCH_STARTED = "epoch_started"
EPOCH_COMPLETED = "epoch_completed"
STEP_STARTED = "step_started"
STEP_COMPLETED = "step_completed"
STARTED = "started"
COMPLETED = "completed"
EXCEPTION_RAISED = "exception_raised"
####
class Stat... |
319c32d74e6bf4efa8ebaa03d3b7e34afd361806e8d1e85d152c49efeadaa7be | Python | 7,235 | 207 | import os
from datetime import datetime
import shutil
import sys
from pytz import timezone
# cellline folder, test, K562, A549, HUH7, NB4 or SKNMC
if len(sys.argv) >= 2 and not sys.argv[1].split("/")[-1].startswith("run"):
cellline = sys.argv[1].split("/")[-1]
elif len(sys.argv) >= 2:
cellline = sys.argv[1].sp... |
21ff95954c0ab15e1193449bc8cdefd22a6fdd26fc6884368178eff500d3abbf | Python | 7,236 | 207 | import os
from datetime import datetime
import shutil
import sys
from pytz import timezone
# cellline folder, test, K562, A549, HUH7, NB4 or SKNMC
if len(sys.argv) >= 2 and not sys.argv[1].split("/")[-1].startswith("run"):
cellline = sys.argv[1].split("/")[-1]
elif len(sys.argv) >= 2:
cellline = sys.argv[1].sp... |
373b03b33a5f22d6da60f12b39d654277823caf840953f7f4ac98c497497095e | Python | 7,236 | 207 | import os
from datetime import datetime
import shutil
import sys
from pytz import timezone
# cellline folder, test, K562, A549, HUH7, NB4 or SKNMC
if len(sys.argv) >= 2 and not sys.argv[1].split("/")[-1].startswith("run"):
cellline = sys.argv[1].split("/")[-1]
elif len(sys.argv) >= 2:
cellline = sys.argv[1].sp... |
c2808e562d120bf30f1eb706fe93989a00ef861af0badceb9d075ed8a2d1c872 | Python | 7,236 | 207 | import os
from datetime import datetime
import shutil
import sys
from pytz import timezone
# cellline folder, test, K562, A549, HUH7, NB4 or SKNMC
if len(sys.argv) >= 2 and not sys.argv[1].split("/")[-1].startswith("run"):
cellline = sys.argv[1].split("/")[-1]
elif len(sys.argv) >= 2:
cellline = sys.argv[1].sp... |
6a82f7e2a38300b4165d809c4c2f917b5313f6dc30aa5be59245c2df21e59c10 | Python | 7,237 | 207 | import os
from datetime import datetime
import shutil
import sys
from pytz import timezone
# cellline folder, test, K562, A549, HUH7, NB4 or SKNMC
if len(sys.argv) >= 2 and not sys.argv[1].split("/")[-1].startswith("run"):
cellline = sys.argv[1].split("/")[-1]
elif len(sys.argv) >= 2:
cellline = sys.argv[1].sp... |
fb68d3d89e5b87bafd7194804b620e2a5034b017f984dac8ff0bba84664c8e77 | Python | 7,238 | 228 | import numpy as np
import tensorflow as tf
from tensorflow import keras
class Explainer():
"""wrapper class for attribution maps"""
def __init__(self, model, class_index=None, func=tf.math.reduce_mean):
self.model = model
self.class_index = class_index
self.func = func
def saliency_ma... |
de29482de5cf98f24ad62945b1767160ebd39a72602776e6104a6b3ccf80f52e | Python | 7,239 | 179 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import numpy as np
import random
import os
import rdkit
from rdkit import Chem
import csv
from gln.mods.mol_gnn.mol_utils import SmartsMols, SmilesMols
from multiprocessing import Process, Queue
import time
fr... |
bf5438e7ff83d4de83802a4fcb135de0ce088bd3da0d01db22d91ac1b3b78dd8 | Python | 7,240 | 207 | # Copyright (c) OpenMMLab. All rights reserved.
import copy
from abc import ABCMeta, abstractmethod
from typing import List
import mmcv
import numpy as np
from torch.utils.data import Dataset
from mmcls.core.evaluation import precision_recall_f1, support
from mmcls.models.losses import accuracy
from .pipelines import... |
81b4b9d8d29f009f846f40e664e1561bc3fba764dc847bfdbb41c309b68a9556 | Python | 7,243 | 117 | #a simplified version of step3.1 to train and test a phenotype confirmation model for rare disease entity linking.
#this version also allows the comparison among multiple types of BERT models: BERT, BlueBERT, PubMedBERT, SapBERT
from sent_bert_emb_viz_util import load_data, encode_data_tuple, get_model_from_encodin... |
dcec885b643a962967f0801402c36ceba268e47267dadc2700165ce70a0cbd3f | Python | 7,251 | 156 | """
1. Cycle-by-cycle philosophy
============================
Motivations behind the cycle-by-cycle approach.
Neural signals, like the example shown below, are analyzed in order to extract information about
brain activity. Basically, we process these signals in order to extract features that will hopefully
correlate ... |
728453d546a2bddef6fbd8ea027b3807491be2d316cf2f5763d96921f9b77fd1 | Python | 7,252 | 286 |
#=======================================================================================================================
# Copyright (C) 2021 Matvey Safroshkin, Grigory Arutyunov, Patrick Mueller
# Computer Vision Studio
# Friedrich Miescher Laboratory of the Max Planck Society
# Systems Biology of Development, Univer... |
54ca39fbf1328a1290aa872ed23da71448a31280880819629f497280077637c6 | Python | 7,253 | 257 | """
Copyright (C) 2024 Laboratory of Applied Bioacoustics / UPC. All rights reserved.
Use of this code is governed by the BSD 3-clause license which can be found in the
LICENSE file or is available at http://ETC.
This script can be used to access example manatee calls, inspect the
information that entered the class... |
33180ccacc71703782ad65a2b9a90c05b20cabcd6ce492866214b9580d629dac | Python | 7,257 | 205 | # 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... |
47ca34ecaa7a967c1c8a74b53a6ef937627850f85c8e939481b6246c10a94788 | Python | 7,258 | 171 | from IPython.core.debugger import set_trace
from src.utilities.DDE_Solver import ddeinttf
import src.utilities.findiff.findiff_general as fdgen
import src.burgers_eqn_case_findiff.burgers_eqn as burg
import numpy as np
import scipy as spy
import tensorflow as tf
import matplotlib.pyplot as plt
from matplotlib import ... |
f54b8d896a75d3c83a3e7f00c28d916085c2df5eb1789f851ca90b511e1dee52 | Python | 7,260 | 156 | # 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... |
10164c540cd00bffd3a66c9f8f0ec6c4c2f7ac7d56eef97ecd3379fb38f118c2 | Python | 7,262 | 172 | # Copyright 2018-2026
# 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... |
054e00784f3e902a1290fb29e38337f1d6311f926ccceafd1247cb7089f9e1ec | Python | 7,272 | 175 | import argparse
from biom import load_table
import pandas as pd
import numpy as np
from q2_matchmaker._stan import merge_inferences
import subprocess
import os
import tempfile
import arviz as az
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument(
'--biom-table', help='Bi... |
8b5929820d6d0b35fdeae2baf14c71aade49db65b2a617da0dc0202f209cb1eb | Python | 7,272 | 214 | """
Calculating intrinsic curvature index and folding index for the gyral (concave/outward),
sulcal(convex/inward) and saddle points of the cortex.
Introduced by Van Essen (1997) using Gaussian curvature, principal curvatures
and the sum of area of triangles meeting at each vertex.
Parameters:
----------
a: vertex-w... |
fdcd319deb055196d94326f85028c9bc53e7151c6ce70b531f7ade1aff80ff69 | Python | 7,275 | 191 | import numpy as np
from ..utils import _node_scale_vminvmax
from scipy.spatial.distance import euclidean
def _plot_nodes(ax, nodes, node_columnnames, node_color='salmon', node_size=20, **kwargs):
"""
Function that plots nodes in figure
Parameters
---------------
ax : matplotlib ax
nodes : data... |
201dc6707cdcd7585e60d40dd00d29723e09f60a40ac68cae575f64c050fd629 | Python | 7,279 | 209 | import os
import pyBigWig
import numpy as np
import pickle
import h5py as h5
import torch
import glob
import pandas as pd
import matplotlib.pyplot as plt
######## Data Preprocessing Utils ############
def load_chipseq(dir, chrom="chr1", resolution=100):
"""
Args:
dir: path to ChipSeq data
chro... |
6c394fcea4661067fd846ad30c067265ab22a4cf551af36932e1a9acb804b2dc | Python | 7,283 | 193 | from typing import List, Union, Tuple
import torch
from torch import nn as nn
class ScaleToTest(nn.Module):
r"""
This class acts as an adapter module that scales pixel values from the model domain to the test run domain.
"""
def __init__(self, model_value_range: List[float], test_value_range: List[fl... |
ea83e959457b3071dcef969953803fa1cd6679154093e541000c3e0c4c8db542 | Python | 7,288 | 251 | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
try:
from asreview import __version__ as asreview_verion
except Exceptio... |
ee873ae420c6097945318a352a897108836cedd3280263925448eb3dc0d53a30 | Python | 7,292 | 232 | __author__ = ["chrisholder", "TonyBagnall"]
import inspect
from collections.abc import Callable
import numpy as np
from sktime.dists_kernels._numba_distances.base import (
DistanceCallable,
MetricInfo,
NumbaDistance,
)
def _resolve_dist_instance(
metric: str | Callable | NumbaDistance,
x: np.nda... |
aebc44f058441066270010530a86649fadac280d47cf630fd8dee0a1048ca3dc | Python | 7,295 | 261 | # 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... |
f42a108c7ea2c0375683fd02125c889734ab2fe2bd4f37b531426883c0e22e44 | Python | 7,297 | 230 | import numpy as np
from matplotlib import pyplot as plt
from scipy.ndimage import label
from scipy.stats import mannwhitneyu, ttest_ind
from sklearn.preprocessing import RobustScaler
from tqdm import tqdm
def coord_in_array(coord, array):
"""
Check if a coordinate is within the bounds of a numpy array.
P... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.