sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
2176aca03200e344d9b6df2f223661e1b178baff8201c2cf345523ad40f35d71
Python
31,520
800
import os import pathlib import textwrap from collections import defaultdict import rdflib import graphviz from pyontutils.core import OntGraph, OntResIri, OntResPath from pyontutils.namespaces import rdfs, ilxtr from neurondm.core import Config, graphBase, log from neurondm.core import OntTerm, OntId, RDFL from neuron...
269115e6a319b6018ae58c8cb1a7b615311ffc25614696143fc4b892820c13af
Python
31,641
956
# 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...
45096eb62504b767fdc2fb79a6d8c58df61aa783493501d1e6ece2a806864fc6
Python
31,654
817
# SPDX-License-Identifier: LGPL-3.0-or-later """The model that takes the coordinates, cell and atom types as input and predicts some property. The models are automatically generated from atomic models by the `deepmd.dpmodel.make_model` method. The `make_model` method does the reduction, auto-differentiation and commun...
c9e3ab8349270be4b96a84a5bc34b8239d4e377e92fdc267e573fe8e2048f1a0
Python
31,756
882
"""LLM-driven blueprint generation forecaster for sktime. Inspired by Karpathy's autoresearch: uses an LLM to iteratively generate, evaluate, and refine sktime forecasting pipeline blueprints to find the best combination of transformers and forecasters for a given dataset. """ import base64 import io import json impo...
376fb01f4c06e8251d9a15d0df38e0c2bb0faf1823287acd22e9d382cb56a74a
Python
31,778
625
import os import pandas as pd import numpy as np import tensorflow as tf import dask.dataframe as ddf from dask.diagnostics import ProgressBar from sklearn.model_selection import KFold from sklearn.model_selection import GroupKFold from sklearn.model_selection import train_test_split from datetime import datetime ...
b2d09a9f0c157d394f7ad4908a3ff90ef75a87575059e30102f32e037f2785ba
Python
31,898
623
# -*- coding: utf-8 -*- """ Created on Thu Jun 23 15:26:52 2016 @author: wanglab """ from tools.utils.io import makedir, removedir, chunkit, writer, load_kwargs import multiprocessing as mp import pandas as pd import numpy as np from math import ceil import re, sys, os, cv2, gc, shutil, random import pickle import ti...
149f3cf38b858b3b21995ff43e54d6ec500f21a31fc103e82d263ac924466441
Python
31,930
778
import logging import torch import torch.nn as nn from typing import Tuple, Optional, List, Union from rxnebm.data.chem_utils import ATOM_FDIM, BOND_FDIM from rxnebm.model import model_utils def index_scatter(sub_data, all_data, index): d0, d1 = all_data.size() buf = torch.zeros_like(all_data).scatter_(0, inde...
0e00a2ec85c8066815065ce4eed3169c79ca5680b9083a7a4feb26fbcd99344f
Python
31,935
694
#------------------------------------------------------------------------------- # elftools: elf/relocation.py # # ELF relocations # # Eli Bendersky (eliben@gmail.com) # This code is in the public domain #------------------------------------------------------------------------------- from __future__ import annotations ...
73ff5f4e3cb51374247ff6a217fcc0a0e570c62af1711de52fbab028c0349a49
Python
31,983
627
#!/usr/bin/env python """ This plot contains all of the functions related to making the ribbon plots. These functions can be called by the other programs. """ # ODP-specific imports import odp_plotting_functions as odp_plot # Other standard python libraries import logging # non-standard dependencies # Force the...
9ae51a45df9e8a5987f20b0d39f5c8e3c76168aac0356984c6bd7668d02f1d1f
Python
32,022
809
"""VD-CMA and VkD-CMA Usage examples, VD-CMA: >>> import cma >>> from cma import restricted_gaussian_sampler as rgs >>> es = cma.CMAEvolutionStrategy(20 * [1], 1, ... rgs.GaussVDSampler.extend_cma_options({ ... 'seed': 6, ... 'ftarget': 1e-8, ... ...
8a93f705da878db48abd0671850151297e120e092241b50f1d427ebf32885204
Python
32,130
626
import random, json, os, time import warnings from typing import List, Dict, Any from pathlib import Path from copy import deepcopy import numpy as np import torch import torch.nn as nn from torch.utils.data import DataLoader import wandb from tqdm import tqdm from vp_suite.defaults import SETTINGS, DEFAULT_RUN_CONFI...
fcf66b7c599195b8733d2a67330052fe15f9b5c732abdbb2b596c2ee08fa68bd
Python
32,134
835
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Implements forecaster for applying different univariates on hierarchical data.""" __author__ = ["VyomkeshVyas"] __all__ = ["HierarchyEnsembleForecaster"] import pandas as pd from sktime.base._meta import flatten from sktime.forecasting.base....
52719a209a14951d18399a172f6348cd1c3e9beb711fad956b39bd5c400a3d7d
Python
32,167
600
import matplotlib.pyplot as plt import numpy as np import pickle import seaborn as sea from PIL import Image import pandas as pd def stim2activation(stim): """ converts from a neural potential to a muscle activation between 0 and 1 with a clipped sigmoid curve :param stim: MN potential in mV :return: a...
2191da00672f4059ead009e30433d14864549561ab38af6ec3b0fba366fbf262
Python
32,201
779
#------------------------------------------------------------------------------- # elftools: dwarf/callframe.py # # DWARF call frame information # # Eli Bendersky (eliben@gmail.com) # This code is in the public domain #------------------------------------------------------------------------------- from __future__ impor...
47d48513d6b0a5948a203136278f3c028e6843e3e8516aa4f8fdaa75af111a3f
Python
32,262
710
""" @file: PGN2PlanesConverter.py Created on 09.06.18 @project: DeepCrazyhouse @author: queensgambit Loads the pgn-file and calls the pgn_converter functions to create a plane representation. Multiprocessing is used for loading, computing and saving. IMPORTANT NOTICE: This file is only compatible with python-chess v0...
eaaf14830abf800c8b7794173d284dfb387f49b21c27a5f63c2802ba6502a121
Python
32,263
794
# 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 # """ Graph partitioning strategies. This module contains several graph partitio...
d11cd6de7ec7fea543a46c77498e6e66a191356db93c55ebc87b26924e4c3c10
Python
32,296
567
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...
6f567f3cc15bff81bc2230efa9932cc8b0252d42ae12a276f053f13587f44c35
Python
32,307
724
# ---------------------------------------------------------------------------- # 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. # ------------------------------------------------...
fc7110e2836b45cd5ce3cf31bd1ac42749f7c69e87387e9d0e9785d2e8fc8dd1
Python
32,374
802
import math import warnings import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import (Conv2d, build_activation_layer, build_norm_layer, constant_init, normal_init, trunc_normal_init,build_conv_layer,) from mmcv.cnn.bricks.drop import build_dropout...
c0b9adaa85c10e83ef1375813bf1dcf2e9f2ddc744f660742a0742ab42ce4dad
Python
32,408
885
# 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...
8f70db0e43acdeb10092f51907704d4c272b0e3885efc1aa8e6ba423b1709f0b
Python
32,426
840
""" Dirichlet-multinomial models for statistical analysis of compositional changes in single-cell data. For further reference, see: Büttner, Ostner et al.: scCODA: A Bayesian model for compositional single-cell data analysis :authors: Johannes Ostner """ import numpy as np import time import warnings import tensorfl...
a17a9670e7771e575ba1c5c9ee08d4be49c2ff5af8d49f0813c7688441d9e23e
Python
32,434
854
from __future__ import annotations import logging import pathlib import sys import warnings import numpy as np import torch from energyflow.emd import emds from numba import njit, prange, set_num_threads from numpy.typing import ArrayLike from scipy import linalg from scipy.optimize import curve_fit from scipy.stats ...
f0c167fd561ccb6bdd7142dd48f01d4f7a650b6dd3edb75ad220678ad351e687
Python
32,441
918
# SPDX-License-Identifier: LGPL-3.0-or-later """Bindings and model entry for the fused DPA4 / SeZM SO(2) convolution. The CUDA operator ``deepmd::dpa4_so2_conv`` (see ``source/op/pt/dpa4/so2_conv.cu``) evaluates the whole per-edge span of one ``SO2Convolution``: the attention logits and their envelope-gated segment so...
73d024217aaaddf6a6697b38158df2ec90b12ddb4229dfb3427ad1c0980bdb07
Python
32,445
869
# 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...
4ef3b083e5c3e7dad6c5725492dd72e20101754ded20332b2d094c9c924590ec
Python
32,476
819
# 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 required by ...
c6f5daa08280050d84e76acba87d6b0e0d901711b0723644b7cb9b388b48b0ba
Python
32,477
1,021
# 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 # # ...
578fa62a739314e86f16eb29faad3b440b5a8c46d5cf4b055c6d3983c877f6c7
Python
32,573
757
#------------------------------------------------------------------------------- # elftools: dwarf/dwarfinfo.py # # DWARFInfo - Main class for accessing DWARF debug information # # Eli Bendersky (eliben@gmail.com) # This code is in the public domain #---------------------------------------------------------------------...
b67efeecb8379d99b7b17c056f2ac6ab48afb6fe8a239382b218f6dff4cdf87f
Python
32,726
753
# -*- coding: utf-8 -*- """A collection of variable boundaries (AKA box constraints) handling classes. """ from __future__ import absolute_import, division, print_function #, unicode_literals import warnings as _warnings import numpy as np from .utilities import utils as _utils from .utilities.utils import rglen from ...
edb8a1ee3386fac68ae68d6e87cccbaf4fec2b95d2f73d429d678ca3b49b4c9c
Python
32,755
1,082
# 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...
d4cfa71f6838ba71e2dd1c114bf08a804ae3f257bece8cbca1b1edce0d32eaca
Python
32,788
893
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Frozen-feature UCR evaluation with multi-layer feature fusion. The script follows a Mantis-style evaluation protocol: 1. keep the pretrained encoder completely frozen; 2. resize each UCR series to a fixed length (512 by default; the paper run uses 1024); 3. extract re...
511ed508286128463f9c0e150170e4ce7d217311aa9e496c0eb2a55f572d069b
Python
32,842
878
# 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...
1ba8952323b167a016680fb74001ad76fb2e54dbf37fabf36d04175ba353bf1e
Python
32,848
925
"""Tests for source/odp_functions.py. Focuses on the small utility functions that are exercised throughout the odp pipeline: resource estimators, file-existence guards, chrom file legality + parsing, expand-style helpers used to build snakemake input lists, and small text/IO helpers. Heavier statistical functions (`c...
600a160831d70aa300da76df3512032e11a030ceda3e3fab147a10b4910f7d3f
Python
33,028
847
# 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...
c26ca543bf3d3e21af04b94bf5f052f19a10920135f16f29109108c8422a0dee
Python
33,031
858
from aiohttp import ClientSession, TCPConnector, BasicAuth import asyncio from collections import defaultdict, namedtuple from IPython import embed import json import pandas as pd import random import requests as r import string from sys import exit from typing import Union, List, Dict import ilxutils.scicrunch_client_...
06ad39cad4cc7c3e47a8b3a6d193b5dd8f8a39cde2d4d6391398d254fe195c3c
Python
33,117
877
# SPDX-License-Identifier: LGPL-3.0-or-later import functools import logging from collections.abc import ( Callable, ) from typing import ( NoReturn, Optional, ) import torch from deepmd.dpmodel.atomic_model import ( make_base_atomic_model, ) from deepmd.dpmodel.output_def import ( FittingOutputD...
6a60519948cf8d64f316be7a1342cb8e29db879c101e53ffc70a6aa59a825cac
Python
33,142
1,300
"""Pre-calculated tags for UCR UEA datasets.""" DATASET_TAGS = { "BirdChicken": { "n_splits": 1, "is_univariate": True, "n_instances": 40, "n_instances_train": 20, "n_instances_test": 20, "n_classes": 2, }, "AllGestureWiimoteY": { "n_splits": 1, ...
743fe5d3dd82f74bd2387c01bc8fd323a6e21822c73d568a2f592be5c89a153d
Python
33,216
821
"""Tools for (lean) experimentation and collecting data. See also cma.optimization_tools and cma.utilities.math.test*. TODO: write some running examples as doctests. """ from __future__ import division, print_function import warnings import os import shutil import time from collections import defaultdict, namedtuple ...
ac45355e414676f6b00d0b6eca456143aff24a0375968fb4cf8ad1699198bcad
Python
33,251
1,081
from __future__ import division import colorsys from itertools import cycle import numpy as np import matplotlib as mpl from .external import husl from .external.six import string_types from .external.six.moves import range from .utils import desaturate, set_hls_values, get_color_cycle from .colors import xkcd_rgb, ...
218b6852528a1940daf60b3defd924e745795da6e269563d1900006378292640
Python
33,322
857
# SPDX-License-Identifier: LGPL-3.0-or-later from collections.abc import ( Callable, ) from typing import ( Any, ) import torch from deepmd.dpmodel import ( ModelOutputDef, ) from deepmd.dpmodel.output_def import ( FittingOutputDef, OutputVariableCategory, OutputVariableOperation, check_op...
1a266ad45703264a346d724565245ab2b00af35a77c0128be4eeb93e63ff79a5
Python
33,326
865
#!/usr/bin/env python2 '''Subclass of standard PsychoPy Window to perform warping and RGB60 -> Mono180 Hz''' import sys import os # Ensure setting pyglet.options['debug_gl'] to False is done prior to any # other calls to pyglet or pyglet submodules, otherwise it may not get picked # up by the pyglet GL engine and hav...
eae689e62fffbf468cb5e1bdbfdf71728ce94e4caa80e2c136785d9b24f7df51
Python
33,400
933
"""This module provide the necessary tools to read and write different geometry formats including the molecule object format of pyRDPT Attributes: GENERIC_CELL (obj:`np.ndarray[3,3]`): Generic cell parameters used to generate cell parameters if they are not defined in the given format. FORMATS_DIC (dic...
c0ad5447fd305fc7f9b47fc6a937f416fcb9be827bd584c5a31b65f308713961
Python
33,516
982
#!/usr/bin/env python3 import tempfile from pyontutils.config import auth __doc__ = f"""Client library generator for SciGraph REST api. Usage: scigraph-codegen [options] [--dynamic=<PATH>...] Options: -o --output-file=FILE save client library here [default: {tempfile.tempdir}/scigraph_client.py] ...
c72050d5c35fa05e7ce50e8b3c58b36bce0a497965f7355c2e1e507109304dab
Python
33,540
1,015
# Copyright (c) ONNX Project Contributors # # SPDX-License-Identifier: Apache-2.0 """Automates the generation of ONNX operators.""" from __future__ import annotations import difflib import importlib import inspect import keyword import os import pathlib import re import shutil import sys import textwrap from typing i...
459ee27f65498553ef2b2223044a0a097e57ab74981b2aacdfe115865d782e46
Python
33,593
891
# -*- coding: utf-8 -*- """Collection of classes that sample from parametrized distributions and provide an update mechanism of the distribution parameters. All classes are supposed to follow the base class `StatisticalModelSamplerWithZeroMeanBaseClass` interface in module `interfaces`. """ from __future__ import abso...
d01db1a30ba472aa7e5340f665ac112b5c96b6a64807cb22c13c9951dbb5b97a
Python
33,618
916
from models.se3transformer_layers.utils_profiling import * # load before other local modules import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from contextlib import nullcontext from typing import Dict from models.se3transformer_layers.from_se3cnn import utils_steerable from mod...
efe750b9ff427c09dd12b242bd29c7b2bd2c9bc187196b19440da8361776cdf9
Python
33,644
816
# -*- coding: utf-8 -*- """ Created on Tue Apr 24 03:35:50 2018 @author: lyra7 """ import logging import os import time from PIL import ImageChops from psychopy import logging as logging_psychopy from psychopy import event, core from psychopy.visual import ElementArrayStim from psychopy.tools.arraytools import val2ar...
836f9b59c33793699632709a386040acd876d0e9c716d0527a81611a7af5ff62
Python
33,760
841
from __future__ import annotations import argparse import json import math import time from dataclasses import dataclass from pathlib import Path import numpy as np import pandas as pd import torch from scipy import sparse from sklearn.decomposition import PCA from sklearn.cluster import KMeans from sklearn.linear_mo...
e8fe2ee8269202a1134ad81c668494c8f807f88e000bb25e115c82d27ddf1f09
Python
33,796
575
# get rare diseases from free-texts using Gate-BioYODIE and ontologies import json import sys import urllib # pip install requests # https://pypi.org/project/requests/ import requests from collections import defaultdict import pandas as pd import os import re import requests # extracting umls from...
ed9e3f1dc2f40de3d49268f91e690c0d2fcf3cc272e69b4d416b1d4d04a806ef
Python
33,816
849
# 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...
ed46162d480e358d3c1f13ae8341f80aee69b6503c185acd44d44e8dcca18f27
Python
33,822
867
# SPDX-License-Identifier: LGPL-3.0-or-later import functools from collections.abc import ( Callable, ) from copy import ( deepcopy, ) from typing import ( Any, ) import torch from deepmd.dpmodel import ( ModelOutputDef, ) from deepmd.pt.model.atomic_model import ( DPAtomicModel, ) from deepmd.pt....
43f808498089df664cfd8d5a85e06a7c816515e67857a1daf15632944646e8df
Python
33,878
866
from gui.CustomWidgests import BlobColor,BlobColor_,BlobColor_object,names from gui.GUI import Ui_MainWindow from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtCore import QPoint,Qt import pathlib import Path_Finder from PyQt5.QtWidgets import (QMainWindow, QTextEdit, QGraphicsScene,QFrame, ...
2a1088b008d26928ca51af89f5cdc3a05c8f51139ac5cb78e84ee5b31d4f07a8
Python
33,924
852
import torch.nn as nn import torch import torch.nn.functional as F from torch.distributions import Bernoulli from torch.autograd import Variable # from scipy.special import gamma # NOTE: This is not used! import numpy as np import math import pdb import torchvision.models as models from torch.nn.parameter import Par...
218091ecddf94253659030bbea1b2ad7ebfe8ab5fff903510272e8d97e46d3aa
Python
34,058
1,016
"""Signature kernels from Kiraly et al, 2016.""" __author__ = ["fkiraly"] import collections from functools import partial import numpy as np from scipy.sparse.linalg import svds from sklearn.base import BaseEstimator, TransformerMixin from sktime.dists_kernels.base import BasePairwiseTransformerPanel # cumsum var...
88cf937a4c21f66e35048ada4f215703780dda08f7675bbd46ded2ce7e523e30
Python
34,086
1,035
# 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...
5746637a7635605522fcb2775fc247200f065cda85a52b7a12a5a4a8cb12c404
Python
34,259
932
# 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 logging from collections.abc import Iterable from itertools import isli...
f79fafe365d9caa07ed4f64f1ccbe97718905de5c8da19ea858f749e57b04a93
Python
34,285
969
# SPDX-License-Identifier: LGPL-3.0-or-later """Training entrypoint for the pt_expt backend.""" import argparse import logging import os from dataclasses import ( replace, ) from pathlib import ( Path, ) from typing import ( Any, ) from deepmd.dpmodel.atomic_model.inner_potential import ( InnerPotenti...
5c036f56675ec329030fe56ed98253d037520059549e0e76848bd51f07058b68
Python
34,326
950
"""Plotting functions for linear models (broadly construed).""" import copy from textwrap import dedent import warnings import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt try: import statsmodels assert statsmodels _has_statsmodels = True except ImportError: ...
41678c812847b1f8b0932053a2be6f252ff3d73538c7336dffddb345c885d2e9
Python
34,347
1,106
#------------------------------------------------------------------------------- # elftools: elf/descriptions.py # # Textual descriptions of the various enums and flags of ELF # # Eli Bendersky (eliben@gmail.com) # This code is in the public domain #----------------------------------------------------------------------...
a2fe06a66e93c4592be784ca48df5503b55e457147326018f7f976a672b5108d
Python
34,365
676
from os.path import join from pandas.api.types import is_numeric_dtype # Seeds from os import environ from random import seed as rseed import numpy as np import pandas as pd from sklearn.preprocessing import MinMaxScaler, StandardScaler from sklearn.decomposition import PCA import matplotlib.pyplot as ...
9d3cd2d052e250f337c49d3c828e358cb2ceabbf6e99519a9435b218eb7c8d4e
Python
34,410
929
import types import rdflib from ontquery.terms import OntId from pyontutils.utils_extra import check_value from pyontutils.namespaces import TEMP from pyontutils.closed_namespaces import rdf, rdfs, owl try: breakpoint except NameError: from IPython import embed as breakpoint def flattenTriples(triples): f...
72f96f1bb0d9f9c79589e1ba3ae434ab2046a561e6c18b5d8afb80e220b9431c
Python
34,456
869
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Wrapper for easy vectorization/iteration of time series data. Contains ``VectorizedDF`` (iteration schema) and ``prepare_VectorizedDF`` (convert once, then construct the schema). """ __author__ = ["fkiraly", "hoesler"] import itertools impo...
d8eafd39040b41bcaba80710cd771fb16efb44d11928ba632e9b5a49505f5c9d
Python
34,467
1,214
# SPDX-License-Identifier: LGPL-3.0-or-later # ruff: noqa: ANN001, ANN202 """Bindings and model entry for the fused SO(2) value path, training form. The CUDA operator ``deepmd::sezm_so2_value_fwd`` (see ``source/op/pt/dpa4/so2_conv_train.cu``) evaluates the value stream of one ``SO2Convolution`` up to the attention ag...
db7e9d1fa38e5477fcd61052577d93fa8545c02bee6c0ee62dcb4d14aa85d001
Python
34,511
795
# SPDX-License-Identifier: LGPL-3.0-or-later """Freeze-time measurement of the fitting route of compressed DPA4C. The fused energy-force operator of compressed DPA4C evaluates its fitting network over runs of nodes, either through the fused kernel, in one of the shapes compiled for the hidden width, or through the per...
530d2f5606f33bd189bdef544242a1f7ba37dac7a243fbda0786765426b1a211
Python
34,630
982
from functools import partial import warnings import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.cbook import normalize_kwargs from ._base import ( VectorPlotter, ) from .utils import ( adjust_legend_subtitles, _default_color, _deprecate_ci,...
411d7452a18f6d8b7a3d60a15303d5e256ae030f12249db32bec3d9e4ebe6b85
Python
34,682
782
""" test_bushy_variation.py Test inputs to bushy cells as we co-vary the KLT and IH conductances Two tests: IV and spikes. Simulation results are first written to disk (.p files); plotting is done separately Usage: python test_bushy_variation.py [a, b] a runs IV curvers with variations of gKlt/gh b runs PSTHs to AN i...
acd28727c4bc5a91faa98cbaac6eea13f532b461dde0ec24a6032a9b292315a6
Python
34,703
669
from __future__ import print_function from os import mkdir from os.path import isdir import numpy as np from stageLabelAndOneHot import stageLabel2oneHot from inputAndOutputExtractor import InputAndOutputExtractor import torch import torch.utils.data from torch import nn, optim, cat from functools import reduce from op...
dabcd1a802acfb060439f9aabdeba5536ad7a9f19a78f9a41a33d7bd4f388f71
Python
34,931
949
# 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 # """SQLite backend for storing graphs. This module provides SQLite backend for ...
9211dbdbde4592f9aeccefd3224d4d91a6ebb2294f3551c6da9cdaf16764ed2d
Python
35,097
913
""" Core functions for running Palantir """ from __future__ import annotations import numpy as np import pandas as pd import time import copy from sklearn.metrics import pairwise_distances from sklearn import preprocessing from sklearn.neighbors import NearestNeighbors from joblib import Parallel, delayed, effective...
e4ac68281aeade64c4ac52562da8c425f311ced2fe968ddbfae0f007846cb3a6
Python
35,137
883
# 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...
24adc1406fb00943ae1f61cbe6dc8ecca8a5b6d5e17f8bac8ea939efb7cfe6f3
Python
35,141
965
import numpy as np import tensorflow as tf import tensorflow_probability as tfp from lfads_tf2.initializers import make_variance_scaling, ones_zeros, variance_scaling from lfads_tf2.regularizers import DynamicL2 from lfads_tf2.tuples import ( DecoderInput, DecoderOutput, DecoderRNNInput, DecoderState, ...
af5086f7aeafd069caa546420f5f1aaa99ce3d2ecadc2f1d81ba680efc569506
Python
35,213
817
#!/usr/bin/env python3 -u # copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Interface to ARIMA and AutoARIMA models from pmdarima package.""" __author__ = ["mloning", "hyang1996", "fkiraly", "ilkersigirci"] __all__ = ["AutoARIMA", "ARIMA"] from sktime.forecasting.base.adapters._pmdarima impor...
78d7ed5058853479d3e7399bc58cfe89bfeac95a486190a37cb7bb9893ae6bfe
Python
35,303
717
import logging from math import inf from typing import Optional, Union import torch from torch import nn import flair.embeddings import flair.nn from flair.data import Dictionary, Sentence, Token from flair.datasets import DataLoader, FlairDatapointDataset from flair.training_utils import Result, store_embeddings lo...
0c6c3dc0a526af32166bd281c9a900b474b6f89f722d2c329d567c1507eb6940
Python
35,350
756
import pandas as pd import os import time from dotmap import DotMap from pathlib import Path import math import numpy as np from cutadapt.adapters import AdapterParser from cutadapt.seqio import Sequence from scripts import feature_util #####################################################################...
d22b45971abea64067dbf03cbfaf7243d604a2eac2f414ae2a39fe0152cfda20
Python
35,371
926
# Copyright 2022 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...
f80792af1c27aed0e7f865961aef11400e759d75a01f02a65a89635501403f2a
Python
35,379
949
xkcd_rgb = {'acid green': '#8ffe09', 'adobe': '#bd6c48', 'algae': '#54ac68', 'algae green': '#21c36f', 'almost black': '#070d0d', 'amber': '#feb308', 'amethyst': '#9b5fc0', 'apple': '#6ecb3c', 'apple green': '#76cd26', ...
92e6b2306d8683345aec7e348bfe1416dfdc004a72cda30e32ba7213ab416106
Python
35,426
579
#!/usr/bin/env python3 import rdflib import ontquery #from pyontutils.core import OntId, OntTerm from pyontutils.utils import relative_path from pyontutils.namespaces import makePrefixes, makeNamespaces from pyontutils.namespaces import NIFRID, ilxtr, hasRole, definition from pyontutils.closed_namespaces import rdf, rd...
0d3695ccefa966bc8e039fbc3eb6010e3b414db4507be597b50e77b5abf1424b
Python
35,434
775
import pandas as pd import pickle as pkl import numpy as np import os import glob import matplotlib.pyplot as plt import matplotlib as mpl from tqdm import tqdm import src.data.struct_to_dataframe as stdf # Plotting import sciplotlib.polish as splpolish import sciplotlib.style as splstyle import src.models.predict_...
8c7e6aa760b926193a2e5f892e9a76a729c88c4db46fd965f5183df48b0ab0eb
Python
35,434
579
#!/usr/bin/env python3 import rdflib import ontquery #from pyontutils.core import OntId, OntTerm from pyontutils.utils import relative_path from pyontutils.namespaces import makePrefixes, makeNamespaces from pyontutils.namespaces import NIFRID, ilxtr, hasRole, definition from pyontutils.closed_namespaces import rdf, rd...
5b79c9564f4e8660c603c9c7bf0feb2e288cc330bf0ec2f137a7963088d5c842
Python
35,460
767
from src.utilities.DDE_Solver import ddeinttf import quadpy import time import timeit import sys import os from tqdm import tqdm from IPython.core.debugger import set_trace import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from scipy import integrate import scipy.interpolate import pickle im...
f398ac15f164f23f2111b43d32dcabb24d4ca131f7b7650dc64424cc20ee498b
Python
35,522
1,094
from __future__ import annotations import re from copy import copy from collections.abc import Sequence from dataclasses import dataclass from functools import partial from typing import Any, Callable, Tuple, Optional, ClassVar import numpy as np import matplotlib as mpl from matplotlib.ticker import ( Locator, ...
5afb9c1e0ea71edd89862ce45e698ec43fea25c07e84908e818fa25d77bdc524
Python
35,529
1,218
"""Machine type converters for Panel scitype. Exports conversion and mtype dictionary for Panel scitype: convert_dict: dict indexed by triples of str 1st element = convert from - str 2nd element = convert to - str 3rd element = considered as this scitype - str elements are conversion functions of machine type (...
b954e9d6fbd946797d0c892ce3df92b6b67cf1411f11efa2c6c86e2b9fdbbf08
Python
35,576
979
# 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...
15a37e4762567c835632866fbd25cd7884de17c87eb67ee889e9197dc7278d25
Python
35,645
780
""" @file: PGN2PlanesConverter.py Created on 09.06.18 @project: DeepCrazyhouse @author: queensgambit Loads the pgn-file and calls the pgn_converter functions to create a plane representation. Multiprocessing is used for loading, computing and saving. IMPORTANT NOTICE: This file is only compatible with python-chess v0...
5e0e642ff80c4116be093e501d616330e07a980f0b492840ae8564dca7cd2549
Python
35,653
1,158
# Copyright (c) ONNX Project Contributors # # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations from typing import Any import numpy as np import onnx from onnx.backend.test.case.base import Base from onnx.backend.test.case.node import expect def softmaxcrossentropy( x: np.ndarray, targ...
9a684652772d8bcc33b6bbcbc5c9206d53a84e37676ae08a2a35f8c54e083bbd
Python
35,766
1,156
""" Models for the model comparison benchmark in `scCODA: A Bayesian model for compositional single-cell data analysis` (Büttner, Ostner et al., 2020). These models are otherwise not part of scCODA, but make a nice addition for comparison purposes and are thus part of the main package. :authors: Johannes Ostner, Mare...
a0732d2e5b7f98f4d74cfc40a039a80fd63e0dd1ba815c82dff3da83f35a40e5
Python
35,768
1,100
# Copyright 2019-2020 The ASReview Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
bbceeb5107c7da4607f4a0e64ac3ba6d2ea0abb0f64a87ae1fed85bd32d6f7b5
Python
35,889
773
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Extension template for forecasters. 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 use...
390e466b63869cbf7a285b510329eecbd352c48bb9c525a9a5594278f23fab68
Python
35,929
837
# -*- coding: utf-8 -*- """versatile container for test objective functions. For the time being this is probably best used like:: from cma.fitness_functions import ff """ from __future__ import (absolute_import, division, print_function, ) # unicode_literals, with_statement) # from __fu...
537c087d8f1c1a033af4c9b2f6272dedb576288012ec60b3d3e2903086c34bb7
Python
35,938
918
# ---------------------------------------------------------------------------- # 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. # ------------------------------------------------...
3fb29af293a014ebbaf64423d27e44fa1a7268869c267fd0034829bf573a579f
Python
35,952
768
""" @file: crazyara.py Created on 18.10.18 @project: crazy_ara_refactor @author: queensgambit Universal chess interface (CUI) communication protocol interface for the engine. The protocol was published by Stefan-Meyer Kahlen (ShredderChess) and can be accessed at: http://wbec-ridderkerk.nl/html/UCIProtocol.html """ f...
2dbbf4bf18b8103890cc372a637d7cb77100f67b9b3c61c029830399052e0520
Python
35,953
768
""" @file: crazyara.py Created on 18.10.18 @project: crazy_ara_refactor @author: queensgambit Universal chess interface (CUI) communication protocol interface for the engine. The protocol was published by Stefan-Meyer Kahlen (ShredderChess) and can be accessed at: http://wbec-ridderkerk.nl/html/UCIProtocol.html """ f...
0c5a5516337bc199a692526c26981381a06cd28fa7edc02690fc4c057804ddf8
Python
35,961
1,075
# Copyright 2023 DeepMind Technologies Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
7fe8c6d51f87282e4a0d0d3492c46689047dd6ae50ba873f3f190372cc73f952
Python
36,088
1,104
''' All processes that operate outside of the EVOLVE main code like simulation codes should be included in this. .. codeauthor:: Nicholas Browning .. codeauthor:: Simon Duerr dev@simonduerr.eu .. codeauthor:: Justin Villard ''' from __future__ import division from __future__ import print_function from builtins impor...
00cb37bae63b970b803346e65320cb7ec8e8f0b3a2c2cd031524276751a689be
Python
36,118
937
''' Evaluators in EVOLVE are functions that can call outprocesses and that return fitness values. .. codeauthor:: Nicholas Browning .. codeauthor:: Simon Duerr dev@simonduerr.eu ''' from __future__ import print_function from builtins import str from builtins import range from src.gaapi import Individual from src.g...
b41a51c0d4630639ae5e612c5a777f4bf284bcf34bae107fe3f58407b0035267
Python
36,123
770
from src.utilities.DDE_Solver import ddeinttf import quadpy import time import timeit import sys import os from tqdm import tqdm from IPython.core.debugger import set_trace import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from scipy import integrate import scipy.interpolate import pickle im...
2b02afc1e02d10f668a9abaae6d8f712534cff974a1f538fb251efba25abf57f
Python
36,238
860
"""Wrapper for objective functions like noise, rotation, gluing args """ from __future__ import absolute_import, division, print_function #, unicode_literals, with_statement import warnings from functools import partial import numpy as np import time from .utilities import utils from .utilities.math import Mh as _Mh f...
70e0b6cc70092bfb5c5da95987bcc801c5b155003f775f071baf49c913181faa
Python
36,256
1,047
""" Adjust areas of hoc files (mesh expansion) This module is part of *vcnmodel* Support:: NIH grants: DC R01 DC015901 (Spirou, Manis, Ellisman), DC R01 DC004551 (Manis, 2013-2019, Early development) DC R01 DC019053 (Manis, 2020-2025, Later development) Copyright 2019 Paul B. Manis...
d6d8b38de563fc655064a168ec9a001b8daf82533aa59100f007744ce12ebdc8
Python
36,277
988
""" This module provides tools that take an original HOC file and replaces the axon sections (including the AIS, hillock, and myelinated sections) with some variant of a "standardized" axon. The modified version of the cell is written to a new file. This module is part of *vcnmodel*. Support:: NIH grants: DC...
6c929bf655022d6b34640b8aea7e6362f73d565e7856fa2a4456258cb3994772
Python
36,325
791
import numpy as np from dnnbrain.io.fileio import RoiFile from dnnbrain.dnn.base import UnivariateMapping, MultivariateMapping class ROI: """ A class used to encapsulate and manipulate ROI data of brain """ def __init__(self, rois=None, value=None): """ Parameters ---------- ...
817e1e30660ce50dd4fa26cd173d341bdd3c4582985db3f91d001ebd3e97bf81
Python
36,370
1,103
# Copyright (c) OpenMMLab. All rights reserved. import os import numpy as np from .base_dataset import BaseDataset from .builder import DATASETS def has_file_allowed_extension(filename, extensions): """Checks if a file is an allowed extension. Args: filename (string): path to a file Returns: ...