sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
9c504203795285dc547aa3f8996db36f6c88918f3182c0c3dab9ec4a67930652
Python
27,854
839
# Copyright 2018-2026 # Institute of Neuroscience and Medicine (INM-1), Forschungszentrum Jülich GmbH # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICE...
f2728aa5d53cd73a2a2f167d59e789292785eb58d7f0aab44266918c1a82a54c
Python
27,857
841
import colorsys from itertools import cycle import numpy as np import matplotlib as mpl from .external import husl from .utils import desaturate, get_color_cycle from .colors import xkcd_rgb, crayons from ._compat import get_colormap __all__ = ["color_palette", "hls_palette", "husl_palette", "mpl_palette", ...
2b22c52aacf38835236ea2e15765642988a52191532bb92c4070e8803ff00ba9
Python
27,876
589
""" @file: trainer_agent_mxnet.py Created on 18.05.19 @project: CrazyAra @author: queensgambit Definition of the main training loop done in mxnet. """ import os import datetime import logging import random from time import time import numpy as np from mxboard import SummaryWriter from tqdm import tqdm_notebook from rt...
2a66d1757ea97ca4e02206d8b9fc61904f5888b437e4639b6f0e95c857519bfc
Python
28,016
835
# 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...
4a5e169143102ec9284c900f3be02ad9a0882bb290bde007ea83352bb01a150b
Python
28,052
707
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Implements adapter for pytorch-forecasting models.""" import abc import functools import inspect import os import time from copy import deepcopy from random import randint from typing import Any import numpy as np import pandas as pd from pand...
4e219c959d8be90f47bbda968d353d9353e51ae38bf1fad856657b17c0be38c9
Python
28,079
770
# Copyright 2023 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...
bcf6da3f11b51ff00c58323b7e93b6000052fcc3b52ac59fb0bfa1d804dd4f45
Python
28,091
789
# Copyright (c) ONNX Project Contributors # # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import math import sys from collections.abc import Sequence from typing import TYPE_CHECKING, Any import ml_dtypes import numpy as np import numpy.typing as npt import onnx.external_data_helper from o...
d7a33e1f81a3776f25e3f220ac165e4aa6636264e0a69cd2c4772428d967e98d
Python
28,091
696
import os import pandas as pd import nrrd import numpy as np import random from colormap import hex2rgb from allensdk.core.reference_space_cache import ReferenceSpaceCache, ReferenceSpace import json import Switches_Dynamic #import get_rootpath import pickle prepath = Switches_Dynamic.get_rootpath() allen_files_path =...
7a0b680f872fa4e436aee08922d94ac5b70d8f7a83f40f59251f3295d74b6bab
Python
28,118
648
from __future__ import print_function from collections import OrderedDict from scipy import interpolate import numpy as np import pyqtgraph as pg from neuron import h import cnmodel.util as util from .protocol import Protocol from .. import cells from ..synapses import GluPSD, GlyPSD, Exp2PSD from ..util.find_point imp...
447cbf55a0d49dc0964a206751631a19242068b67229aafa80efda8f990c7d38
Python
28,119
806
# 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...
21745b200af140d3c6ff4dfb506be126412398c292cbe582504045e773014a80
Python
28,188
793
# SPDX-License-Identifier: LGPL-3.0-or-later """Backend-independent training driver abstractions. The classes in this module intentionally know nothing about TensorFlow, PyTorch, JAX, or Paddle tensor semantics. Backend trainers provide the numerical hooks; this layer owns task/rank normalization, display scheduling,...
bb97616052f1c3dcecec3f3b532635f43727dabf1a4faa7324f7892da18bd96d
Python
28,266
818
# 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...
b314d4305e7c2ae71053744e2c71208516d4f47c0b2612e7a7ce0a87cef4437f
Python
28,343
663
""" This script generates figure S6h from the paper They are the disc plots comparing selectivity index for visual (left panel), auditory (middle panel) and choice decoding (right panel) Internal notes: This is from notebook : 20.5-multispaceworld-quantify-selectivity-index-in-active-condition """ from matplotlib.coll...
4c5f963af210952662acaf6afed5075e1b6cdb6a713ddb0058cd0ac2e3efe76c
Python
28,416
571
from utils import AverageMeter, str2bool, cm_visualize from tqdm import tqdm import torch import torch.backends.cudnn as cudnn import torch.nn as nn import torch.optim as optim import archs from collections import OrderedDict from metrics import Pearson from metrics import RMSE import pandas as pd from sklearn.metrics ...
97020b3683b504ce2c497050806af50a4d4bffea75d4d5d008ca27880b4d2334
Python
28,471
765
# Copyright 2024 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...
8c7a6a44134799cadc8d149ddf0210104c3bd9f4587fa8e331d8a4dd11e7e990
Python
28,514
741
from __future__ import division import os import numpy as np import pandas as pd import seaborn as sns import pylab as plt from SPHARM.classes.image_stack import ImageStack from SPHARM.classes.surface import Surface from SPHARM.classes.spectrum import Spectrum from SPHARM.classes.time_spectrum import TimeSpectrum fro...
a1d486a7d4e98087062c90d255bdaff1fc5d369d5ac651093efe1a47c37a9e00
Python
28,546
719
""" GenerateRun is a class that sets up for a run after the cell has been decorated with channels. It requires the celltype, and a section where the electrode will be inserted. The stimulus in current clamp can consist of single pulses or pulse trains. cd is the channelDecorator, which is also used to set the current r...
c53b9387eeb06c08ed06fc8fef9e077ad6d1cdc0393ccd49a0d1c0c1d236f714
Python
28,599
429
import argparse import numpy as np import sys from hmm_functions import TrainModel, write_HMM_to_file, read_HMM_parameters_from_file, Write_Decoded_output, Calculate_Posterior_probabillities, PMAP_path, Viterbi_path, Hybrid_path, Convert_genome_coordinates, Write_posterior_probs, Make_inhomogeneous_transition_matrix, S...
6f74e227acabc7f6a42c52a01d1299c8772e973cd122a6d9ed4dd33101f2ebe9
Python
28,618
733
# 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...
97c4bc57c027fd05b42b00797a2d09a64271dc7ebd113aa3e3034555131e89b9
Python
28,618
734
# 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...
cc9753cd624a8b14ee0144767f831c7fa1183f552dbf5dc413eb62873ae998c6
Python
28,625
722
#!/usr/bin/env python3 # equivalent indexed as default # equivalent indexed in map only from urllib.parse import urlparse import yaml import idlib import rdflib import ontquery as oq import augpathlib as aug from ttlser import CustomTurtleSerializer from pyontutils.core import OntGraph, OntTerm, OntResGit, OntResIri ...
82e6702c0db9d3346a675f4c97483828478dcf5a6b67f06ee573de6e856d5d4f
Python
28,640
711
# -*- coding: utf-8 -*- """ Created on Sun Aug 27 13:38:21 2017 @author: daniel """ from neuron import h import parameters as p import synapse as s import spine as sp import sys import re import random as rnd import json filename = p.params_for_learning_functions class Neuron(object): """Generic neuron class.""...
321e4a7d8ef2db16dc34030c03fe66a972330512525b451d73f3d205b0840d29
Python
28,648
804
""" Get cell configuration information. Reads an excel file, and generates a data structure for the models with a focus on the synapses. This module is part of *vcnmodel* Support:: NIH grants: DC R01 DC015901 (Spirou, Manis, Ellisman), DC R01 DC004551 (Manis, 2013-2019, Early development) ...
c6420db0113fdbdb193c8dac7668376b5d415133c20b2a91feab7a4618bfadd4
Python
28,652
874
#!/usr/bin/env python3 """ A collection of reused functions and classes. Depends only on python standard library. """ import os import ast import inspect import logging from types import ModuleType from pathlib import Path from datetime import datetime, date, timezone from functools import wraps from collectio...
3f886678234221082b4076e0533fd89cfb7212a54af19069ad3e97ca5604c3c3
Python
28,680
765
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Base class template for objects and fittable objects. templates in this module: BaseObject - object with parameters and tags BaseEstimator - BaseObject that can be fitted Interface specifications below. --- class name: BaseObjec...
997a8772b3f543f84bae1939f774474f4ff93d9fa6ec422b0b668963dac01936
Python
28,725
944
""" Define data structures used for: *Command line parsing* *Specifying model parameters (general)* *Specifying runInfo (run instance) parameters* The aspiration is that all parameters that we vary between runs are defined in either the Params dataclass or the RunInfo dataclass, and are stored along ...
b8e764e9ba3e2b2e4a116071b66fa701d8d26bcd71f98a8fff43d6fe5e8be687
Python
28,743
373
# predict with all documents (with either a weak or a strong supervised model) to get the rare diseases from sent_bert_emb_viz_util import load_df,load_data, encode_data_tuple, retrieve_section_and_doc_structure, test_model_from_encoding_output from rare_disease_id_util import umls2ordoListFromCSV, isNotGroupOfDisorde...
cf7482efcf0ef89b3f6cffe534cea3676e58f662af6e83a8c07dc8389c25725d
Python
28,774
697
"""Pipeline with a clusterer.""" # copyright: sktime developers, BSD-3-Clause License (see LICENSE file) import numpy as np from sktime.base import _HeterogenousMetaEstimator from sktime.clustering.base import BaseClusterer from sktime.datatypes import convert_to from sktime.utils.sklearn import is_sklearn_clusterer ...
d6f0648cf42fd3cbcc698cb76e33773be872cc3fe377a7c26dfe385e1a2c2cb7
Python
28,825
673
import logging import re from pathlib import Path from typing import Optional, Union import torch from deprecated.sphinx import deprecated import flair from flair.data import Sentence, Token from flair.embeddings.document import DocumentEmbeddings from flair.embeddings.token import StackedEmbeddings, TokenEmbeddings ...
1ed6fc64ef3034d25758f1dfa486293e0005c4ad6c18c53b6b6ce6a214971fb6
Python
28,829
741
""" extended_ring_model.py This module contains the full specification for the ring model from the paper. The model is based on data from Pisokas et al. (2020), Goulard et al. (2021), Fisher et al. (2019), Kim et al. (2019), Kim et al. (2017), and Seelig and Jayaraman (2015). [Biology] Pisokas et al. (2020) provide a...
e348fe006a1e60ef7fd1342614a1dfae039a536fe161d5d20797692cb5331686
Python
28,861
619
#!/usr/bin/env python3 import csv from pprint import pprint from pathlib import Path import rdflib import ontquery as oq from pyontutils.utils import byCol, relative_path, noneMembers from pyontutils.core import resSource from pyontutils.namespaces import OntCuries from pyontutils.namespaces import interlex_namespace, ...
9cc98b100b5cd55a2c99fbad897a33c278264a97415a231a1f892114e3dfda01
Python
28,890
774
"""Implements Chronos forecaster.""" __author__ = ["abdulfatir", "lostella", "Z-Fran", "benheid", "geetu040", "PranavBhatP"] # abdulfatir and lostella for amazon-science/chronos-forecasting __all__ = ["ChronosForecaster"] from abc import ABC, abstractmethod import numpy as np import pandas as pd from skbase.utils.d...
9268b9d5cd4ea3bb98086433c3fbbacc3d62e4d172aa2202a5e89f2328668cb5
Python
28,891
790
# SPDX-License-Identifier: LGPL-3.0-or-later """ Radial building blocks for the DPA4/SeZM descriptor. This module defines the cutoff envelope, inner-distance clamp, radial basis, and radial multilayer perceptron used by SeZM. This module is the dpmodel (array-API) port of ``deepmd.pt.model.descriptor.sezm_nn.radial``...
9367b185f0d43838e4d97f07d33829dd22b7c89146369231578c4566bd0dfccc
Python
28,923
551
""" Prompted PatchTST-FM: prompt tuning on a pretrained PatchTST-FM time-series foundation model. Injection point: M prompt tokens are PREPENDED to the patch-token sequence between (in_layer + pos_embed) and the transformer blocks, so prompts carry no positional embedding (the analogue of position_id=0 in the Chronos-...
8634ab18456f1bc4122ce87681b165b9d0c7ff73b30fe8c54e539568646df114
Python
28,973
881
#!/usr/bin/env python3 """ A collection of reused functions and classes. Depends only on python standard library. """ import os import ast import inspect import logging from types import ModuleType from pathlib import Path from datetime import datetime, date, timezone from functools import wraps from collectio...
dddf47c384fbc0e87716f7d22aff539187b9a028a56f86be68af4fc3abd4a089
Python
28,996
568
"""make_shared_dataset.py Create a directory structure based on figure_data.py (in the plotters subdirectory) and populate it with all of the simulation files and intermediate analyses needed to regenerate the figures using DataTablesVCN.py This also populates the Morphology directory for each cell with the .hoc and .s...
7c8876b36ac3067b61ff78c829469ae488b274bb52be8ac248f5103707117c3b
Python
29,001
699
# Copyright (c) ONNX Project Contributors # # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations from io import BytesIO from typing import Any import numpy as np import onnx import onnx.model_container from onnx.onnx_pb import ( FunctionProto, GraphProto, ModelProto, NodeProto, ...
ff8603017bfaddd5b87f882d6b1a0a3121d7f975d77f97686cc8e1fd6abc1f39
Python
29,005
565
""" Module for decomposing the prediction ANN into piecewise linear functions via Taylor Series decomposition """ import model import numpy as np import tensorflow as tf from numba import njit from typing import List, Tuple # def _dCa_dR_relu(mdl: model.ActivityPredictor, reg_input: np.ndarray) -> np.ndarray: # ...
7cfb0390ab61bbb54213dd5359899ddff115839856f12aa0a602f73e42112032
Python
29,011
591
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Extension template for transformers. 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! This is to be us...
81eaa351a9f0a87716c66cdd65e42131c077795245727a473441f88c9c6e4fd8
Python
29,103
741
#!/usr/bin/env python """ Translator Class and builder """ from __future__ import print_function import codecs import os import time import numpy as np from itertools import count, zip_longest import torch import onmt.model_builder import onmt.inputters as inputters import onmt.decoders.ensemble from onmt.translate.b...
eaf93ef1b06c0fc99b13f0eb70b1c9283429b745bb4316ff3edba955bb635867
Python
29,231
1,032
# 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...
243cfe27e45852cfbcd846ba8d875919a42a4c9ff23914c46bc3bd6f0c01b4fe
Python
29,254
676
#!/usr/bin/env python3 # this should be run at NIF-Ontology 9ef5b9e63d60f92cd01733be9d480ac3e5aee31c # TODO need to retrieve the FMA hierarchy... import os from collections import defaultdict, namedtuple import rdflib from rdflib import URIRef, RDFS, RDF, OWL from rdflib.namespace import SKOS import requests from py...
a0e476766df00107e6ade50a2922fe8c57d5b9d233bd6a0bc19736f12be01487
Python
29,286
666
from __future__ import print_function from neuron import h from ..util import nstomho from .cell import Cell from ..util import Params from .. import synapses from .. import data __all__ = ['DStellate', 'DStellateRothman', 'DStellateEager'] class DStellate(Cell): celltype = 'dstellate' scaled = False ...
0376b0c9dd1522e9aa8a8ea53da5070ae8c6d1cbf6652dce87931ed7cf49ed63
Python
29,298
632
from __future__ import annotations import json from typing import Any from typing import TYPE_CHECKING import numpy as np import optuna from optuna import _deprecated from optuna._experimental import warn_experimental_argument from optuna._warnings import optuna_warn from optuna.samplers._base import _INDEPENDENT_SA...
63189a272ea986e9065f7f63eb68a1be1bda4e1ee616f67dc78ebf8b0d4dcbdc
Python
29,377
842
# 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 numpy as np import tensorflow as tf from ampligraph.latent_features.lo...
cd8fe8b1072487e4e546cf17566e0649dd944b8e36cf2f4293813cab34f0bfac
Python
29,404
849
# 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...
1f8ab5d79619c825c4bfc36cd0c494d76817328020f1344209bc78d3504f5ddf
Python
29,517
699
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Implements adapter for Darts models.""" import abc import pandas as pd from skbase.utils.dependencies import _check_soft_dependencies from sktime.forecasting.base import BaseForecaster, ForecastingHorizon from sktime.utils.warnings import war...
7b70ebb035f51a5dc182de9e1117dde7b89ca7e6625765bd843c6feb830fb40a
Python
29,534
908
"""Utility functions, mostly for internal use.""" import os import inspect import warnings import colorsys from contextlib import contextmanager from urllib.request import urlopen, urlretrieve from types import ModuleType import numpy as np import pandas as pd import matplotlib as mpl from matplotlib.colors import to_...
15d4fd6e1040ebe4a9f918a2fdf0839939e24a1a947a068639cda0bb3ede6e8c
Python
29,628
785
from pprint import pprint from contextlib import nullcontext # 3.7 from functools import wraps import rdflib # FIXME decouple import ontquery as oq from hyputils.hypothesis import idFromShareLink, shareLinkFromId from pyontutils import sheets from pyontutils.sheets import update_sheet_values, get_note, Sheet from pyo...
9bd94cba5bf5bba9ac8b166d327e8df463fb4a06fff0e34ce72961f795730acd
Python
29,675
874
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Wed Jan 4 13:14:00 2017 @author: wanglab """ from math import ceil import multiprocessing as mp import numpy as np #import dill as pickle import pickle import os, sys, time, shutil import tifffile from skimage.exposure import rescale_intensity from scipy.n...
86773970f6e6e5e9d9a0904341cecaabecca727f8d43f5b5136a77fa5a9e52fc
Python
29,721
505
from __future__ import print_function """ ****************** NOTE: This version of the file is OBSELETE The numbers for the synapse area have been updated ****************** """ """cell_config generates the configuration of synaptic inputs and devines a cell The synaptic input structure consists of a list of tuples. ...
43d58dc333fbcfbdf7da8c0d4e4bef8d59b30c0d0f62e2dc48b46b616b5d0c6a
Python
29,729
396
# this program calculates # (i) micro-level and macro-level precision, recall, and F1 # (ii) instance-based precision, recall, and F1 - optional, this has issue to deal with non-rare disease documents, i.e. for this (pred-true) pairs (0,0,0 - 0,0,0) and (1,0,0 - 0,0,0) will have the same precision, recall, and F1 sc...
be6571fdea2f5118aeaf31f9677811adb94926ddb4982857a12b67ec9f56729e
Python
29,748
772
import bisect import io import json import logging import os import re from collections import defaultdict from collections.abc import Iterable from pathlib import Path from typing import Any, Optional, Union import conllu import gdown from conllu.models import Metadata, Token import flair from flair.data import Sent...
8df27c79c24593a7253971a8cd1d6ec167c97d6dc8ef1593ef01d1245cee8671
Python
29,755
569
# Copyright (c) 2019. Martin Haesemeyer. All rights reserved. # # Licensced under the MIT license. See LICENSE """ Class wrapper of experiments with support of serialization to/from HDF5 files """ import warnings import h5py import numpy as np from datetime import datetime from os import path import json from typin...
92e011c0c9a77a8232fa6776c98e17277960e26a5f1cb504ae2616739f4ca877
Python
29,805
976
""" """ from .__init__ import * import subprocess as sp import os from scipy import sparse def diag_matrix(X, rows=np.array([]), cols=np.array([]), threshold=None): """Diagonalize a matrix as much as possible """ di, dj = X.shape transposed = 0 if di > dj: di, dj = dj, di X = ...
770a9ba9a73ecadcf455d6a9685d74ff88c6ff52fa15f11506629cfc4c35134a
Python
29,846
810
""" Fill in a table using pyqtgrph that summarizes the data in a directory. Generates index files (pickled python dataclass) that summarize the results. Set the force flag true to rebuild the pkl files. This is meant to be called from DataTablesVCN.py This module is part of *vcnmodel*. Support:: NIH grants: ...
c9565789d55eb994b6294a66973196e554bd122dfb5a99b07948416381483597
Python
29,861
760
# SPDX-License-Identifier: LGPL-3.0-or-later import logging from collections.abc import ( Mapping, ) from copy import ( deepcopy, ) from typing import ( Any, ) from deepmd.utils.model_branch_dict import ( get_model_dict, ) from deepmd.utils.spin import ( normalize_spin_use_spin, ) log = logging.ge...
dc9aeef1636e98a93ecf17e785682c299c41332e4c435b45e3cb60a3aa9089b6
Python
29,896
698
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Abstract base class for early time series classifiers. class name: BaseEarlyClassifier Defining methods: fitting - fit(self, X, y) predicting - predict(self, X) - predict_pro...
98c9920272d92630dbf9b8bce853ca3505c36c83caa40fe487b2232a54cf9313
Python
29,935
768
# 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...
5bd578237691227c4f9b83ce28a14277a8f58dfd83776074c97fd20b284450be
Python
29,943
821
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import contextlib from typing import TYPE_CHECKING import pytest import onnx from onnx import TensorProto, defs, helper MOD_OPSET_13 = 13 MOD_OPSET_28 = 28 if TYPE_CHECKING: from collections.abc ...
3162686afd6282a918117f625141d41753756af778aae8deb2cb52566b1ad7de
Python
29,982
831
"""BOSS classifiers. Dictionary based BOSS classifiers based on SFA transform. Contains a single BOSS and a BOSS ensemble. """ __author__ = ["MatthewMiddlehurst", "patrickzib"] __all__ = ["BOSSEnsemble", "IndividualBOSS", "pairwise_distances"] from copy import copy from itertools import compress import numpy as np ...
ab2ba7a87feb65299650141637f93086f05f20bccb66f4697ba6ad386872a8ab
Python
30,054
820
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import math from typing import TYPE_CHECKING, Any import numpy as np import onnx from onnx.reference.op_run import OpRun if TYPE_CHECKING: from collections.abc import Callable def _cartesian(arr...
3f1af25e6e82dc858dce95533b74fe1c368d6eb242a77cd393d9a75e5de8408c
Python
30,056
823
#!/usr/bin/env python3 import os import tempfile from copy import deepcopy from html import escape as html_escape from urllib.parse import quote from collections import namedtuple from collections import defaultdict as base_dd import htmlfn as hfn from pyontutils.core import OntId, log as _log from pyontutils.utils imp...
fa14e107c1f2ed045db83cd41c4df4892683f32d5db2ad5ca5aad95e57b299eb
Python
30,075
735
"""Pipeline with a classifier.""" # copyright: sktime developers, BSD-3-Clause License (see LICENSE file) import numpy as np from sktime.base import _HeterogenousMetaEstimator from sktime.classification.base import BaseClassifier from sktime.datatypes import convert_to from sktime.utils.sklearn import is_sklearn_clas...
585761883d4217c5c7db06a8a2dc60ad13840e09b2319a9214e35c5f65967abb
Python
30,099
869
"""Utilities for writing code that runs on Python 2 and 3""" # Copyright (c) 2010-2015 Benjamin Peterson # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including with...
18f0ca3aecf6888654e0a7ff5b729fb086b90ddcb4d1b01597bd9fcfd2fa05ae
Python
30,113
695
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # 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 req...
55534bbae027b6927ffd4210e513a14dc4ea956a939d6e7457493357aefb0f7d
Python
30,181
805
"""Benchmarking interface for use with sktime objects.""" import logging import warnings from dataclasses import dataclass, field import pandas as pd from sktime.base import BaseEstimator from sktime.benchmarking._benchmarking_dataclasses import ( ResultObject, TaskObject, ) from sktime.benchmarking._results...
2468b6ecc74abc472dafa135f8c76f9e92983929fe575191dfd3cac0554c7a16
Python
30,257
635
import tempfile import itertools import numpy as np import pandas as pd import mdtraj as mt from biopandas.pdb import PandasPdb from numba import vectorize, float64 class LigandProteinComplex(object): """Extract feature of protein-ligand interaction from pdb file. The series of functions to extract feature...
d883f2c4b4d52b2af82dea09fdfc998cab7cf9297e36186844c918fb3e0bbdf6
Python
30,259
812
#!/usr/bin/env python import argparse from functools import partial import gzip from multiprocessing import Pool, cpu_count import numpy as np import os import pandas as pd from pybedtools import BedTool import re import sparse import subprocess as sp from __init__ import ENCODE, ParseUtils usage_msg = """ usage: %s...
ed2120a1a0b25cf7ea2b0a1d8fe3c7826dbd22017d963ac0ae4bf85822067e80
Python
30,259
725
"""Abstract base class for time series classifiers. class name: BaseClassifier Defining methods: fitting - fit(self, X, y) predicting - predict(self, X) - predict_proba(self, X) Inherited inspection methods: hyper-parameter inspection - get_params() fitted parame...
f07acbb0e2c4c4e9dbd25e6728d264a66dfd411e174b3779913df45792941d62
Python
30,267
559
# -*- encoding: utf-8 -*- from ._db import add_table_data """ Ion channel density tables All of the ion channel densities for the models implemented in cnmodel are (or should be) stated here, and should not be modified in the cnmodel code itself. """ add_table_data('RM03_channels', row_key='field', col_key='model_ty...
dede3c7e9f46566d90d1f97cae51ff56cdbbe997ed48127a0fc418c58f6ae98f
Python
30,290
731
import numpy as np import tensorflow as tf import tensorflow.keras.backend as K from tensorflow.keras.layers import Layer import tensorflow.keras.layers as KL import neurite as ne import math class SpatialTransformer_with_disp_swin(Layer): """ Adapted from Voxelmorph: https://github.com/voxelmorph/vo...
3455676425cfba59cc6a4bfd59fd0b9b6e4334704f881050dd765d32528670e5
Python
30,297
575
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 = ...
47a9e407626694c27569bf868530c7053c6e309a6c3bdd87695a64d562c896bb
Python
30,337
768
import warnings from collections import OrderedDict from copy import deepcopy import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.checkpoint as cp from mmcv.cnn import build_norm_layer, constant_init, trunc_normal_init from mmcv.cnn.bricks.transformer import FFN, build_dropout from mm...
535052787258f33f1e2ab1b4eaf8a12622a0cb64c43640d8e5eb22c3ed7cdfad
Python
30,377
467
#!/usr/bin/env python import sys import os import math import subprocess #import pandas as pd from os.path import isfile, join, isdir from kn_common import pipetools,pipedef from kn_pipeline_class import CPipeError,CPipeStep import hashlib def md5(fname): hash_md5 = hashlib.md5() with open(fname, "rb") as f...
45237b350d7a6c8d5271fbc969b0a31fe44a0fe0beec2b399410c0be19e432f4
Python
30,415
814
# SPDX-License-Identifier: LGPL-3.0-or-later import tempfile import unittest from pathlib import ( Path, ) from typing import ( NoReturn, ) from unittest.mock import ( patch, ) import h5py import numpy as np import torch from deepmd.dpmodel.atomic_model import DPAtomicModel as DPDPAtomicModel from deepmd....
61f7d0a81ec63c056a699082f0f5b4314290073db5a00a941965cd06f787a5d3
Python
30,440
900
# Copyright 2018-2026 # Institute of Neuroscience and Medicine (INM-1), Forschungszentrum Jülich GmbH # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICE...
34a8037e39f822c987f44d4237af03d351409fdb3b5308ce92afad9e177e584c
Python
30,495
773
import logging from typing import Any, Optional, Union, cast import torch from sklearn.feature_extraction.text import TfidfVectorizer from torch.nn import RNNBase from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence import flair from flair.data import Sentence from flair.embeddings.base import ( ...
52da5ba536403c1b75c955fb7ca505e1b4182aa872208ab54eb96c3c7b426e8f
Python
30,523
730
# SPDX-License-Identifier: LGPL-3.0-or-later import math from collections.abc import ( Callable, ) from typing import ( Any, ) import array_api_compat import numpy as np from deepmd.dpmodel.array_api import ( Array, ) from deepmd.dpmodel.common import ( GLOBAL_NP_FLOAT_PRECISION, NativeOP, to_...
192615d0df9f36e4ca74c36e5cee15dbaa7fbd6b603b5ce6605cea70b2fbefd8
Python
30,613
834
from __future__ import annotations import itertools import warnings import numpy as np from numpy.typing import ArrayLike from pandas import Series import matplotlib as mpl from matplotlib.colors import to_rgb, to_rgba, to_rgba_array from matplotlib.markers import MarkerStyle from matplotlib.path import Path from sea...
f2872fca94880915c21175f3b2b22a0b26997ca2ff3b24996d8374ae38fbad3b
Python
30,623
719
#!/usr/bin/env python3 ''' Functions for creating metrics to classify ICA domains Authors: Sydney C. Weiser and Brian R. Mullen Date: 2019-04-06 ''' # import systems level import os import re import sys sys.path.append('/home/feldheimlab/Documents/pySEAS/') # dir of cloned repo # key data management/manipulation pac...
6bd03bfb1432a162339561ffe10b04f6474ded8d0594f8c1d902d5134d691e5a
Python
30,702
626
# ---------------------------------------------------------------------------- # Copyright (c) 2017-2026, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
f743d226c8359e8a85ef67a234ea27ed5e3f559532a66dd19f3189a3198eccef
Python
30,724
855
# Copyright (c) ONNX Project Contributors # # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import argparse import csv import json import subprocess import sys from concurrent.futures import ThreadPoolExecutor from datetime import UTC, date, datetime, timedelta from pathlib import Path from t...
fd905a4a6664667ffa27462985869cc1d363fa232b513c3c5d059603de5ccd65
Python
30,787
798
from __future__ import annotations import sys import warnings from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence from typing import Any, cast import numpy as np import torch from torch import nn from torch.jit import ScriptModule from torch.utils.hooks import RemovableHandle from .enums impo...
b15c427a6346fe704c20442e490ae4b7745c86d0561a512fa6bdd6cdc9b70bfa
Python
30,793
806
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Implements compositors for performing forecasting by group.""" import pandas as pd from sktime.base._meta import _HeterogenousMetaEstimator from sktime.datatypes import ALL_TIME_SERIES_MTYPES, mtype_to_scitype from sktime.forecasting.base impo...
fc8d10e62069946614f0d1bb0f6925b7198377efa3312df02cd2fd177b290c99
Python
30,861
577
""" Simulation backends for synthetic nervous system networks. Each of these are python-based, and are constructed using a Network. They can then be run for a step, with the inputs being a vector of neural states and applied currents and the output being the next step of neural states. """ """ %%%%%%%%%%%%%%%%%%%%%%%%...
bcb19213961f790303ccf443cce874c484a09ae7b2c6103329dc77928f4dab63
Python
30,959
852
"""Machine type checkers for Table scitype. Exports checkers for Table scitype: check_dict: dict indexed by pairs of str 1st element = mtype - str 2nd element = scitype - str elements are checker/validation functions for mtype Function signature of all elements check_dict[(mtype, scitype)] Parameters ----------...
3f659ed4b5561a3c208a4dac864eada8cfebc3d6e557fdb6d699c21b32b8764e
Python
31,044
787
# Copyright 2018-2026 # Institute of Neuroscience and Medicine (INM-1), Forschungszentrum Jülich GmbH # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICE...
a5c65c0fac845b81916659615eda1b7077faaaadc8ee636cdda3ab5a74d49d90
Python
31,119
1,040
""" """ from __init__ import * import numpy as np import pandas as pd import os from scipy import sparse import anndata import logging def get_size_in_GB(obj): """""" GB = 1024**3 return sys.getsizeof(obj)/GB def scf_rna_format_to_h5ad(meta, gc_mat): """ input: - meta (cell metadata) ...
3fce94fbb438818a4ed819ea22432515e6b8cb7028307497f5b4c5716d4bc4a6
Python
31,167
545
# 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 contour_class from celltool.numerics import utility_too...
56975befa486b035697c18f2dfd12bed460cc8f69586c062a134eadfaabdc53d
Python
31,167
810
#!/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 ...
9dac68f9c62b6520469166c96f44ff825de227724a2b9a4dbf365836e0f4ff04
Python
31,180
805
# SPDX-License-Identifier: LGPL-3.0-or-later r"""Native per-atom spin channels for DPA4C. The magnetic moment :math:`\mathbf s` is an *axial* vector: under spatial inversion the edge direction flips while the spin does not, and under time reversal the spin flips while the geometry does not. Labelling every channel by ...
10f96a24a21466ab0e344fe29819c22bc70b84f0428e5d30217761a7f56efcf3
Python
31,236
455
# for visualisation using brat # generate brat annotation format files of all MIMIC-III documents regarding rare diseases ''' reads mention-level pred results all docs[ sup].xlsx to get the mention offsets and ORDO IDs results from NLP MIMIC-III DS-Rare-Disease-ICD9-new-filtered[-sup]-bp.xlsx (an output of st...
17c91cc80c11d65092c8769142a9496355cc8254fb8ff203e94b07627960ec56
Python
31,262
853
"""Conditional Invertible Neural Network (cINN) for forecasting.""" __author__ = ["benHeid"] import warnings from copy import deepcopy import numpy as np import pandas as pd from sktime.forecasting.base import ForecastingHorizon from sktime.forecasting.base.adapters._pytorch import ( BaseDeepNetworkPyTorch, ...
3db401fb6b4663130509f32239546890e5439aa4b17e9215eaa16f355f67c55e
Python
31,309
771
#------------------------------------------------------------------------------- # elftools: dwarf/descriptions.py # # Textual descriptions of the various values and enums of DWARF # # Eli Bendersky (eliben@gmail.com) # This code is in the public domain #-----------------------------------------------------------------...
67d6090b7093b8504a02d1fff74ca9b9d55aba3094cf626e9e8e446de088a87c
Python
31,385
836
"""Advanced tests for the Orthofinder importer. Coverage focuses on patterns common to ortholog inference test suites: - **Inparalog handling**: tandem duplicates on the same chromosome. - **Gene-family expansions**: orthogroups with 10+ paralogs in a species. - **Adversarial ambiguity**: paralogs whose scores tie un...
506c2c49064cc47389e908f768b8ee9c141b4d2d5725be4894a83d831883bfc8
Python
31,395
556
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 ray.rllib.utils.memory import ray_get_and_free from termcolor import colored from mprl.utility_ser...
5980bfb8a4ffee99130a9dbe84f716b3c17df03db258f7abb5db390cef9fba8c
Python
31,473
766
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Implements and interface to the AutoTS library main entry point.""" __author__ = ["MBristle"] import logging import pandas as pd from pandas.api.types import is_integer_dtype from sktime.forecasting.base import BaseForecaster, ForecastingHor...
77247df4737d6752b5a314ca2538de6e89318b0f8502d95bcfe27a3051af9639
Python
31,504
860
# -*- coding: utf-8 -*- import glob import os import codecs import math from collections import Counter, defaultdict from itertools import chain, cycle import torch import torchtext.data from torchtext.data import Field, RawField, LabelField from torchtext.vocab import Vocab from torchtext.data.utils import RandomShu...
a375ef6debd17858459b8885b921698efd342a468eddabf2050fb656072a9fdf
Python
31,509
1,006
from __future__ import annotations import math from collections import namedtuple from typing import Any, Sequence, cast import numpy as np import torch from torch import nn from torch.nn import functional as F from torch.distributions import Categorical, Normal from torch.nn.utils.rnn import pack_padded_sequence c...