sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
fb527d0126c428dbf2560456a4ed65f3a238d6057d956cb2bbd21bdad8832fb6
Python
19,991
579
# Copyright (c) OpenMMLab. All rights reserved. import pytest import torch import torch.nn as nn from mmcv.cnn import ConvModule from mmcv.utils.parrots_wrapper import _BatchNorm from mmcls.models.backbones import ResNet, ResNetV1d from mmcls.models.backbones.resnet import (BasicBlock, Bottleneck, ResLayer, ...
c1896d50549b80d6c00afb156ddd2b7599efd50232b689ab2ebeaf7df27da995
Python
20,003
521
#!/usr/bin/env python3 #!/usr/bin/env pypy3 __doc__ = f"""Generate NIF parcellation schemes from external resources. Usage: parcellation [options] Options: -f --fail fail loudly on common common validation checks -j --jobs=NJOBS number of parallel jobs to run [default: 9] ...
7949fffc4c50ba2be230af8e3ae25ded1903049038d5d14aaf4bcf99254464b5
Python
20,026
435
import numpy as np import numpy.typing as npt from scipy.stats import rankdata, t, f from typing import Optional def pearson_coefficient( feature_arr: npt.NDArray[np.float64], joint_dist: npt.NDArray[np.float64], permutations: int, ) -> npt.NDArray[np.float64]: r""" Let X, Y be two random variable...
d3a572d4405184dbfc9013401b61735b9b920c2677761bae388591541883030b
Python
20,032
643
import os import copy import h5py import pytest import numpy as np from os.path import join as pjoin from dnnbrain.io import fileio as fio from dnnbrain.dnn import core as dcore from dnnbrain.dnn.base import dnn_mask, array_statistic, dnn_fe DNNBRAIN_TEST = pjoin(os.environ['DNNBRAIN_DATA'], 'test') TMP_DIR = pjoin(o...
5de0a2b1aae8bf17cc124620754c82c0a281fce2a24eb200e5ba631f1b512a54
Python
20,041
603
# 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...
7733a00911b3efa4b73e5008b24a63f8a3219ff4daa5609587a03e0a565d1242
Python
20,058
589
import pytest import numpy as np from scipy.linalg import inv from scipy.ndimage import rotate import ardent from ardent.lddmm import register from ardent.lddmm.lddmm import _generate_position_field from ardent.lddmm.lddmm import _apply_position_field from ardent.lddmm import apply_transform def convert(array): ...
75aacdb09bca8d5115cd3f3bf8a58303dd85ea7a64eaa81772a54e1d09ee48b3
Python
20,059
576
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import automatic_conversion_test_base import numpy as np import pytest import onnx from onnx import helper ##################################################################################### # Every ...
879aa87b092907ad5cc5de422a7c67ca6ed8f41106e244e15e183f269d2a71f4
Python
20,065
405
#!/usr/bin/env python # # Copyright 2006, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
dad088f7ed86eb3bd3eff13a0121a6974563e37b82c68c793a879d54f46461c6
Python
20,071
502
"""For analysis of correlation results """ from robustlink._init_plots import * from robustlink import enhancer_gene_utils KB = 1000 def p25(x): return np.nanpercentile(x, 25) def p75(x): return np.nanpercentile(x, 75) def estimate_frac_tps(pvalues, bin_n=100, frac_bin_null=0.20): """Use the median of th...
999df52d625ca59ee13a8c6d630f813e5dd7028b72bf04af404df278a1489296
Python
20,112
639
# 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...
8de0bebe8f7d579aec651899897a6d9db539b4c92cd65ddf347cc2fdb0c4fe6a
Python
20,126
351
#!/usr/bin/env python3 """ GIFT-Eval evaluation of a pretrained PatchTST-FM, zero-shot or prompt-tuned. --mode zs bare backbone (prompt_len=0 through the same wrapper path) --mode prompt load a train.py checkpoint (--ckpt) Both modes share ONE predict path (PromptedPatchTSTFM.forward), so the prompt-vs-zero...
da756347254775fd7a14756a8d3fbbc36785976d93530744c84ecd3da6129adb
Python
20,140
544
import os import cv2 import copy import torch import pytest import numpy as np from PIL import Image from os.path import join as pjoin from sklearn.svm import SVC, SVR from sklearn.model_selection import cross_val_score from torchvision import transforms from dnnbrain.dnn import base as db_base import matplotlib.pyplo...
e785993c9162de4db08f872e719b96135e6888a8b61c1e208b7aa27f7fb719b6
Python
20,149
619
# -*- coding: utf-8 -*- """ Created on Sun Dec 31 16:25:15 2017 @author: Tiger """ """ Retrieves validation images """ import numpy as np #from PIL import Image from os import listdir from os.path import isfile, join from skimage import measure from natsort import natsort_keygen, ns import os import pickle #import s...
e755e0d762dee1f2606320822aae5bfd23c3006f3dbeb96ae4c3f004c7e431b5
Python
20,170
609
# 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...
39f182d1eba0e3c6a161e3443d2d6c92c52359f27a7710127b707f09bc4d5c89
Python
20,192
648
from __future__ import annotations import logging from typing import TYPE_CHECKING import numpy as np import pytest from mock_data_stream import MockStreamData from pyxdf.pyxdf import _clock_sync if TYPE_CHECKING: from typing import Literal @pytest.mark.parametrize("n_clock_offsets", list(range(5))) @pytest.m...
af4bd180f9475aeac7b665bb2582d0fcec3be3210891b26f0a302113c8610e7a
Python
20,192
232
""" Vector strength for models with SAM tones, different input configurations. 9 Dec 2020 version. Results are printout from DataTablesVCN after selecting the data runs. pbm """ data = """Cell,Configuration,frequency,dmod,dB,VectorStrength,SpikeCount,phase,phasesd,Rayleigh,RayleighP,AN_VS,maxArea,ninpu...
6b4b6414ce04cac0a1d903d19b507a6bd0ca0766ba25c7a76b0dd3e3802d2758
Python
20,198
423
# Options addRawFeat = True base_path = '' feature_networks_integration = ['clinical', 'cna', 'exp'] # datatypes to concatanate node features from node_networks = ['clinical', 'cna', 'exp'] # datatypes to use networks from int_method = 'MLP' # Machine Learning method to integrate node embeddings: 'MLP' or 'XGBoost' or ...
4dfeda0adaa4dfbcf3f16dfbd62256b9550813e5fcd28839a37db715586b571e
Python
20,200
552
#!/usr/bin/env python3 # Copyright (C) 2019 Christoph Gorgulla # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # # This file is part of VirtualFlow. # # VirtualFlow is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the...
476cf8b67131d546ba093dc8c1260be05a8084547116469de3e59d936ac92f53
Python
20,203
594
import numpy as np import pandas as pd import matplotlib as mpl from matplotlib.colors import same_color, to_rgb, to_rgba from matplotlib.markers import MarkerStyle import pytest from numpy.testing import assert_array_equal from seaborn._core.rules import categorical_order from seaborn._core.scales import Nominal, C...
5c6fe740b3e83d4cf5c910110b4384a633a299841cf9ee159653b5121da243c1
Python
20,213
563
# 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...
a1640cc3f2400ace40d7a873b6bb48ceed617ccea0cd35c5d583661218f5ef4a
Python
20,217
494
""" @file: input_representation Created on 06.07.23 @project: CrazyAra @author: queensgambit Default input representation for all available lichess chess variants board states (including crazyhouse) which is passed to the neural network. This default representation usually refers to version 1.0 of the respective MODE...
e71a754ce5635830f1ee45f326038f4fe1b82d87b068933aca321c768c8c0e99
Python
20,249
530
import csv import rdflib import augpathlib as aug from pyontutils import sheets from pyontutils.namespaces import TEMP, ilxtr, rdfs, skos, interlex_namespace from neurondm.models.nlp import map_predicates, main as nlp_main, NeuronSparcNlp from neurondm.models.apinat_npo import NeuronApinatSimple, NeuronApinatComplex fr...
717cd1bbdf73fc4180ae4c0f94b098cd5e49511470fdf52158376842b448465c
Python
20,254
631
# 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...
546ee87a33690bf06f506642810c4024400af74e325f934fb3f1c62f7756bb95
Python
20,278
583
# Copyright (c) ONNX Project Contributors # # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np import onnx from onnx import TensorProto, helper from onnx.backend.test.case.base import Base from onnx.backend.test.case.node import expect from onnx.defs import AI_ONNX_PREVIEW_DOM...
91df9f37e0242a77c70d43d828495884fb769f943f7adb84e1a3804bc8762fd9
Python
20,304
574
"""Unit tests for classifier base class functionality.""" __author__ = ["mloning", "fkiraly", "TonyBagnall", "MatthewMiddlehurst", "achieveordie"] import pickle import numpy as np import pandas as pd import pytest from skbase.utils.dependencies import _check_soft_dependencies from sklearn.model_selection import KFol...
ebe27efaa864f5dba088c96def57d8c1cc49ebdfc146e7ebd10acc05f54dc5f7
Python
20,316
296
import matplotlib.pyplot as plt import numpy as np import pandas as pd from itertools import compress import numpy.ma as ma from scipy.stats import norm from scipy import stats import os import scipy import sys from numpy import savetxt from PIL import Image from sklearn.linear_model import LinearRegression sys.path.i...
87f72a6bd079837ae5fa4a907223c5ad0364f4bab79a1f69a7debba495a6ed48
Python
20,339
462
''' This is the main module of EVOLVE. It initialises the genetic algorithm search, determines initial fitnesses for each evaluator and then loops over the generations. .. codeauthor:: Nicholas Browning .. codeauthor:: Simon Duerr dev@simonduerr.eu ''' from __future__ import division from __future__ import print_func...
621d26ecbd83b96903a3d0e1e5d2f6f73187c044065c96811496b4a88e673344
Python
20,348
782
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jun 26 09:30:55 2019 @author: reiters """ #careful to include only full AS bouts with good posture to not bias any measurement of differences from geosketch import gs import numpy as np import h5py from sklearn.decomposition import PCA import cv2 import...
265f50cbedbe191cc03b6dfba167a585de0bb9a6ae5ca9083f877c0e9859f604
Python
20,365
581
# 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...
b69f6ea296dfd35bd8cee8cb6f599122e045183719984373bab7fa204d8e789c
Python
20,379
464
from pathlib import Path import os from statistics import mean import matplotlib.pyplot as plt from akkadian.build_data import build_signs_and_transcriptions, break_into_sentences from akkadian.data import from_key_to_text_and_line_numbers from akkadian.parse_xml import parse_xml from akkadian.data import increment_cou...
b0879ebe89ab0f6c484a24846dfc195a5c85dcdd85a312ed679796e3ae85ad09
Python
20,431
404
from __future__ import absolute_import from __future__ import division from __future__ import print_function import json import logging import os import shutil import time import dill import numpy as np import ray from mprl.utility_services.payoff_table import PolicySpec from mprl.utility_services.worker import Learn...
8a7729736e47da575dd574c48676527d51c420d7b5f710f39ac89c97440cd127
Python
20,478
518
"""Functionality to compute Gromov-Wasserstein distances \ using algorithms in Peyre et al. ICML 2016.""" from __future__ import annotations import csv # std lib dependencies import itertools as it import sys from typing import Iterator, List, Optional, TypeVar if "ipykernel" in sys.modules: from tqdm.notebook ...
eae50d5bbb573d975f560acf78bbcacfefc1020762059ee6ca938dedd69e7e8c
Python
20,494
650
# 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...
45c90417383279eb901d2c9c2ae3d637e6f777cea353b2837d9e5db2f89641a1
Python
20,512
518
# copyright: sktime developers, BSD-3-Clause License """Implementation of Double Machine Learning methodology for forecasting.""" __all__ = ["DoubleMLForecaster"] __author__ = ["geetu040", "XAheli"] import math import pandas as pd from skbase.utils.dependencies import _check_soft_dependencies from sklearn.base impor...
4e1a08fee3e7e6319b619786a8018643cad9e863595cfca9731cc934e4e6305a
Python
20,522
554
# SPDX-License-Identifier: LGPL-3.0-or-later """pt_expt native-spin energy model (NeighborGraph route, autograd force_mag).""" from typing import ( Any, ) import torch from torch.fx.experimental.proxy_tensor import ( make_fx, ) from deepmd.dpmodel.model.native_spin_model import ( make_native_spin_model, ...
08eee574da28d63683c8e88f0623234b6511935edb54e038f4a4f10d67a965e8
Python
20,530
642
""" A special directive for generating a matplotlib plot. .. warning:: This is a hacked version of plot_directive.py from Matplotlib. It's very much subject to change! Usage ----- Can be used like this:: .. plot:: examples/example.py .. plot:: import matplotlib.pyplot as plt plt.plot...
a253e9ec100b6216d3708021f722e76267add9d92ceb275538e6f05f237b7c53
Python
20,557
461
from IPython.core.debugger import set_trace import numpy as np from math import * import tensorflow as tf import scipy as sc from scipy.linalg import block_diag from src.utilities.helper_classes import integrate_simp_cumsum, vander, diagonalize tf.keras.backend.set_floatx('float32') #### User-defined parameters cla...
1d72e96085d6bd3d03d597b78dcff4bfb25bc6ad0d6c268c7483e2be4258f763
Python
20,569
445
import sys import hashlib from collections import defaultdict import rdflib def bnodes(ts): return set(e for t in ts for e in t if isinstance(e, rdflib.BNode)) class IdentityBNode(rdflib.BNode): # TODO this requires a new serialization rule which 'disambiguates' # subgraphs with the same identity that a...
727b1180f91b0c583211a1dd6073760ce787d745b63a17620d16d219763cf618
Python
20,593
442
import sys import numpy as np import torch import time import pickle from sns_toolbox.neurons import NonSpikingNeuron, SpikingNeuron from sns_toolbox.connections import NonSpikingSynapse, SpikingSynapse from sns_toolbox.networks import Network # Personal stuff to send an email once data collection is finished # sys.p...
0bbeb378e92d79556c738974096725a336e0f7a2e3a97c3c6d118d3179e3a0c4
Python
20,635
440
# GNU LESSER GENERAL PUBLIC LICENSE # Version 3, 29 June 2007 # # Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> # Everyone is permitted to copy and distribute verbatim copies # of this license document, but changing it is not allowed. # # # This vers...
45e4cbaf959a6f94714b195636372cf267e77f5d79a8ed109eb733ac7ccdacab
Python
20,642
396
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Mon Mar 6 10:45:19 2017 @author: tpisano Goal is to register 1p/2p timeseries to 2p volume to LS signal to ABA To do: 1) Incorporate resolution of each image 2) Utilize ability to select region of atlas to register to Possibly have to use elast...
de53fc37c1e8919d3f1d46e339c0bc07eba25bb2d85b2355e5abd2ad53120237
Python
20,645
523
"""Base class for clustering.""" __author__ = ["chrisholder", "TonyBagnall", "achieveordie"] __all__ = ["BaseClusterer"] import time import numpy as np from skbase.utils.dependencies import _check_estimator_deps from sktime.base import BaseEstimator from sktime.datatypes import check_is_scitype, convert_to, scitype...
79075525e713e8c9fa1a9c3ba5b0674a3fb995fe3b1f187b21cf3bbbe7b6f66a
Python
20,662
473
import os from quicknat import QuickNat import nibabel as nib import numpy as np import logging import torch import csv import utils.common_utils as common_utils import utils.data_utils as du log = logging.getLogger(__name__) def dice_confusion_matrix(vol_output, ground_truth, num_classes, no_samples=10, mode='train'...
5d850a1ae8c16a0c56fdc84d858f7be475884d008c940525b823a3f3a25c9e67
Python
20,673
432
# 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. from . import svg_draw import numpy import copy _GENERIC_DECENDER = ...
b870fe10757d7a4214453f81755b8755440a6d3e9f621e39d1831c401c99f526
Python
20,675
493
#!/usr/bin/env python3 import rdflib from pyontutils.namespaces import ilxtr, rdfs from neurondm.core import LocalNameManager from neurondm.lang import Phenotype, EntailedPhenotype, Neuron, NeuronEBM, Config slp = 'ilxtr:hasSomaLocatedIn' sllp = 'ilxtr:hasSomaLocatedInLayer' alp = 'ilxtr:hasAxonLocatedIn' dlp = 'ilxtr...
e4a5df3a131434ac3b81bd366bb7a21431a4ece0b7416564dc2793993e963840
Python
20,680
550
# 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...
a2add05d0d12b5e830f201a19b3cae458524f20eea86b10b5c82f868c261bd49
Python
20,686
544
# SPDX-License-Identifier: LGPL-3.0-or-later """Parity tests for SeZM LAMMPS multi-rank (edge-based) inference. The parallel path expands the descriptor node set to the extended region and refreshes ghost-node features through ``deepmd_export::border_op`` between interaction blocks. A single process can emulate one MP...
b00450544e2231d4ac162e3b1f0da94445e88f3b73c7062d0671f154634bc2a6
Python
20,711
660
# 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...
891d3e89f1cbe39a203584adb1033dee374850cd2b58ba94e1a791addeba8217
Python
20,716
507
import logging import numpy as np from ray.rllib.models.modelv2 import ModelV2 from ray.rllib.models.tf.tf_modelv2 import TFModelV2 from ray.rllib.models.tf.misc import normc_initializer, get_activation_fn from ray.rllib.models.catalog import ModelCatalog from ray.rllib.policy.rnn_sequencing import add_time_dimension ...
178250601519128954780746928e5e2fde48ab3bcdb9290384a477649241fdf3
Python
20,761
468
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jul 4 11:38:51 2021 @author: Mesfin Diro """ import os.path as osp from typing import Callable, List, Optional import torch from torch_geometric.data import InMemoryDataset, Data import numpy as np import re from tqdm import tqdm #from tqdm.notebook im...
779f0d704d567bc38b1bad72e8ef894b98780bf4300e72761a31b46ba1cc4e25
Python
20,809
458
#!/usr/bin/env python ############################################################################ # Copyright (c) 2015-2019 Saint Petersburg State University # Copyright (c) 2011-2015 Saint Petersburg Academic University # All Rights Reserved # See file LICENSE for details. ###########################################...
63afad3bd42db6a24de6341cee60a06ece8cf66198bab90703d473b009b8a212
Python
20,834
399
from __future__ import print_function import pickle import warnings import numpy as np from emgProcessing import emg2feature from stageLabelAndOneHot import constructPastStagesOneHots, oneHot2stageLabel # from processFeatures import trimFeatures class StagePredictor(object): def __init__(self, params, extractor, ...
857af77530f6a34dbfac109ba4d7227f54f2dabc7110c705877858cd31d206c9
Python
20,841
589
# 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...
2431515249e9f01df2ba61fe0ec44274dbdb058fd23eed49817859235d668c9f
Python
20,889
421
#------------------------------------------------------------------------------- # elftools: dwarf/locationlists.py # # DWARF location lists section decoding (.debug_loc) # # Eli Bendersky (eliben@gmail.com) # This code is in the public domain #---------------------------------------------------------------------------...
c6ccba965c014815014c30ed5ab999441ce59f30a722df99b0c2d286e111ef4a
Python
20,893
424
""" @file: builder_util_symbol.py Created on 06.12.19 @project: CrazyAra @author: queensgambit Utility methods for building the neural network using MXNet symbol API """ import math import mxnet as mx from DeepCrazyhouse.configs.main_config import main_config def get_act(data, act_type, name): """Wrapper method...
ef19d5c6e8ddb0ca51595ea9e6c9ef5da4aec5eb567a0a9a65f75456ae18ce41
Python
20,908
550
# SPDX-License-Identifier: LGPL-3.0-or-later """Expansion of the ``bridging_method`` sugar into its canonical config form. A bridged model IS a linear composition: the learned model plus an analytical inner potential, summed by ``linear_ener``. The canonical config spelling is therefore:: "model": { "type...
82a4c36eece92cca6fa8615e3e295232884de8cd60c9e5a4ed5c4dd69d5a46c5
Python
20,917
509
# 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...
b1a7bbfaf263c65cc920ff5ff5f6bfb764cdc58f80c2c926093f0e6112981697
Python
20,938
445
from __future__ import absolute_import from __future__ import division from __future__ import print_function import json import logging import os import shutil import time import dill import numpy as np import ray from mprl.utility_services.payoff_table import PolicySpec from mprl.utility_services.worker import Learn...
0ae657a93c41a18835b76e836ec2c4b4a1b970290d2fcd21b416e69b95c95928
Python
21,045
395
from __future__ import absolute_import from __future__ import division from __future__ import print_function import json import logging import os import shutil import time from socket import gethostname import dill import numpy as np import ray from mprl.utility_services.payoff_table import PolicySpec from mprl.utili...
a0894bd237c8323c3a270d232027a106bac2b1e3ebd6fbbca20e4d1655f18bd2
Python
21,045
395
from __future__ import absolute_import from __future__ import division from __future__ import print_function import json import logging import os import shutil import time from socket import gethostname import dill import numpy as np import ray from mprl.utility_services.payoff_table import PolicySpec from mprl.utili...
4e0f45ec9b3027a256c3a1a02fe9660df3e08d483acd9990733ed833a3d30aae
Python
21,053
617
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """ARAR forecasting model.""" __all__ = ["ARARForecaster"] __author__ = ["Akai01"] import math import warnings import numpy as np import pandas as pd from scipy.stats import norm from sktime.forecasting.base import BaseForecaster def _setup_p...
a126982a50d1a130880d0b04d750cb6e7b74bd3b4ef719f3ecd5cb1d3013b0d0
Python
21,081
600
"""Testing advanced functionality of the base class.""" # copyright: sktime developers, BSD-3-Clause License (see LICENSE file) __author__ = ["fkiraly", "ciaran-g"] from functools import reduce from operator import mul import numpy as np import pandas as pd import pytest from pandas.testing import assert_series_equ...
02b01026c101c17521f034d6959400627d1633971b9293db53bf44818685d296
Python
21,084
632
# SPDX-License-Identifier: LGPL-3.0-or-later import argparse import copy import json import logging from pathlib import ( Path, ) from typing import ( Any, ) import h5py import paddle import paddle.distributed as dist import paddle.distributed.fleet as fleet import paddle.version from deepmd import ( __ve...
6489e6dfc79103e3d3e0b2f973eb95d21539caa4c058bf2e7735f24970e434a2
Python
21,108
466
import os import re import glob import numpy as np import pandas as pd import dask.dataframe as ddf import tensorflow as tf from dask.diagnostics import ProgressBar import logging import multiprocessing from tqdm import tqdm from lpcomp import LigandProteinComplex import runner class FeatureGenerator(object): """...
fb5fbc5bc9036294bddbf2b44545a1a5cda28a089cff75c6b80fbf5e01093125
Python
21,120
640
""" author: derricw 2/4/13 core.py This is just a set of random helper functions that are used by a lot of other files, as well as the default configuration of various components. """ import itertools import logging import os import sys import platform import ctypes import ctypes.util import ConfigParser import ...
0243506e5b3f41a4fc8a1f5804f4512f16ca7a98e80eb13cec1db8b1730e19c7
Python
21,128
427
""" @file: builder_util_symbol.py Created on 06.12.19 @project: CrazyAra @author: queensgambit Utility methods for building the neural network using MXNet symbol API """ import math import mxnet as mx from DeepCrazyhouse.configs.main_config import main_config def get_act(data, act_type, name): """Wrapper method...
72f2b8fcd832e4c6be5691bff6922cc143b69379107ad1e9b16ef71917044078
Python
21,144
504
# SPDX-License-Identifier: LGPL-3.0-or-later """Single-rank LAMMPS ``pair_style deepmd`` on the ZBL-BRIDGED DPA4 NeighborGraph (graph-schema) ``.pt2`` (``deeppot_dpa4_zbl_graph.pt2``, ``source/tests/infer/gen_dpa4_zbl.py``). ``bridging_method: ZBL`` builds a COMPOSITION -- ``LinearEnergyModel`` over ``[learned DPA4, I...
e1c61eb6470f96b422b825da7bde2d9f9d5dd662f1b8f20dac93240050a3841d
Python
21,180
567
"""ShapeDTW classifier. Nearest neighbour classifier that extracts shapee features. """ import numpy as np import pandas as pd # Tuning from sklearn.model_selection import GridSearchCV, KFold # Classifiers from sktime.classification.base import BaseClassifier from sktime.classification.distance_based._time_series_n...
20e8e79c609094a351318b3bcc72e96fee5004364bf8da48dea4a466c2325ae4
Python
21,237
443
#!/usr/bin/env python """ Program : rbh_tools.py Language : python Date : 2024-02-07 Author : Darrin T. Schultz Email : darrin.schultz@univie.ac.at Github : https://github.com/conchoecia/odp Support : For issues or questions, please search if the topic has been discussed already on github and op...
e28f3011870870570d32f00afb85b90b77a52b774155de1269b97d5d67c8f387
Python
21,249
570
# SPDX-License-Identifier: LGPL-3.0-or-later """Reciprocal-space topologies of the periodic frames of a batch. A long-range module that serves periodic systems evaluates the lattice sum of its pair kernel in reciprocal space, which needs the cell of every frame and the absolute node positions rather than pair displace...
04b753d3958e8f5be6362ea72e6e8bf52bace576c3eab4eb8693e1149b48670c
Python
21,250
283
# the program to train and test model and do a rule-based ensembling of the masked and non-masked models, with or without document structure, for rare disease entity linking filtering. # this program also export the models for later use in the subsequent steps of this project - to be used in step9_processing_all_docume...
9442d5385a841c13731fa1ef3e40640ff82f2fce5730f1c91e5aaf0f389a8657
Python
21,250
485
import numpy as np import pandas as pd import scipy.special as sc from scipy.stats import uniform from scipy.stats import nbinom from scipy.stats import gamma from scipy.stats import norm from scipy.stats import beta from scipy.stats import binom import time from scipy.stats import poisson from joblib import...
2b1ce94fc3d664bdfeabfe238fb72fe6f64b25283388bf23980b5e507100c7ed
Python
21,261
592
from __future__ import annotations import argparse import json import time from pathlib import Path import numpy as np import torch from scipy import sparse from torch.utils.data import DataLoader, TensorDataset from .data import choose_input_genes, load_dataset, normalize_log_cpm from .grouping import Pseudocluster...
b144c8a618dba37b94c0e3d79f23ac2aad197dd6cafabbc22b6a9aa360eb679c
Python
21,297
686
# 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...
c66c8e7da5f97ef53df44857305ee81a10e7ef503bf04b00fa3938d062011a54
Python
21,315
715
import numpy as np import pandas as pd try: import statsmodels.distributions as smdist except ImportError: smdist = None import pytest from numpy.testing import assert_array_equal, assert_array_almost_equal from seaborn._statistics import ( KDE, Histogram, ECDF, EstimateAggregator, Letter...
4f613c71230f351e957d92b63c3a86b5a4bfaa1dcc78e22bcc919e7fb3277bcb
Python
21,323
617
from __future__ import print_function import os import re from pathlib import Path import collections import numpy as np from neuron import h import neuron import pyqtgraph as pg try: basestring except NameError: basestring = str class HocReader(object): def __init__(self, hoc): """ Pr...
5edef31550e9a20fff81dfc937e58adfa52a5141eadc7068c3456c0432ee0cf6
Python
21,339
398
from __future__ import absolute_import from __future__ import division from __future__ import print_function import json import logging import os import shutil import time from socket import gethostname from termcolor import colored import dill import numpy as np import ray from mprl.utility_services.payoff_table imp...
0269a4cca6eec021d92871853e3f217313f0af3dc9d521b7c7b5a0d928a7e0de
Python
21,348
519
# 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 # # ...
45e90fd7dadd6bfa21577c6aea9897bb24dae5e74a647d8dc0e54b3410c6bfc8
Python
21,352
672
""" Tests of section/segment areas with 3d geometry Partially done to try to understand how Neuron calculates and uses area Also done to determine how to do the rescaling. This code is the basis for adjust_areas.py, which is used to adjust the areas in the models dynamicall (upon loading, with reference to the tables o...
4a9c444b4e2ecbc46deb87a479f2d56be243bb5108d7760ea5f2e004d10922c9
Python
21,359
415
import matplotlib.pyplot as plt import numpy as np import pandas as pd from itertools import compress import numpy.ma as ma from scipy.stats import norm from scipy import stats import os import scipy import sys sys.path.insert(1, "/Users/hyung/Research23_Network_Analysis/mBIN/Python/NetworkAnalysisGeneral/Code/Support...
05ced3eb4d6edb3f4eb69abb9481b793247d9c9faf4bceec94824b83a4e01854
Python
21,365
541
"""The Elastic Ensemble (EE). An ensemble of elastic nearest neighbour classifiers. """ __author__ = ["jasonlines", "TonyBagnall"] __all__ = ["ElasticEnsemble"] import time from itertools import product import numpy as np import pandas as pd from sklearn.metrics import accuracy_score from sklearn.model_selection im...
49eff189d29a7bca2e05f43395f25a3f76842ff2c18d817764eb4b36f117aaf0
Python
21,367
677
""" Functions for feature extraction """ import cv2 import numpy as np import pandas as pd import uuid import math from shapely.geometry import Polygon from scipy.spatial import distance, Voronoi, Delaunay from sklearn.neighbors import KDTree from .bam_utils import get_enclosing_ellipse, ellipse_to_circle, apply_tra...
9a1e504a34abc22aaad56d8718fcf5b9f01c45f2e81f254283187eda51d81e80
Python
21,372
532
# 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 ConvTranspose(Base): @staticmethod def export() -> None: ...
192dd5f3860c98e8ec50a299aada5e167cbaa71b032524f8faa12b44f3c37b90
Python
21,405
558
"""Greedy Gaussian Segmentation (GGS). The method approximates solutions for the problem of breaking a multivariate time series into segments, where the data in each segment could be modeled as independent samples from a multivariate Gaussian distribution. It uses a dynamic programming search algorithm with a heuristi...
dfa1bcb7c7f123c1dd037c2092ca888618aeefe576bce55cf887cac690bcc325
Python
21,424
356
#!/usr/bin/env python3 # -*- 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/. # """Create trackhub""" i...
649a4fe23d27f53af11fa63ef15946b6dd8ef2f0a0caf39986cafefe1e790c77
Python
21,436
460
""" Based on this: https://github.com/mitragithub/Registration/blob/master/atlas_free_rigid_alignment.m """ ''' - take sequence of arrays, arbitrary shapes - resample to max of dimensions per dimension into single array - create a new 3D array where each slice is replaced with a weighted average of its n nearest neig...
96367368ad9a559ccf52ce5a22e925f8bee57b4401fa0a20b2164a41120168b8
Python
21,452
691
# Copyright 2026 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...
d1541c4f5f8768304bd54fd38ac492a9924928409f2655a8a27b506c3e31f0e8
Python
21,494
583
from typing import Dict, List, Tuple, Union import torch import numpy as np import logging from lgn.cg_lib import CGModule, ZonalFunctionsRel, ZonalFunctions from lgn.cg_lib.cg_dict import CGDict from lgn.cg_lib.zonal_functions import normsq4, rep_to_p from lgn.g_lib import GTau, GVec from lgn.models.lgn_cg import LG...
4a2d5c8f4811e2861f2cf2b04aa4baa262cc86b2287c1e30a09e26b5e863689c
Python
21,500
486
#!/usr/bin/env python # -*- coding: utf-8 -*- """Zero-shot Tabby latent anomaly detection on TSB-AD. The foundation model is loaded ONCE per worker and reused for every config and every series -- there is no per-series fitting, so the detector is zero-shot. Scoring embeds each series with the frozen encoder and score...
9f419da804353e20691a61ff9697cfa9575e8918a320bab9d715d795ce57a63d
Python
21,500
465
""" transform dicom data to bids style """ import os, glob, string, logging, argparse, subprocess, json from tqdm import tqdm import pandas as pd import numpy as np from os.path import join as pjoin class bcolors: WARNING = '\033[33m' FAIL = '\033[41m' BOLD_NODE = '\033[1;32m' BOLD = '\033[1;34m' ...
42547967dd0935403ec3c1a16eb64a4343308cf5a8597d1564acd59f36f0bb39
Python
21,517
586
#!/usr/bin/env python3 """This module provide the necessary tools to parse CONTCAR and POSCAR files and convert them to molecules """ import xml.etree.ElementTree import itertools import os from shutil import move from collections import namedtuple, Counter import numpy as np from pyRDTP import molecule def read_from...
5f88804280c61bad4dd5f0ab5a05d72bb07484030526c07772781174640eee49
Python
21,521
794
""" Module for generating rdkit molobj/smiles/molecular graph from free atoms Implementation by Jan H. Jensen, based on the paper Yeonjoon Kim and Woo Youn Kim "Universal Structure Conversion Method for Organic Molecules: From Atomic Connectivity to Three-Dimensional Geometry" Bull. Korean Chem. Soc. ...
55a37cd6277c062afd72e1fc541bbdc2e2c6aae21bf5fb9bdd8edc7df05286f1
Python
21,533
490
from xiangqi_board.xiangqi_board import XiangqiBoard from DeepCrazyhouse.src.domain.variants.constants import LABELS_XIANGQI from ucci_util import xiangqi_board_move_to_ucci, mirror_ucci import time import re import zarr import math import logging import numpy as np import pandas as pd from numcodecs import Blosc cla...
93060d8e8e3ea23d63f91239d17b56c5c27d17dd0db37e9d82a91b77ca446996
Python
21,537
609
""" pattern_summary: Compute the input patterns, and generate a summary figure breaking the cells down by 'drivers' and 'coincidence' for different input patterns. This also has the routines for plotting panel 4F. This module is part of *vcnmodel*. Support:: NIH grants: DC R01 DC015901 (Spirou, Manis, Ellis...
771db100873c81f88adb1ee7fa2bffaab0eb102a43ffb65cde2d979de468e1f2
Python
21,542
558
import logging import numpy as np from ray.rllib.models.modelv2 import ModelV2 from ray.rllib.models.tf.tf_modelv2 import TFModelV2 from ray.rllib.models.tf.misc import normc_initializer, get_activation_fn from ray.rllib.models.catalog import ModelCatalog from ray.rllib.policy.rnn_sequencing import add_time_dimension ...
78d59fcdbe8e6a54b2e417d368d816cc2b980440e79bd46d2dc1f92a075ff70b
Python
21,571
530
#!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-3.0-or-later """Generate the COMBINED native-spin + ZBL-bridging DPA4 .pt2 fixture. One archive, ``deeppot_dpa4_spin_zbl_graph.pt2``: a native-spin (``scheme="native"``) DPA4 that is ALSO bridged (``bridging_method: "ZBL"``), i.e. a ``LinearEnergyModel`` over ``[l...
e961db5f1a7301673201eb647784d9620c2b54318bf61f5d1620935351c8684c
Python
21,577
449
#!/usr/bin/env python import logging import os import importlib import sys import numpy as np import pandas as pd import attention_model import torch from torch.utils import data import torch_visual from torch import save, load from time import time import random import my_data from torch import cuda, device import to...
1c2f280d88a352a3583fd7382b64ebe5f7b1307768ff2fc570e7be185d3d3e5d
Python
21,593
384
""" Connections are the mechanisms for data transmission between neurons. They can either define an individual conductance- based synapse, or a pattern of synapses which is tiled between two populations. """ import numpy as np """ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
8ab959ef9499f03ff3e72ce6e0b345c792e5bf87958c713f569012bed458e9ff
Python
21,593
610
# 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...
d397d171e7d1ad006fc49a2634edeb6ce9472d21dc29aca15938ad79ac58dd95
Python
21,594
444
import time import json import os import json import joblib from io import BytesIO import base64 import boto3 import math import io import cv2 import numpy as np # Grab environment variables TEST_ID = os.environ['TEST_ID'] DETECTION_ENDPOINT_NAME = os.environ['DETECTION_ENDPOINT_NAME'] CLASSIFICATION_ENDPOINT_NAME = ...