sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
54465e7026702c2aaee1a2fb521ca63ffd84ecd338fb5d9482df8cb093bb08bd
Python
12,882
239
""" Dataloader for all datasets. """ import os.path as osp import os,json from PIL import Image import numpy as np import pdb import pandas as pd import torch from torch.utils.data import Dataset from torchvision import transforms import torch.nn.functional as F from .augmentation_pool import RandAugmentMC,RandAugmentP...
7241666b41c2dc2136fdba92dce15e47f8c1e996986b9c4f612ddaae7384d69a
Python
12,904
439
#!/usr/bin/env python3 ######################################################################## # # Copyright (c) 2021 by the contributors (see AUTHORS file) # # This file is part of the CRISPRon # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General ...
b792efce0614a3660ff733eac101438ee8ce7e08dda9a703169eb3ead620f15d
Python
12,910
326
# 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 # ...
0a6a850d2c02d18a4d2545a10929c7461a9860f6036ff40b6ba5afa3341e6693
Python
12,913
802
# type specimen identifier mapping # keys http://api.brain-map.org/api/v2/data/Specimen/ # values http://uri.interlex.org/npo/uris/neurons/ ts_mapping = { 566728192: 116, 523729022: 117, 483099796: 118, 486560376: 119, 483061182: 120, 483018019: 121, 502808270: 122, 486235288: 123, 484509440: 124, 486175203: 125, 4...
ccb7e9952b8900083d17f2d3e97933e142d344b9633b77452b16c4a08d4f97a5
Python
12,915
277
from mprl.utility_services.lock_server.protobuf.lock_server_pb2 import LockRequest, LockConfirmation, LockWorkerPing, LockList from mprl.utility_services.lock_server.protobuf.lock_server_pb2_grpc import LockServerServicer, \ add_LockServerServicer_to_server import logging import threading import os from socket imp...
1cbcfcfdecb2bd070e7633172d65de91fdaa0c75bef56d43754aa045b33e8426
Python
12,918
371
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) # Ported from skchange (BSD-3-Clause), original authors: Tveten """Circular binary segmentation algorithm for segment anomaly detection.""" __author__ = ["Tveten"] __all__ = ["CircularBinarySegmentation"] import numpy as np import pandas as pd f...
e338b494dacf28a220b3770276f978a058ef05918e735d7be9373086a1b3330a
Python
12,918
378
# 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...
8843350a84e38df8be01b00f0fd3f3256e56bad070c8cc2f0a033b5ee1f8ee03
Python
12,925
269
import os import numpy as np import torch import cv2 from scipy.ndimage.measurements import label import random import custom_utils.transforms as T def get_valid_filenames(dir_, masks=False): """Function to get all valid image and mask filenames in a directory""" all_filenames = [f for f in os.listdir(dir_) ...
17bff13836456ae62b7fdf2fcfb9b7027b83e11beec875be565a6485864ab224
Python
12,927
302
import os import importlib import json import glob from jsonschema import validate from datetime import datetime from pathlib import Path from time import time import pickle import numpy as np import pandas as pd from sklearn.pipeline import make_pipeline from timeflux.core.node import Node from timeflux.core.excepti...
fa2c70e3b60eae01652a431de37793d2d0c7baf59c9de411fcaff2016cfbd41c
Python
12,945
429
from pathlib import Path from utils.argparse_utils import get_bool, get_device, get_dtype from utils.argparse_utils import ( parse_model_settings, parse_plot_settings, parse_covariance_test_settings, parse_data_settings, ) from utils.utils import create_model_folder, get_compression_rate from utils.util...
e8f6c9f8521e269eedd037b77a0936eeaedc30e216cb09fa23514d84f4da1f46
Python
12,951
370
""" plot_conflict_shav.py Produce circular scatter plots showing the change in bearing between rolls three and four of the data generated by conflict_shav.py. Note that the same -s option can be specified here, in which case the routine will load any data which was generated using the adjusted reliability weighting m...
13103506e85ae36f9340b6a7f58c4378b6a84c09ac0f6b0d604ed0355cbcc461
Python
12,978
312
# 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...
f09a95ca7b1d73d53649b7e79cb6d57cd308feba04c445a9743c45ffba000347
Python
13,006
409
"""Module to parse and transform the different output files generated by VASP. """ from pyRDTP import geomio from io import IOBase import numpy as np import xml.etree.ElementTree class Frequencies: """Frequencies readed from OUTCAR file Attributes: freqs (lst of obj:`Freq`): List containing the diffe...
0770cbcfd43b1cd1c0f9f73eb6e8b7cce971a86c8b1e38c353972b83d64a40ff
Python
13,019
329
# Copyright (c) ONNX Project Contributors # # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import os import tarfile from collections import deque from typing import TYPE_CHECKING import onnx.checker import onnx.helper import onnx.shape_inference if TYPE_CHECKING: from onnx.onnx_pb impor...
be9607bc8ef252f1386733966f7844df017d4aa0f4ee30894540f6f9452c8a53
Python
13,030
373
#!/usr/bin/env python3 -u # copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Implements base class for time series forests.""" __author__ = ["mloning", "AyushmaanSeth"] __all__ = ["BaseTimeSeriesForest"] from abc import abstractmethod from warnings import catch_warnings, simplefilter import n...
5f7060ad4678e977160be841835e73cd77cbcd7d62fd20f9a3d9956ea26ffb5c
Python
13,031
161
# the original step3: train and test the phenotype confirmation model for rare disease entity linking filtering. # updated with functions and for parameter tuning # the program uses the output of mention_disamb_data files generated by step1_tr_data_creat_ment_disamb.py from sent_bert_emb_viz_util import load_data,...
6c09a68f59072033316bdb9a3c7f8ea269cee29e5c9fc445c956ac5aebdd475c
Python
13,048
404
# Copyright (c) OpenMMLab. All rights reserved. import os.path as osp import tempfile from copy import deepcopy import numpy as np import pytest import torch from mmcv import ConfigDict from mmcv.runner.base_module import BaseModule from mmcls.models import CLASSIFIERS from mmcls.models.classifiers import ImageClassi...
535e95d757ebd924cb0526e27cb3fdd972e645578287d242e3a336f2dffda975
Python
13,059
368
# Copyright (c) OpenMMLab. All rights reserved. from copy import deepcopy from typing import Sequence import numpy as np import torch import torch.nn as nn from mmcv.cnn import build_norm_layer from mmcv.cnn.bricks.transformer import FFN from mmcv.cnn.utils.weight_init import trunc_normal_ from mmcv.runner.base_module...
2cb6208f2a8abdf958d994c87d8f985d2a86edefed5a5ad79e05dc6b885478ec
Python
13,063
395
"""Forecasting benchmarks tests.""" import numpy as np import pandas as pd import pytest from sklearn.model_selection import KFold from sktime.benchmarking.benchmarks import _coerce_estimator_and_id from sktime.benchmarking.forecasting import ForecastingBenchmark from sktime.datasets import ( ForecastingData, ...
8d9d306b1a582cd52405a6e9c66dccdde62e266aa78ddc9f020383d8f73355b3
Python
13,067
395
# SPDX-License-Identifier: LGPL-3.0-or-later import logging from copy import ( deepcopy, ) import pytest from deepmd.utils import ( finetune, ) def _model_config( type_map: list[str], *, descriptor_sel: list[int] | None = None, fitting_neuron: list[int] | None = None, trainable: bool = T...
8cd020e0c3b3017d7466927a9cd49598e82c077eab794076d557b49d8d1da0f5
Python
13,094
375
# 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 # # ...
ae392246e3cb4d3be4cf79e90cdae023564802cebbd6f8e093e1558bdd71953e
Python
13,099
333
"""Functions for reading time series data from .tsf files.""" __author__ = ["rakshitha123"] __all__ = ["load_tsf_to_dataframe"] from datetime import datetime import pandas as pd from sktime.datasets._readers_writers.utils import get_path from sktime.datatypes import MTYPE_LIST_HIERARCHICAL, convert from sktime.uti...
fd6e54ad30457f45213f7fe994bb07473ecac29d660453ce1d3366cd06676a99
Python
13,100
158
""" VS data Vector strength for models with SAM tones, different input configurations. 9 Oct 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,ANVS,maxArea,ninputs, 2,al...
21b0f1a5f5cd2f28912b94bbb1a1bc0daa6bd49272f091ee2096fc2a9bce970e
Python
13,105
316
# 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...
084fcb5e4953e405d7c242cdf19c7d8ea82d034b2e4cb1b33755cb2cd0d47e1a
Python
13,111
334
from __future__ import print_function import numpy as np import random from copy import deepcopy # for the replication of the same simulation data, uncomment next line # np.random.seed(2020) """ Function to generate simulation data with two modalities """ def multi_modal_simulator(n_clusters, ...
7bbf1b7604922be9339684a921cf5acd90a68ff7318400e1114b6bfa7276787d
Python
13,119
445
# 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 # # ...
46ab3c2e3859a3dc1b9484052fdd898e2ccba6801559e4ab7c293fb29b80f77d
Python
13,120
278
#!/usr/bin/env python3 import rdflib from pathlib import Path from lxml import etree from pyontutils.core import makeGraph, createOntology, OntGraph from pyontutils.config import auth from pyontutils.scigraph import Vocabulary from pyontutils.namespaces import makePrefixes try: breakpoint except NameError: fro...
3d3cba7dd96030e177be367ed1d43c1828d97fbed8010a04c53499d0c3908a96
Python
13,121
268
from neuron import h from math import exp import numpy as np import json import neuron_cls as n import spine as sp import parameters as p mod = "./mod/" params = "./params_dMSN.json" morphology = "./morphology/MSN_morphology_D1.swc" h.load_file('stdlib.hoc') h.load_file('import3d.hoc') h.nrn_load_dll(mod + 'x...
9196fe8c3d2b8ca90417625b676f9b17e3ab01515e7952e0d028512693e4f43c
Python
13,123
336
# 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...
6a28d1aad004849b8981160ca417367fcadb22daf2371e27da8973bbf21bcd07
Python
13,125
317
# 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...
e6224abf18bf97c92672cfffb5de416b930525ba2afe78b02a7f09bca928d11b
Python
13,130
330
"""Predefined ParaDime routines for existing DR techniques. The :mod:`paradime.routines` module implements parametric versions of existing dimensionality reduction techniques using the :class:`paradime.dr.ParametricDR` interface. """ from typing import Optional, Union import torch import sklearn.decomposition import...
f4a805f57c9e35b35f3f57bf98a27e717ddeb9bca77050fa3d1880df03213979
Python
13,131
447
""" This document contains methods to visualize compositional data that was imported into scCODA's data format. :authors: Johannes Ostner """ # Setup import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from matplotlib import cm, rcParams from matplotlib.colors import ListedCo...
0edd90556a6dec444a2e2335290aff876f606e354eb74cdd0d56106b6e423860
Python
13,142
386
# 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...
5c79e1244c0f5c7ea360a77fa4139c08a36ccc5aaf994447558fa82bb2f1b81d
Python
13,159
365
# 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...
7201f52ba80f42bf5a2d4cd6d46d8f10565814928d9593f8a70b90a38696c93c
Python
13,161
340
# ============================================================================= # IMPORTS # ============================================================================= import torch.nn as nn import pandas as pd import torch import numpy as np from tqdm import tqdm bar_format = "{percentage:3.0f}%|{bar:20}{r_bar}" # =...
1e934c2a4ee457f446514483d5a160aa292dc8ed9849d2d4e017a42ad4f2c042
Python
13,182
286
""" These are all the runs for the SAM tone data Run with the 0.7686 ASA density Cells 2 and 5 with "standardized axon" 15 dB SPL 3 December 2021 to 8 December 2021 Manual copy from DataTableVCN using selection of runs and "print" function Built: 9 December 2021 """ samdata = { 2: [ "runANPSTH-all-2021...
3490a0858a49747fca465d138b3e4a25a6810b5c5c709a0af6e07cd1f39ef3d3
Python
13,183
310
"""This script is used to run GAME-Net on the web server.""" import argparse import os import sys import time from multiprocessing import Pool import resource sys.path.insert(0, "../src") sys.path.insert(0, "./adsurf") import dockonsurf.dockonsurf as dos import ase from ase.constraints import FixAtoms from ase.db imp...
4dda3a9792f76f1249bcfe7eb29957a9d6bd7492b77f296539e2ed2f5972393f
Python
13,187
298
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 """Guards against defining an operator schema without registering it. An operator schema is *defined* with one of the ONNX_..._OPERATOR_SET_SCHEMA macros in an onnx/defs/**/*.cc file, but it is only actually placed in the schema registry ...
597ebd36ddefd3a3f375ed05816cee8355b64d5d0319f4766f47cca587639361
Python
13,193
408
# 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...
1a7942efff298a3de11a99ebea4fc83d8578d0a5ff1c2e5b81cf61bd05c3e78c
Python
13,201
274
from neuron import h from math import exp import numpy as np import json import neuron_cls as n import spine as sp import parameters as p mod = "./mod/" params = "./params_iMSN.json" morphology = "./morphology/WT-iMSN_P270-09_1.01_SGA2-m1.swc" h.load_file('stdlib.hoc') h.load_file('import3d.hoc') h.nrn_load_d...
a694762118379e3e31dec973fc0822617c6783bc5466240fa293c0be07d543ea
Python
13,217
374
# 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...
975e40e26197b319fcf5fa54cd2964dea6cdbc6b059fb3adf6137732f25f532f
Python
13,248
338
# SPDX-License-Identifier: LGPL-3.0-or-later """Compact LMDB restart state through the real pt_expt data adapter.""" import copy import json from contextlib import ( ExitStack, closing, ) from unittest.mock import ( patch, ) import lmdb import msgpack import pytest from deepmd.dpmodel.utils import lmdb_d...
3a8c40397140d895080812d470d456ecc2178a4c00c0a2a8b2434db05304a0d1
Python
13,252
321
# 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...
e3a70bb08293b5c43269a77e07184e57f3a8183a572499209114478b2e48e2e9
Python
13,252
496
# SPDX-License-Identifier: LGPL-3.0-or-later import itertools import os from abc import ( ABC, abstractmethod, ) from functools import ( lru_cache, ) from pathlib import ( Path, ) from typing import ( Any, ClassVar, ) import h5py import numpy as np from typing_extensions import ( Self, ) fr...
bd629747bd7ef9911869411c6d985136dcf336900aeb8dfa4bfe619c46ed0773
Python
13,271
371
import os.path as osp import argparse import logging from pathlib import Path import torch import numpy as np from utils.argparse_utils import get_bool, get_device, get_dtype from utils.argparse_utils import ( parse_model_settings, parse_plot_settings, parse_covariance_test_settings, parse_data_settings...
3bbc98153eec596c1fbfc42b9bf5cbc9ddf16683bec042c54c73d68267b69b22
Python
13,295
386
"""Functions for plotting EEG processing results. """ import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import sklearn.metrics as skm import seaborn as sns import pandas as pd import pywt import scipy.signal import sklearn.decomposition fro...
ce53ac2b94629f5c8197cf17a74098227ef637bab770e28d051baadaa192aaa3
Python
13,302
378
"""Synthetic data generating functions.""" import numpy as np import numpy.typing as npt from sklearn.utils.validation import check_random_state def piecewise_normal_multivariate( means: npt.ArrayLike, lengths: npt.ArrayLike, variances: npt.ArrayLike | float = 1.0, covariances: npt.ArrayLike = None, ...
73f5a7946192e848b2df52b5905cbd57e2743a1e08d09f1bbd394657f3f6123b
Python
13,304
280
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf from tensorflow.python.distribute import distribution_strategy_context from tensorflow.python.eager import context from tensorflow.python.framework import dtypes from tensorflow....
a0dd58b2b2bceef2c9a6f978ec419c1bdbb01454962ea7d7ca2c941e83c272a3
Python
13,305
350
#!/usr/bin/env python # -*- coding: utf-8 -*- # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This prog...
a5d380ee01e5d20e1d32ca5409eba073063b63420d8819165781bea73970f1cf
Python
13,322
350
import torch import torch.nn as nn from torchvision import datasets from torchvision import transforms import numpy as np import torch.nn.functional as F import torch.optim as optim import sys """ Maps the values of the model predictions back into a square contact matrix """ def generate_image(pred): pred = np.s...
bedd1f5c2f08c3e3ec336c5b67bbc68a9c157faf61aecce43e7e4ff829103ff5
Python
13,327
371
from __future__ import annotations from typing import TYPE_CHECKING import numpy as np from optuna._experimental import experimental_func from optuna._imports import try_import from optuna.visualization._contour import _AxisInfo from optuna.visualization._contour import _ContourInfo from optuna.visualization._contou...
44c264136795dc5688c696a532668ceeff29e617808e1c17267e1e232a2c5dda
Python
13,329
392
import os import sys import yaml import tempfile from pathlib import Path from tempfile import gettempdir from functools import wraps import orthauth as oa from pyontutils.utils_fast import TermColors as tc, log from pyontutils.utils_fast import get_working_dir oa.utils.log.removeHandler(oa.utils.log.handlers[0]) oa.u...
e6411e359b82aea8390d285bcc5dc8ca3500d848bd74096cd1909608314f10a9
Python
13,333
339
import asyncio import os from fhirpy import AsyncFHIRClient from fhirpy import SyncFHIRClient import datetime import random from .loinc_lookup import * import pandas as pd import numpy as np import joblib import shap import matplotlib.pyplot as plt def datetime_to_str(timestamp): return timestamp.strftime("%Y-%m-%...
fcc6c76f94149b8e9336a13514ecacc2aa733209bc2c9dc88571bd733305b43d
Python
13,333
371
from argparse import Namespace from typing import Iterable, Optional, Tuple, Union from .utils import get_jet_name from utils.utils import make_dir import os.path as osp import numpy as np import matplotlib.pyplot as plt from .utils import NUM_BINS, PLOT_FONT_SIZE FIGSIZE = (12, 4) LABELS_CARTESIAN_ABS_COORD = (r"$p_x...
0bd396d6b7ac1b6f92b80908aba646508b103daee61cc2e51f3b9a93de095629
Python
13,341
338
# SPDX-License-Identifier: LGPL-3.0-or-later """The Uni-Mol v1 molecular-pretraining objective. 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 roo...
ef3485170947c4a6166e4698e1351335a46a0a6832e190eac024a3803af14213
Python
13,347
355
import argparse import functools import random from pathlib import Path from typing import Dict, List, Optional import numpy as np import networkx as nx from joblib import Parallel, delayed from tqdm.auto import tqdm import cupy as cp from gluonts.dataset.arrow import ArrowWriter from sklearn.gaussian_process.kernels ...
741e608371748a23e7835596549bd7cc24aa64f62ef174059e7e55aa449385bb
Python
13,354
278
# 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 # from .ComplEx import ComplEx, register_model from ampligraph.latent_features im...
4b636a17bd3534e82d5d1e4e75dcb52e6d343eef097555de76edc761eeb23e8d
Python
13,360
337
# SPDX-License-Identifier: LGPL-3.0-or-later """Test the LAMMPS ``charge_spin`` keyword through ``pair_style deepspin``. The sibling ``test_lammps_chg_spin_pt2.py`` exercises the keyword through ``pair_style deepmd`` (DPA3, non-spin); the DeepSpin ingestion seam is a SEPARATE code path (``pair_deepspin.cpp``'s own ``c...
d2420590a76e98a641592d7d28642103fd4d8b90d41d75d1c217d60d34d04a78
Python
13,372
346
import os import re import logging import argparse import csv from dendrogram_tools import dend_json_2_nodes_n_edges from template_generation_utils import read_tsv, index_dendrogram, read_csv_to_dict from nomenclature_tools import nomenclature_2_nodes_n_edges from abc import ABC, abstractmethod, ABCMeta from os.path i...
72bd1c591b7f0a98e2b253d3b9a5ce2544b8caab5af7ed0456bd9afd329e43f1
Python
13,373
340
import torch import torch.nn as nn import torch.nn.functional as F import pytorch_lightning as pl import numpy as np from fft_utils import * from misc_utils import * import copy from pathlib import Path from optimizer import IIPG DEFAULT_OPTS = {'kernel_size':11, 'features_in':1, 'featu...
f333d7732d65cfa732b0334305887839b40c5101346a362b75a4e8feae0b961e
Python
13,378
334
# !/usr/bin/env python3 -u # copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Implements adapter for statsmodels forecasters to be used in sktime framework.""" __author__ = ["mloning", "ciaran-g"] __all__ = ["_StatsModelsAdapter"] import inspect import numpy as np import pandas as pd from sk...
f237a4f4725bdbe644b5877c637d32b99633922b24a73b03ebaef66277e4d30c
Python
13,401
461
"""Extract reference documentation from the pypa/packaging source tree. In the process of copying, some unused methods / classes were removed. These include: - parse() - anything involving LegacyVersion This software is made available under the terms of *either* of the licenses found in LICENSE.APACHE or LICENSE.BSD...
5b9c53d7092426336693fa9546fca55ed0790c5ba23c6a756d516ce9fdfd0a77
Python
13,402
286
""" These are all the runs for the SAM tone data Run with the 0.7686 ASA density Cells 2 and 5 with "standardized axon" 30 dB SPL 11Aug2021 to 16Aug2021 Manual copy from DataTableVCN using selection of runs and "print" function """ samdata = { 2: [ "runANPSTH-largestonly-2021-08-15.16-02-05", "...
9bd841bee2d9237d9aad6c083da38767a1323e9352ead3e69c8b97fe40bbe8c2
Python
13,403
298
""" This plots figure 6e of the paper. This is the psychometric fit of the behaviour output of the naive model. Internal notes: This is from notebook 21.25 Note that it currently requires xarray == 0.16.2 TODO: there are some pickle files that should be converted to something more readable and independent of xarray v...
a42d42ef49361969a3b8d1265b260e3c733762a760b700d00b8b2888651ff077
Python
13,406
405
#!/usr/bin/env python import argparse from functools import partial from multiprocessing import Pool, cpu_count from numpy import isnan import os import re import shutil import subprocess import sys from urllib.request import urlretrieve from __init__ import ENCODE, ParseUtils usage_msg = """ usage: %s --genome STR ...
8b5b381e3f5f6691c294f60e49e35ead1b30a2cd2c3a28115f443fb861385d4d
Python
13,407
321
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from numpy.testing import assert_allclose import onnx from onnx import TensorProto, helper, numpy_helper from onnx.defs import onnx_opset_version from onnx.reference import ReferenceE...
f326fa14775f4e77de7aca537f19439975f51a79d4ca8aae43a0601a463ab9bc
Python
13,408
366
import numpy as np from scipy import signal from numba import njit import colorednoise as cn class ConfigGenerator: names = [ "betas", "gammas", "beta_sharpness", "phase", "pac", "cross_pac", "phase_shift", "burst_length", ] def __init__(sel...
c5432768aead2225f1bb7f9bd06c974a30beae80a889d3201daa167639e5a8fe
Python
13,413
405
# SPDX-License-Identifier: LGPL-3.0-or-later from __future__ import ( annotations, ) import warnings from contextlib import ( contextmanager, ) from typing import ( TYPE_CHECKING, overload, ) if TYPE_CHECKING: from collections.abc import Generator from deepmd.pd.model.network.init import ( ...
ce9fc116705d83dd3f00e0093964d976e71b5734e00f98c3c836eca6f0433116
Python
13,414
332
import copy import logging import os from collections import defaultdict, deque, namedtuple import numpy as np from ray.tune.schedulers import FIFOScheduler, TrialScheduler from ray.tune.suggest.variant_generator import format_vars from ray.tune.trial import Checkpoint, Trial from tune_tf2.defaults import EXPLOIT_CSV,...
88b17da70e7811f8c83857b3b7e2e4d15c1a64a3cd8ba34d21c51b1c4a51486e
Python
13,420
422
import pandas as pd def convert_pandas_to_listDataset(pd_dataframe: pd.DataFrame): """Convert a given pandas DataFrame to a gluonTS ListDataset. Parameters ---------- pd_dataframe : pd.DataFrame A valid pandas DataFrame Returns ------- list_dataset: list A list of dict wh...
1e88b85db49f5bd91d8595de7cb741317df58bc4f2e7f613ac875be319a5e805
Python
13,423
392
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) # Ported from skchange (BSD-3-Clause), original authors: johannvk """CROPS algorithm for path solutions to the PELT algorithm.""" __author__ = ["johannvk"] __all__ = ["CROPS"] import warnings import numpy as np import pandas as pd from sktime.d...
00997b8ddfee97881da500dc9647a7327909040c9ab40a2e2c065d88906a6833
Python
13,448
336
# 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...
948accafbb6c83c0f4735263692985a87034a30514ede0057339b934250891e7
Python
13,455
386
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: lock_server.proto from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symb...
5d164d3233c159d794f704864bc791cc551032620a868e131ffa77e244ec691c
Python
13,458
362
import math import numpy as np import torch from functools import reduce from scipy.special import factorial from torch import nn as nn from vp_suite.base import VPModelBlock from vp_suite.model_blocks.conv_lstm_ndrplz import ConvLSTMCell from vp_suite.model_blocks.conv import DCGANConv, DCGANConvTranspose class Phy...
633416e0597ff0b5942c5770b5d1e3292f4a63e10eaef1a6daba8d61ce9349d3
Python
13,458
416
# 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...
633e56c9916dca4a643b9b212424835d4dcda0cc90d5072f0ff7c80d6f10e5e2
Python
13,459
367
# SPDX-License-Identifier: LGPL-3.0-or-later import logging import os from abc import ( ABC, abstractmethod, ) from collections.abc import ( Callable, ) from typing import ( Any, ) import array_api_compat from deepmd.utils.errors import ( OutOfMemoryError, ) log = logging.getLogger(__name__) cl...
8731866b504db657d6703d3d7e3c96068c4e0f91f747bbc6919d5ba85e96d3da
Python
13,471
410
#!/usr/bin/env python # coding: utf-8 # In[1]: import pandas as pd import matplotlib.pyplot as plt import cv2 as cv import numpy as np from dataclasses import dataclass import os import random # from numba import njit, jit import shutil from sklearn.utils import shuffle # In[2]: ## read csv files that has been g...
6406074bb7df35856d80d19abbb04bbd46e2cc0830276fd2519c0f38e0b1aadc
Python
13,477
303
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Extension template for unsupervised sequence aligners. Purpose of this implementation template: quick implementation of new estimators following the template NOT a concrete class to import! This is NOT a base class or concrete class! ...
81220fa3bd4bb183428926b538166a915030f1470605fff8b429c9f66f6df6d5
Python
13,481
438
import torch import torch.nn.functional as F from src.constants import * import random import numpy as np class BaseLoss: eps = 1e-9 def __init__(self, model): self.n_output = len(list(model.clusters[0].parameters())[0]) self.weight = 1 @staticmethod def compute_distance(is_binary...
b9087f8445f3990abdb8097ccf16234d9c90f5d3d6f4be50a3522d2480d5e969
Python
13,490
375
# SPDX-License-Identifier: LGPL-3.0-or-later """Edge-vector neighbor-list helpers for SeZM-style models. LEGACY: serves only the deprecated pt-backend edge_vec .pt2 schema; scheduled for removal with that rail. """ from __future__ import ( annotations, ) import torch from deepmd.dpmodel.utils.neighbor_list impo...
c17d6129e28367fa3bcfbe195cbdf9935e1dda32735d7f544e73adbf2f005d21
Python
13,501
292
#======================================================================================================================= #Copyright #======================================================================================================================= # Copyright (C) 2021 Matvey Safroshkin, Grigory Arutyunov, Patrick ...
00dad86cb5803c6ed7d2ea336d02371e9dd2cdc2de02e6c5a96e413082a3f7f4
Python
13,509
438
""" Figure data: a dict of which simulations are in which figures The dictionaries all should have the same basic structure: top level keys are the cell number/ID. Second level keys relate to the experimental conditions. The data in the second level key is either the name of the directory that holds the simulation dat...
62882bad03e90190341cd55cdbeb8215bc7f4e94f434babcb7929cfb3c6c4a86
Python
13,516
347
# 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...
a573fb7488c07009d04059b8e131ddeb8235d116a9b97b6c57bdb32c489dd978
Python
13,524
345
#!/usr/bin/env python3 -u # copyright: sktime developers, BSD-3-Clause License (see LICENSE file). """ Implements the FallbackForecaster. The FallbackForecaster works with a list of forecasters and tries to fit them in order. If the active forecaster fails during prediction, it proceeds to the next. This ensures a rob...
2616f08c554a2e8ad47e3d0b886bdcab452ec2dc2362ee4f3b555bcc15d461d0
Python
13,541
385
"""Utilities for working with the local dataset cache. Copied from AllenNLP.""" import base64 import functools import io import logging import mmap import os import re import shutil import tempfile import typing import warnings import zipfile from collections.abc import Sequence from pathlib import Path from typing im...
8dca2a55b990c7243ba4bf9110a514deb437876ae0a2e1064bf12618789396dc
Python
13,542
378
import os.path as osp import argparse import logging from pathlib import Path import torch import numpy as np from utils.argparse_utils import get_bool, get_device, get_dtype from utils.argparse_utils import ( parse_model_settings, parse_plot_settings, parse_covariance_test_settings, parse_data_settings...
b15fedf7a97b129d84b165d004a5a06a7aff25b1effe817274d372a505681f5d
Python
13,549
386
# 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...
7c2624b56cfc2f993092ed54ec68db5e0549d40e66583ac8657c175ab9c0ddbe
Python
13,554
292
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Extension template for forecasters, SIMPLE version. Contains only bare minimum of implementation requirements for a functional forecaster. Also assumes *no composition*, i.e., no forecaster or other estimator components. For advanced cases (pro...
17970b0d1b897f5d1881602526ffc5a7f2017a73c28fa5ad2d2387407700619b
Python
13,556
303
import ast import itertools import math import os import pickle from collections import defaultdict import cv2 import matplotlib import matplotlib.pyplot as plt import numpy as np import pandas as pd from PIL import Image from allensdk.core.mouse_connectivity_cache import MouseConnectivityCache from matplotlib.collect...
b7b3c6afcb983ef2e2bfd616155d4ef3c34a26dbc30443d5f26455d69a160ee8
Python
13,557
404
# 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...
62730a4f8d5acb65c78937b2d8861d2370c5bdbc46a838428a6935dff4565c41
Python
13,567
383
# 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...
828daf8746df19706af834d7f0c2373b854488b02fe0b78b2a83c3a60520362b
Python
13,568
349
#!/usr/bin/env python3 import os import json from glob import glob from hashlib import md5 from functools import wraps import robobrowser import rdflib from pyontutils.core import makeGraph from pyontutils.scigraph import Vocabulary from pyontutils.namespaces import makePrefixes # ilx api implementation (will change)...
9f18276d9144bf33d0b11a4078b46da7caa12417881484623fc9055e11300643
Python
13,573
398
# Copyright (c) ONNX Project Contributors # # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import itertools import numpy as np import onnx from onnx import TensorProto from onnx.backend.test.case.base import Base from onnx.backend.test.case.node import expect from onnx.helper import ( m...
63a368a4eac91fad546cd76567a364514ded1b0d562b4909519c5649c1a73d8c
Python
13,583
398
"""A module which implements the time frequency estimation. Authors : Hari Bharadwaj <hari@nmr.mgh.harvard.edu> License : BSD 3-clause Multitaper wavelet method """ import warnings from math import sqrt import numpy as np from scipy import linalg from scipy.fftpack import fftn, ifftn from .utils import logger, ver...
bd712b051e64758202ea6fef786a90a70e70f048ac5e731fecb30658015ae3b0
Python
13,608
356
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Machine type converters for scitypes. Exports ------- convert_to(obj, to_type: str, as_scitype: str, store=None) converts object "obj" to type "to_type", considered as "as_scitype" convert(obj, from_type: str, to_type: str, as_scitype: str...
11e49ee6dd57c79b0c2581786ee4234676e73076bcb6b98f4e1af75db95cb9ca
Python
13,611
341
# SPDX-License-Identifier: LGPL-3.0-or-later import json import os import tempfile import unittest from pathlib import ( Path, ) import numpy as np from deepmd.utils.finetune import ( get_index_between_two_maps, ) from deepmd.utils.preset_out_bias import ( bundled_preset_out_bias_tables, load_preset_o...
24befa6c90be53b5d804a97bba6f780ee1e2b293bb76bb01b79cb0881b8a0674
Python
13,633
208
#!/usr/bin/env python3 from neurondm import * __all__ = ['Test', 'Layers', 'PaxRatLayers', 'Regions', 'PaxRatRegions', 'Species', 'BBP', 'CUT'] Config() # explicitly load the core graph TODO need a lighter weight way to do this class Tes...
860a4a360a3811beeff87a469c5d69c05b12e37a444b94c74c3e5d98c9abe6f4
Python
13,633
363
# 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 # import tensorflow as tf import numpy as np class EmbeddingLookupLayer(tf.kera...
2ae0dfbdfd7a976dcc38ee12fcab82dee1d509ad997b01959c8e3926e350ae1f
Python
13,643
411
import numpy as np import matplotlib as mpl from matplotlib.colors import same_color, to_rgba from numpy.testing import assert_array_equal, assert_array_almost_equal from seaborn._core.plot import Plot from seaborn._core.moves import Dodge from seaborn._marks.line import Dash, Line, Path, Lines, Paths, Range class...
76aea30541346999d874bcc155122ef34a3cfc7670161b100b68c719ec92a8f9
Python
13,645
384
"""Orchestration pipelines for preprocessing and feature extraction.""" import time import warnings from pathlib import Path from typing import Dict, List, Optional from bcblib.tools.lesion_features._constants import EBRAINS_ATLAS_SPECS, LF_SUBDIR, TARGET_SPACE from bcblib.tools.lesion_features._bids import ( bui...