sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
a7825754092faef20171a63e1c44e2c5a576504193cab0fa622e47e6b555ec30
Python
8,101
242
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Feb 10 12:08:20 2022 Last update: 3/11/2023 @author: sudhanshu Usage: python evaluate_on_testset.py Returns: Dice, DVO, and DCC for each file in ../dataset/test/pdb_npz/ """ import torch import os import numpy as np from prediction_utils import load_m...
c84bd6e4940ae88e67d1c0ef507eb3dcf26a30bc5d95519e758b0202ce898c09
Python
8,101
294
"""Test the move from (m,d) to (d,m).""" import numpy as np from sklearn import metrics from sktime.clustering.k_means import TimeSeriesKMeans from sktime.datasets import load_arrow_head, load_basic_motions, load_unit_test from sktime.dists_kernels._numba_distances import ( dtw_distance, erp_distance, lcs...
eb48ebef980ef34220ad173534d63672f296b527febfb11647a4c7bc84b8744b
Python
8,101
270
""" timeseries.py This script generates the timeseries plots which demonstrate the basic network characteristics (namely bump retention in 'darkness' and R dominance over E-PG neurons). Both the sm_peturbation and double_bump options are considered legacy features. They are not used in the final paper. Double bumps c...
0392c56db659eaf80f0449bb5726d461397c968b3428586de735215e1fb9c194
Python
8,102
219
import os import warnings os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' warnings.filterwarnings('ignore', category=FutureWarning) warnings.filterwarnings('ignore', category=DeprecationWarning) import numpy as np import pandas as pd from scripts_tool import configurations as cfg from scripts_tool import data_handler as dh ...
87c6299411fcd91e129b7005a27496bcb287c0e8ccfddcc847c700f794da6e24
Python
8,113
232
# 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...
76f3caceb4b45b6e55826b3a4d1936b3e89b9ed0dcf21ba8c92b93a9e09b5b03
Python
8,114
230
# 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...
5764ba23a6aee58f8303f104f08cf438825f22379af0a022cd2fb478fb940155
Python
8,118
210
# 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...
e08d7bda8aa0dcc2625968178765f986dc1d546db5ed816f24cb68e61bcd8a47
Python
8,118
232
# coding=utf-8 # Copyright (C) 2022. 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 # # ...
2216b3b23ed12b3d92c1adafb60cd09db2b25c32df04e09a19ed89e6ff0cd157
Python
8,121
238
from __future__ import print_function import re import os import sys import tempfile import subprocess import multiprocessing import multiprocessing.pool import dxpy def normalize_timedelta(timedelta): """ Given a string like "1w" or "5d", convert it to an integer in seconds. Integers without a suffix are...
d7d2ca1715e20e36fbe45c478a94a09038be9b0b7408596d19da1011b8620820
Python
8,123
196
# Compatibility adapter used by the release pretraining recipe and the # HF-style model files. # # The pretraining entry point uses this module to expose: # # * ``PatchTSTFMConfig`` -- a **dataclass** (the trainer calls # ``dataclasses.asdict(cfg)`` when checkpointing) with fields # ``context_length, patch_si...
3fa25c2974c7c3411caf0ee4ebc961067a32d6681cf9377b7edf2fab5d4394ee
Python
8,131
262
import numpy as np import pandas as pd import pytest from numpy.testing import assert_array_equal from seaborn._core.groupby import GroupBy from seaborn._stats.counting import Hist, Count class TestCount: @pytest.fixture def df(self, rng): n = 30 return pd.DataFrame(dict( x=rn...
90c2f321ecb5d67d34740092c6b0a1a1134b73e6b64826db6116759944d6f350
Python
8,131
207
# 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...
54f0c156acbc7f52a0113a82fe5f1be675f88fde54dca66edf172c5110ba908b
Python
8,134
232
# 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...
119ca8bd3454d7d7dbb0f5d4f2d12db9c5f2899a374dd7acac7225077937a724
Python
8,139
193
import math import os import torch import dotenv as de import numpy as np import pandas as pd from atom3d.datasets import LMDBDataset from atom3d.util.voxelize import dotdict, get_center, gen_rot_matrix, get_grid, intersperse from torch.utils.data import DataLoader, IterableDataset import atom3d.datasets.ppi.neighbo...
37d37ab7c6292bd04ba423cbb2ec7ae3586d861d524e186774cf9a8a6986ebff
Python
8,142
217
"""Time series SVC, from tslearn.""" from sktime.base.adapters._tslearn import _TslearnAdapter from sktime.classification.base import BaseClassifier class TimeSeriesSVCTslearn(_TslearnAdapter, BaseClassifier): """Time Series Suppoer Vector Classifier, from tslearn. Direct interface to ``tslearn.svm.svm.Time...
6c8fd570367c6d4d300afee199cc9428be800d6a41e1ea2eaac508d0bd80e2f4
Python
8,144
218
"""Time series kmedoids.""" __author__ = ["chrisholder", "TonyBagnall"] from collections.abc import Callable import numpy as np from numpy.random import RandomState from sktime.clustering.metrics.medoids import medoids from sktime.clustering.partitioning import BaseTimeSeriesLloyds from sktime.dists_kernels._numba_d...
badc5760cdc699d4dc92378d0fc6bc53e5f0e2a8477558a1f91cde9c00aeb19e
Python
8,145
249
# 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...
2eda1ccf88c60427abc754cc48459cc34b05124e572dcc6c51477302300afc8f
Python
8,153
238
# 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...
3fec113995853199f1d54ff906b53321d3d7fce809fb5811aecd66fdc4c85635
Python
8,155
208
# 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...
01e1982127de97498edf873e1bb1bdcdcfe4f5ecd735eb670fa54ac41e47547d
Python
8,156
183
import warnings import pytest import pandas as pd import numpy as np from palantir.presults import PResults from palantir.core import _compute_pseudotime, identify_terminal_states, run_palantir # Test with basic DataFrame input @pytest.mark.filterwarnings("ignore:np.find_common_type is deprecated.") @pytest.mark.fi...
140e5818ed03cd32c2e2bee248b23f7ac28b48893c911adcbbe5aff8ec641de8
Python
8,156
200
from __future__ import print_function from freqAnalysisTools import band from os import listdir from os.path import isfile, join, splitext import pickle import math import numpy as np from itertools import groupby #--------------- # set up parameters # for data handling metaDataLineNum4eeg = 18 metaDataLineNum4stage ...
63312d4e02d7a6207f7c616323e546ec00084daf314b763b29d1113ac723f578
Python
8,157
214
# 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...
a6666cf493e796012ff3822c2506db3e440fa15b2bb4a0d43343bbf4987fea67
Python
8,158
230
"""Space handling: template detection, resampling, and cross-template warps.""" import warnings import numpy as np import nibabel as nib import templateflow.api as tflow from nilearn.image import resample_to_img as _resample_to_img from nitransforms.io.itk import ITKCompositeH5 from nitransforms.nonlinear import Dens...
37d24983ba5265d38c6c86f608a33e048fb44b88e9d73e6c57a9f212e9ea3e57
Python
8,159
186
import numpy as np from itertools import groupby from parameterSetup import ParameterSetup def up_or_down_sampling(signal_rawarray, model_samplePointNum, observed_samplePointNum): # downsampling # print('-------') # print('model_samplePointNum =', model_samplePointNum) # print('observed_samplePointNum ...
fc9f24b04c103c1de6f5ff5ea0c6f0d38285230deb7583c38a7aa3ca1d0ecbe2
Python
8,160
210
import collections as col import logging import os import sys import click import pandas as pd from rdkit import Chem from torch.utils.data import Dataset import atom3d.datasets.datasets as da import atom3d.protein.sequence as seq import atom3d.splits.splits as spl import atom3d.util.file as fi import atom3d.util.fo...
11488b03ac9f1616cff2eee2b0ab1f0bedbbf25013422e5f97f7f6e441534863
Python
8,161
233
from __future__ import annotations import math from typing import Literal import pytest import optuna from optuna.pruners import _percentile from optuna.study import Study from optuna.study import StudyDirection from optuna.trial import TrialState def test_percentile_pruner_percentile() -> None: optuna.pruners...
1ff884d8082c674632aae05fa58e93ceaa988755df24cf3aea9638d1dd8fd442
Python
8,161
257
# coding=utf-8 # 2021.03 added (1) logging; # (2) BaseLearner; # (3) NotearsMLP, NotearsSob; # 2021.03 deleted (1) __main__ # Huawei Technologies Co., Ltd. # # Copyright (C) 2021. Huawei Technologies Co., Ltd. All rights reserved. # # Copyright (c) Xun Zheng (https://github.com...
60cfc7f2b9215158e89b7436713f327d61000ff0b571e9b38267e001db7113bf
Python
8,165
215
from __future__ import print_function import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchvision import datasets, transforms import numpy import matplotlib.pyplot as plt import pickle from scipy import stats import copy from scipy.stats import entropy from sklearn im...
cf5e54a3f2d68fb57914c0d222301faed37c1905845216d31fb21d21f6adac46
Python
8,168
231
# 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...
6aa9c728f4b6fdd68a73e3fc165a51afe9917bcee685b5a39b5a82818f703d7a
Python
8,169
221
import argparse import logging import os import time import datetime import matplotlib.pyplot as plt import numpy as np import pandas as pd import torch import torch.nn.functional as F from torch_geometric.data import DataLoader from model import GNN_RSR from data import GNNTransformRSR from atom3d.datasets import LMD...
7b7cbdbd584e0593bec2c90cd8315150aa8890f71d7170f611afa8f5997418cb
Python
8,171
174
import os, sys import numpy as np import torch import pytorch_lightning as pl from six.moves import cPickle from evoaug import evoaug, augment sys.path.append('../../evoaug_analysis') import utils from model_zoo import CNN device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu') output_dir = '../resul...
d9923eb5786f0811b0310f7a4c733ef1e6f55466abcdfe88761c249d9a0d5a30
Python
8,173
257
# 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 Conv(Base): @staticmethod def export() -> None: x = np...
2bd4ba5bb1a004098db6647d02e4d40eb1d9c0edc58804e122655cd95fbc8f0e
Python
8,174
196
#!/usr/bin/env python import os import sys import stat from os.path import join as pjoin, exists as pexists, realpath import numpy as np """#---------------------------------#---------------------------------#--------------------------------- The following script helps you generating job files for processing the lar...
bf11555f3bca862b952531ebec2e6bce28e377475407118c0020dbe14e55c522
Python
8,175
258
# SPDX-License-Identifier: LGPL-3.0-or-later from typing import ( Any, Literal, overload, ) import numpy as np from deepmd.dpmodel.output_def import ( FittingOutputDef, ModelOutputDef, OutputVariableDef, ) from .deep_eval import ( DeepEval, ) class DeepPot(DeepEval): """Potential en...
6d932317f63058d507e0f558e67e51fde7891ebb6a193f853c08a6d86d7431c0
Python
8,181
182
"""Functions to generate the conformers to be adsorbed and the most stable one. functions: remove_C_linked_Hs: Removes hydrogens bonded to a carbon atom from a molecule. gen_confs: Generate a number of conformers in random orientations. get_moments_of_inertia: Computes moments of inertia of the given conformers. get_m...
a647381f33ce16e739ec21f80d3d4ff30e5d2be7e55a0a31b858d04c262db2c6
Python
8,184
191
# Copyright (c) ONNX Project Contributors # # SPDX-License-Identifier: Apache-2.0 """Optional runtime validation of static shape annotations. This module implements the runtime semantics described in ``docs/ShapeAnnotationSemantics.md``: each symbolic dimension name (``dim_param``) occurring in a model is treated as e...
b3da96ea220a0c1a83ef8cd9c28f4ad83dc0d3c073b040ddbb1b948e761102d3
Python
8,184
208
# -*- coding: utf-8 -*- import os os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" os.environ["CUDA_VISIBLE_DEVICES"] = "1" # # Description: # Training code of QSMnet # # Copyright @ Yanqiu Feng # Laboratory for Medical Imaging and Diagnostic Technology # Southern Medical University # email: foree@163.com # # sess ...
aa85f692a9bbddbe507e81b518d299ffbc52efdc2c8385a1697dcaa3b083363b
Python
8,191
263
# SPDX-License-Identifier: LGPL-3.0-or-later """Training entrypoint for the TensorFlow 2 eager backend.""" from __future__ import ( annotations, ) import logging import time from typing import ( TYPE_CHECKING, Any, ) from deepmd.dpmodel.model.base_model import ( BaseModel, ) from deepmd.dpmodel.train...
62b835c171bcdc99e67e58a3b20447499d88845046424ea5047ccbff6154739d
Python
8,196
237
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' Unittests for the openbabel based modules Tests - MoleculeCreator - MoleculeInfo ''' import unittest import openbabel #from openbabel import openbabel from src import MoleculeInfo as mi from src import MoleculeCreator as mc import filecmp import os import subpro...
f5f5d43e9b20f188a58bc4945f813f7d1f5659ebf622490a97dbbc1e10062ffc
Python
8,196
129
import os import scipy.io import sys sys.path.insert(1, "/Users/hyung/Research23_Network_Analysis/mBIN/Python/LBD/") from LoadDataLBD import loaddataLBD from PathCovLBD_noAmy import pathCovLBD_noAmy from ThicknessCovLBD import ThicknessCovLBD sys.path.insert(1, "/Users/hyung/Research23_Network_Analysis/mBIN/Python/Ne...
45357070252cada16415410a8948eaf502e4087d4cdff0c557bb34f7d2d58cec
Python
8,198
230
from mprl.rl.envs.stratego.stratego_spatial_multiagent_env import SpatialStrategoMultiAgentEnv from progress.bar import Bar import numpy as np import dill from multiprocessing.pool import Pool from multiprocessing import cpu_count def run_dill_encoded(payload): fun, args = dill.loads(payload) return fun(*args)...
506fe51629ceb9bbfb39294aa2dbcdd13fcd51a29ec98c89f9c03ec47f6e1d0d
Python
8,198
232
# 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...
d9754d596e30142784dfc6f244643e469cbc83873ddbf3b42557612988be5813
Python
8,200
238
"""Summary Classifier. Pipeline classifier using the basic summary statistics and an estimator. """ __author__ = ["MatthewMiddlehurst"] __all__ = ["SummaryClassifier"] import numpy as np from sklearn.ensemble import RandomForestClassifier from sklearn.tree import DecisionTreeClassifier from sktime.base._base import...
5ed4cac91478e7f57948b04e1def98c52f998944948e0b9b2a97a23ce9cfb8b8
Python
8,201
210
#!/usr/bin/env python3 """ NCBIgff2chrom.py ================ Parse an NCBI GFF annotation and produce a `.chrom` file (ODP format). This script supports two invocation styles: 1. **Legacy / odp:** one positional argument (the GFF, possibly gzipped). Emits the chrom table to stdout. CDS extents are unioned per p...
d85157bb4a3cc060a4d7e93809936d5f08fe2d1fbe2a1b794504b7e3bbb0dcd9
Python
8,206
239
from collections import defaultdict import csv from pathlib import Path import os from rdflib import Graph, URIRef, Literal, BNode, RDF, RDFS, OWL from sqlalchemy import create_engine, inspect, Table, Column from sqlalchemy.orm.session import sessionmaker from pyontutils import utils from pyontutils.config import auth ...
f95a85dbc6b2161904fe971d53a3fbc5777c590036bd7e1978b09d016b0d8352
Python
8,209
196
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_MSP, MLP_MSP from data import GNNTransformMSP, CollaterMSP from atom3d...
5665aabffc6ac3fa7f3f65aaf26648be8bbfbb99b4a3e773af6462d689e26fc8
Python
8,229
238
# -*- coding: utf-8 -*- """ Created on Fri July 09 14:54:37 2023 @author: Mesfin Diro """ import warnings warnings.filterwarnings("ignore") import os import os.path as osp import argparse import torch import torch.nn.functional as F import torch_geometric.transforms as T from torch.optim.lr_scheduler import _LRSchedul...
52db28b84d9dd7a74390fd6a7d91e0e98715873a68ca204b7fe386905e97546d
Python
8,230
228
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from ray.rllib.models.tf.tf_modelv2 import TFModelV2 from ray.rllib.utils import try_import_tf, try_import_tfp tf = try_import_tf() tfp = try_import_tfp() SCALE_DIAG_MIN_MAX = (-20, 2) d...
c81bfdf6f3d2816647aa74392b55547fddc8ac52c0a49a9bdd4aa889352c2bc6
Python
8,233
232
import unittest from onmt.translate.translation_server import ServerModel, TranslationServer import os from six import string_types from textwrap import dedent import torch from onmt.translate.translator import Translator TEST_DIR = os.path.dirname(os.path.abspath(__file__)) class TestServerModel(unittest.TestCa...
7f82a6de93581b473c994dc00e8f4ff74c4453930fbb779a832aa6aa519ba0c2
Python
8,246
195
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ## Created by: Yaoyao Liu ## Tianjin University ## liuyaoyao@tju.edu.cn ## Copyright (c) 2019 ## ## This source code is licensed under the MIT-style license found in the ## LICENSE file in the root directory of this source tree ##++++++++++++++...
eef5f9d6313fe540b7af31e92e8d523862155faccd597789744647744c959212
Python
8,246
208
"""Functions for splitting data into test, validation, and training sets.""" from functools import partial import numpy as np import torch import atom3d.util.log as log logger = log.get_logger('splits') def split(dataset, indices_train, indices_val, indices_test): """Split a dataset into train, validation, and...
31e2dd73d61b02a860ab74a320caae860a616682a6efd1f63f5b9288f57abd31
Python
8,256
169
import numpy as np import SimpleITK as sitk import config as cfg def get_data_info(sitk_image): """ Extracts information about a given SimpleITK image and stores it in a dictionary. Args: sitk_image (SimpleITK.Image): SimpleITK image to extract information from. Returns: d...
ef1f592cd0076565fe845c2abad9f84ccb4c6e63876bbd8d5c87833988b2aa1b
Python
8,260
188
# SPDX-License-Identifier: LGPL-3.0-or-later """This module ensures input in the examples directory could pass the argument checking. """ import unittest from pathlib import ( Path, ) from deepmd.common import ( j_loader, ) from deepmd.utils.argcheck import ( normalize, ) from deepmd.utils.model_preset im...
bee15268233b2eb262bad46d9c6b28bb5206bd1918634545131393ecb8d6c0fd
Python
8,264
233
"""Tests for the pretrain input path on BaseDetector. Tests that apply to any detector, for instance state, clone, and no-op behaviour, are in ``TestAllDetectors``. """ __author__ = ["yash-sangwan"] import numpy as np import pandas as pd import pytest from sktime.datatypes import check_is_scitype from sktime.detect...
434b1f47f0a2d8813f83ff2fcf4a77ad59eda7c1a6cdb84fb71c0321c515796e
Python
8,267
214
import argparse from importlib.metadata import PackageNotFoundError, version from pathlib import Path from graynet import config_graynet as cfg from graynet.domain import RunConfig from graynet.exporters import export_csv, export_graphml from graynet.pipeline import run from graynet.utils import as_path, check_atlas, ...
22aeecfcde25fa87a4322b01bf7786f5ef9f9ad035be4f9e8f18d958985f757b
Python
8,279
224
# SPDX-License-Identifier: LGPL-3.0-or-later """Complete intra-frame pair topology for interactions without a cutoff. A module whose interaction acts between every two atoms of a system, such as a non-periodic long-range module, cannot read its geometry from the short-range :class:`~deepmd.dpmodel.utils.neighbor_graph...
486d3a0a92bae134437fbc6ddf2047ef87da6114f0ebeee55c818b3096be4cb9
Python
8,280
268
from scripts_tool import data_handler as dh from scripts_tool import utils import numpy as np import pandas as pd import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import seaborn as sns def generate_heatmap(config, from_pickle=False): import pickle from scripts_tool import models_util ...
acf91a964fd419001693d10c107fc237fb2a82bcf20e24639dbc3ddf9cfdd185
Python
8,282
147
import argparse import os from configparser import ConfigParser import pkg_resources def set_seed(SEED): os.environ['PYTHONHASHSEED'] = str(SEED) from numpy.random import seed seed(SEED) from tensorflow.random import set_seed set_seed(SEED) def get_CFG_reader(): cfg = ConfigParser() assert pkg_...
15ada828ba559cfbafaa4ddba1502d2ff0b7c90a5bc113e3b663a86c5d4615cc
Python
8,286
197
# Copyright 2022 Diagnostic Image Analysis Group, Radboudumc, Nijmegen, The Netherlands # # 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...
3c1064e6462a27bcc4602432c192ff6d26d2c22d7ce76f473bffdfcdae35c0c3
Python
8,287
177
import logging import grpc import time import threading from typing import Union from mprl.utility_services.lock_server.protobuf.lock_server_pb2 import LockRequest, LockConfirmation, LockWorkerPing, LockReplaceRequest, NameFilter, LockList from mprl.utility_services.lock_server.protobuf.lock_server_pb2_grpc import Lo...
590c0b7a380e3a28eee7b72c3ad38fba0d403aabd4b6a1516e87e5e0287af36d
Python
8,288
238
from argparse import Namespace from typing import Optional, Tuple import torch import numpy as np from .jet_features import plot_jet_p_cartesian, plot_jet_p_polar from .particle_features import plot_p_cartesian, plot_p_polar from .jet_images import plot_jet_image from .utils import ( get_p_polar, get_p_cartesi...
c4a185074e59dee4be70269357da1f20223e1bcc31a77edbf11dc6c6d6099c9d
Python
8,293
170
import random import matplotlib.pyplot as plt import numpy as np import torch from gpytGPE.gpe import GPEmul from Historia.history import hm from Historia.shared.design_utils import get_minmax, lhd, read_labels from Historia.shared.plot_utils import get_col, interp_col SEED = 8 def main(): # ------------------...
da7e46ee016b1be92cd149bfdaf2242e7f83fae3b908c740310ef45bb2e74377
Python
8,296
257
# This code was adapted from https://github.com/ryanwongsa/kaggle-birdsong-recognition/blob/master/src/models/sed_models.py, # which is licensed under the MIT license. The original author of this code is Ryan Wong (https://github.com/ryanwongsa). from typing import Dict, Tuple, Union import torch import torch.nn as n...
c8bf53ef1ed36a55898376ae1800bbd058f333a537639f8382eaa07147b3999f
Python
8,300
219
# Copyright (c) OpenMMLab. All rights reserved. import argparse import os import warnings from numbers import Number import mmcv import numpy as np import torch from mmcv import DictAction from mmcv.parallel import MMDataParallel, MMDistributedDataParallel from mmcv.runner import get_dist_info, init_dist, load_checkpo...
adcd2ba95e6038e6e4476fa5693911b7af1ed4a299ba408d518100acd63b561f
Python
8,302
253
""" Summary This script parses the metainformation to generate a dataset. First the arxiv-metadata-oai-snapshot.json file from the arXiv dataset is parsed. The author names are extracted and only authors who gave a full (>= 2 letters, no initials like L.B.) first and lastname are considered. This is to reduce the au...
59e27f05c92da84e54eae36f76036a94214be5db7c50e495ff0af4dfa8ed5de5
Python
8,305
272
# SPDX-License-Identifier: LGPL-3.0-or-later """Topologies an atomic model declares beside its neighbor graph. An interaction that the short-range neighbor graph cannot describe reads a topology of its own, declared by name (see :meth:`~deepmd.dpmodel.atomic_model.base_atomic_model.BaseAtomicModel.required_topologies`...
eeef855975ce96495aff7db54efa777932436d44b4f93c92be3690ff7d49187c
Python
8,306
313
import os import json from pathlib import Path from ElastixLib.utils import createTempDirectory import slicer from typing import List, Union, Dict # for caching instead of persistently creating new preset for each node in the scene InScenePresets = {} ID_KEY = "id" MODALITY_KEY = "modality" DESCRIPTION_KEY = "descr...
d920b4e82440fef894fdfec74dbd12b0f6310ad8902bc2cb1a933d8ba4058300
Python
8,308
238
# 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...
e64c99331f3283ccf655d28850dc3d3d83f0414fd7e18319a16ef8aa07dd0abe
Python
8,310
198
#!/usr/bin/env python3 from Bio.PDB import PDBParser from Bio.PDB.MMCIFParser import FastMMCIFParser from Bio.SeqUtils import seq1 from Bio.PDB import DSSP import numpy as np import warnings import pandas as pd import argparse import logging.config import sys import csv from pathlib import Path, PurePath import tempfi...
11b001abf99e062dbe95dad88f7014d0965a9be50b426a5b892f19ac34179427
Python
8,318
243
# 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...
ac76e4c9bb1eae7280b5d63bec25c9e843a39646aba889aaf58f89fdefb6ef23
Python
8,327
188
#!/usr/bin/env python import dxpy, dx_utils, os, subprocess, re, matplotlib, pylab, multiprocessing matplotlib.use('Agg') import pylab import os GENERATOR_FILENAME = 'generators.txt' MAX_KMER_COVERAGE = 1000 NUM_LINES_TO_SNIFF = 1000 GENOMESCOPE_MIN_COL = 30 GENOMESCOPE_MAX_COL = 48 def _run_cmd(cmd): print subpr...
822b3c695b4060a032df9c19880f275fb788bfd3f6eab9a8017710d7eea71bc2
Python
8,332
233
# 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...
816f955ab769e472e0e43fed5b8d740b95e402b77b5bc74db64febc1bfb6b576
Python
8,335
246
# Copyright 2019-2021 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 # import ampligraph.datasets import ampligraph.latent_features from ampligraph.ev...
c3ad7f815d91e3e8188c3e859b67a21e8564bd246900adccc8e739ebbea5ec44
Python
8,336
272
# Copyright (c) ONNX Project Contributors # # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import importlib.util import sys from datetime import date from pathlib import Path from urllib.parse import parse_qs, urlsplit import pytest SCRIPT_PATH = ( Path(__file__).parents[2] / ".agen...
ea2f1ceddd7d2155e8eec090d464564fc1511a32c1bee23a26487b69cb590d27
Python
8,337
309
""" [Legacy] optimize_dynamics.py Routine which attempted to determine network parameters using basic desirable network characteristics as objectives. """ import smtplib import numpy as np import matplotlib.pyplot as plt from test_utilities import mmcs, dynamic_parameterise from extended_ring_model import * from dict...
a1f991255c09d2a108dd4880407e9e8f0713261d508e72546dec2c0d13f93972
Python
8,342
198
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations from typing import TYPE_CHECKING, Any import pytest import onnx.shape_inference from onnx import ( GraphProto, ModelProto, NodeProto, TensorProto, TypeProto, ValueInfoProto, ...
4f99bd8da846232854b23d3e5aab12b902306df6efa0b1a58ac53de6308f163d
Python
8,343
257
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jul 7 23:30:33 2021 Run gridsearch to fit SHJ @author: robert.mok """ import os import sys import numpy as np import torch import itertools as it import time from scipy import stats import pickle location = 'cluster' # 'mbp' or 'cluster' (cbu clust...
895f4688a1ebd20c6739655360a08748c8b64a0a66ce9bf982abc39383411c11
Python
8,343
295
# BASILISK: A generative, probabilistic model of side chains in proteins # # Copyright (C) 2010 Tim Harder and Jes Frellsen # # BASILISK 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 ...
cd3002ef562e33ad49b5a05b2e13ef8dfeb9027a518219f66829ff140bb8544f
Python
8,344
240
#!/usr/bin/env python3 #!/usr/bin/env pypy3 """Format ontology files using a uniform ttl serializer from rdflib Usage: ttlfmt [options] ttlfmt [options] <file>... Options: -h --help print this -v --verbose do something fun! -a --vanilla use the regular rdflib turtle serializer -y -...
57a570e63347819008b9f387b10002fbc830b838182a2761017f85ed592bdad2
Python
8,346
247
# 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...
8488a67a1434d0a42c099579c004646b62a66063e8af7bb7a160cf0217f3b9e6
Python
8,347
273
"""M5 competition dataset.""" from pathlib import Path import pandas as pd from sktime.datasets._data_io import _reduce_memory_usage from sktime.datasets._dataset_downloader import DatasetDownloader from sktime.datasets.forecasting._base import BaseForecastingDataset class M5Dataset(BaseForecastingDataset): ""...
4207aaf7ee116f5d2e4aa4efb93bfc4fffc15081289aac64ec2a449e1718b46a
Python
8,349
238
"""run_infer.py Process slides with IGUANA. Usage: run_infer.py [--gpu=<id>] [--model_path=<path>] [--model_name=<str>] [--data_dir=<path>] \ [--data_info=<path>] [--stats_dir=<path>] [--output_dir=<path>] [--batch_size=<n>] \ [--fold_nr=<n>] [--split_nr=<n>] [--num_workers=<n>] run_infer.py (-h | --help)...
7e513b76e6633776a42c99856ad40be803e1dd0db54edb1a1e6ac8a13e192693
Python
8,349
329
import re import numpy as np def extract_data_from_logfile(tag, parameters): params_compiled_list = [ re.compile(r"[-]" + f"{p}" + r"\s+=\s+(\S+)$") for p in parameters ] p0 = re.compile(r"[=]+\sInitialization\sdone[\s\S]+") p0_lv = re.compile(r"LV\sCavity\svolume\s=\s(\d+\.\d+)") p0_rv =...
a5c4fd76d1568a3f9b628982405087e68fb3b63c3a7146ab10567c532081e68e
Python
8,355
301
import argparse from multiprocessing import Manager import os from pathlib import Path import warnings import hydra from joblib import Parallel import numpy as np import pandas as pd import pytorch_lightning as pl from pytorch_lightning.callbacks import ModelCheckpoint from pytorch_lightning.utilities.warnings import ...
84e2b321e1da6a7d588e02756f5b0ed89e69aa07a2c193d93504d47949b2b65b
Python
8,356
261
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """ Base class template for data sets. class name: BaseDataset Scitype defining methods: loading dataset - load() loading object from dataset - load(*args) Inspection methods: hyper-parameter inspection - get_para...
b0ca887e666c728697748b41f2f290268ad980f115607ec023b1a9eb2be3f25d
Python
8,357
243
# An extension to: Mocapy # # Copyright (C) 2007 Jes Frellsen, Ida Moltke and Martin Thiim # # This library 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...
f14fbed6a34c192837171634f572dd904a0e6dfa521f1e716026e1fce2930251
Python
8,358
186
import numpy as np import pandas as pd import collections as col import logging import os import re import sys import scipy.spatial import parallel as par import click sys.path.insert(0, '../../..') import atom3d.datasets.datasets as da import atom3d.splits.splits as spl import atom3d.util.file as fi import atom3d.uti...
07887b6279fb93879a7a3755c799aa4c3bf45ac3a38e83cdb36807267273a391
Python
8,360
256
# 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 argmax_use_numpy(data: np.ndarray, axis: int = 0, keepdims: int = 1) -> ...
cbfe04d03919315d2c0034bfb36053767718556d863f34a5cdb4fe10368b2680
Python
8,360
307
# SPDX-License-Identifier: LGPL-3.0-or-later import copy import unittest import numpy as np import paddle from deepmd.pd.model.model import ( get_model, ) from deepmd.pd.utils import ( env, ) from ...seed import ( GLOBAL_SEED, ) from ..common import ( eval_model, ) dtype = paddle.float64 model_se_e...
7096846332bf5247b7c12b1891696dad35828ef67b683ec087f8f694d863dcac
Python
8,366
227
# Copyright (c) OpenMMLab. All rights reserved. import copy from abc import ABCMeta, abstractmethod 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 Compose from sklearn.me...
87d167af8849debb91476ec8e94341992a2ddda8625bdf4e8dfafd5d777a0ec7
Python
8,369
148
# this program calculates the binary filtering of UMLS concept extraction for radiology reports from the 'for validation - 1000 docs - ori - MIMIC-III-rad.xlsx' sheet. from sklearn.metrics import precision_score, recall_score, f1_score, confusion_matrix import numpy as np import pandas as pd import sys # input...
6ce2d757fd2e0b2a8595aa1f1633eda04097bf309bbafbd01d7a325c3f5237a7
Python
8,371
223
from scripts import data_handler as dh from scripts import ensemble_util import numpy as np import scipy as sp import os from keras.models import load_model, Model import keras import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import pandas as pd import pickle def postprocess(config)...
7264dea945385c9079bf3d5fddfc980e573e0e12d8615473a5c0815b6250dfea
Python
8,377
208
""" This plots figure 6f of the paper. This is the psychometric fit of the behaviour output of the naive model. Internal notes: This is from notebook 21.22 Note that it currently requires xarray == 0.19.0 TODO: there are some pickle files that should be convereted to something more readable """ import pandas as pd ...
949bdf1fdd94dc12cb2fd86211a5d9423588a14187b18c608aa92edcfa89e8a3
Python
8,377
249
# SPDX-License-Identifier: LGPL-3.0-or-later """JSON Schema for model presets and grouped data input forms.""" import json import re from typing import ( Any, ) from deepmd.utils.model_preset_data import ( MODEL_PRESETS, ) _REGIONS = ("type_map", "descriptor", "fitting_net") def with_data_groups(schema: di...
e87f8f816b17c29ad010cb4f19db36556809ebfae464b4061e9cf962bfd7e27e
Python
8,378
243
# 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 # # ...
93c78c663720f931195eafc3d9e8be0379cb8c912b578b68b5ef014bf44b8be1
Python
8,382
215
# 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...
14619439a662850f3e4219148984822eb12cbed6ae0bd63d965abae638424875
Python
8,385
284
# 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...
997dcd63de4b6cf1179c4df6b8306022d96e701a101b1d99bf6602c20c680186
Python
8,391
245
# SAFE TEAM # # # distributed under license: CC BY-NC-SA 4.0 (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.txt) # # from compiler_provenance.utils import __padAndFilter as padAndFilter from asm_embedding.InstructionsConverter import InstructionsConverter from asm_embedding.FunctionNormalizer import Func...
b25210892a0ab73b6ab1bc550b291d25d7e01e5ae7a1bff556740c7361ae672f
Python
8,391
206
#!/usr/bin/env python import sys import os import re import math from os.path import isfile, join, isdir import time from kn_common import pipetools,pipedef from kn_pipeline_class import CPipeError,CPipeStep class CPipeStepAxonFilt(CPipeStep): jobids=[]; def wait_for_jobs(self,progress_scale=(0,1))...
2d881a87bb2ebff8658fd334d41b8a5d5ef195eea53be0f1e060ba7ee84e91f3
Python
8,393
188
#funkcija za feature selection i optimiaciju ELM parametara (broj neurona u skrivenom sloju i weights i biases) #Funkcija moze da radi samo fs+hyper-parameter tuning ili samo hyper-parameter tuning # 1. Ako je nfeatures=0 i features_list=[naka lista] onda se radi samo hyper-parameters tuning sa odredjenim subset fe...