sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
d89003af85e67a835a9a6314484a6ce58f4f7a491874966c8d1340fd63960455 | Python | 23,283 | 551 | from collections import defaultdict
from ilxutils.interlex_sql import IlxSql
import json
import os
import pandas as pd
from pathlib import Path
from rdflib import Graph, RDF, RDFS, OWL, BNode, URIRef, Literal
from sys import exit
from typing import Union, List, Dict, Tuple
from ilxutils.ontopandas import OntoPandas
... |
e620b4f2ddacda998ab3776ab7fa36bf0a3c2fa87e496b337f1e3cd3b88f8a2e | Python | 23,290 | 626 | """Tests for the Orthofinder importer + multi-copy disambiguation.
Covers:
- Orthofinder run-dir discovery (Results_*/, Orthogroups/, missing files).
- Orthogroups.tsv parsing (header, comma+space delimiters, blank cells,
ragged rows).
- partition_single_vs_multi_copy with and without an explicit single-
copy list... |
5a988c8f76c9b1226fc68189cb99464d951e61d366bc51fa4ac4fbc4f9152447 | Python | 23,291 | 726 | # 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... |
9c1ac437652c9dd25ab4eb429c51ca2282a9c8e91569e5ca52e23a256f716ccf | Python | 23,296 | 715 | """Extract reference documentation from the NumPy source tree.
Copyright (C) 2008 Stefan van der Walt <stefan@mentat.za.net>, Pauli Virtanen <pav@iki.fi>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions ... |
fe481bf67b0558a05700d10cd275cdd8b43b9992803bb61b25b481c1fa634ce7 | Python | 23,299 | 626 | # SPDX-License-Identifier: LGPL-3.0-or-later
"""Batch-level composition of independently configured data systems."""
from __future__ import (
annotations,
)
import logging
from copy import (
deepcopy,
)
from typing import (
TYPE_CHECKING,
Any,
)
import numpy as np
from deepmd.dpmodel.utils.training_... |
4d21465a5e7f2a2098e858c314ed8af1d6685b7461305fbc13d918233e014c56 | Python | 23,305 | 739 | """Relation data containers for ParaDime.
The :mod:`paradime.relationdata` module implements container classes for
various formats of relation data. The relation data containers are used by the
different :class:`paradime.relations.Relations` (see :mod:`paradime.relations`)
and :class:`paradime.transforms.RelationTrans... |
2318a74db023fc05424e87f4c929390b6ed38136048fdecf4c3df1f86b83314f | Python | 23,322 | 488 | from keras.models import Sequential, Model
from keras.layers import Embedding, LSTM, Flatten, Dense, BatchNormalization, \
Activation, Dropout, concatenate, Lambda, Reshape, Conv2D, MaxPooling2D, TimeDistributed
from keras.constraints import maxnorm
from keras.optimizers import rmsprop, TFOptimizer, Adam, Adadelta
... |
8dc691d64a75ddb2381a78b5960445e35a2513149d19d7f40122a5f2c3cdb171 | Python | 23,331 | 671 | # copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""Machine type checkers for scitypes.
Exports
-------
check_is_mtype(obj, mtype: str, scitype: str)
checks whether obj is mtype for scitype
returns boolean yes/no and metadata
check_raise(obj, mtype: str, scitype:str)
checks whether ... |
21b6084355b414e7f64932408c251bb42d5eae67493e64155bb277d4483cca6b | Python | 23,337 | 619 | #!/usr/bin/env python3 -u
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""Utilities for performance evaluation of time series classification models."""
__author__ = ["ksharma6", "jgyasu"]
__all__ = ["evaluate"]
import collections.abc
import inspect
import time
import warnings
import numpy ... |
71112d7b07cf69619cedd7410870dac6faca3dac6e5bd03e27039b6ebd724993 | Python | 23,340 | 661 | #-------------------------------------------------------------------------------
# elftools: elf/sections.py
#
# ELF sections
#
# Eli Bendersky (eliben@gmail.com)
# This code is in the public domain
#-------------------------------------------------------------------------------
from __future__ import annotations
impo... |
8d23cfc3f795a847e9dbc09d443fe11893217fb4796bd453b53c8285e46728fc | Python | 23,340 | 543 | # -*- coding: utf-8 -*-
"""
Exploratory code that allows several different conditions to be run on a few example
pairs of noise. Code in the other ***_runSFA files is based on this core code.
"""
import numpy as np
import matplotlib.pyplot as plt
import soundfile as sf
import pyfilterbank.gammatone as g
from sk... |
9c63784fa216401f237dd2e52fc7ef7287c7d6177084d6a6d3f86eaffd080ee3 | Python | 23,341 | 362 | #train and test the phenotype confirmation model - using manually labelled data or data-level fusion of weakly data and manually labelled data
#this program implements:
#(i) train with validation data and test with test data
#(ii) train with validation + weak data and test with test data
#(iii) 10-fold cross vali... |
07cc936c58ae66dae6b0bcdd82547f4040dd5b256537e5c5b99cb76782107390 | Python | 23,350 | 595 | import logging
import re
import sys
from abc import ABC, abstractmethod
from typing import Callable, Optional, Tuple, Any
from segtok.segmenter import split_single
from segtok.tokenizer import split_contractions, word_tokenizer
log = logging.getLogger("flair")
class Tokenizer(ABC):
r"""An abstract class represe... |
e5f6d227fa7c4da0b09216ec08b06a6d59905c865b1ec3f0c2f0891d4b2c2781 | Python | 23,359 | 616 | # copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""Implements adapter for NeuralForecast models."""
import abc
import functools
from copy import deepcopy
from inspect import signature
from typing import Literal
import numpy as np
import pandas
from skbase.utils.dependencies import _check_soft_... |
1aab9e7257ab50df1f23e56c0738463086d37088d658d669de8bfd83e28749cb | Python | 23,396 | 585 | #!/usr/bin/env python
"""
Copyright 2017 Matt Settles
Created June 8, 2017
Process raw data reads generated by 10x,
identify and extract the gem barcode, compare it to a white list
and then strip off the random priming region. Attach all the sequence
data to the end of the read ids
"""
import traceback
import argparse... |
0eea0e70083741b138610b96d50f6b7848b024235668a135f1b8703216c5bf5e | Python | 23,443 | 484 | from __future__ import print_function
from neuron import h
from collections import OrderedDict
from .cell import Cell
from .. import synapses
from ..util import nstomho
from ..util import Params
import numpy as np
from .. import data
import pprint
pp = pprint.PrettyPrinter(indent=4, width=60)
__all__ = ['Bushy', '... |
7a79867d9740c2df31c8b91263a1692ce0ab641a869f7f03288859a481198512 | Python | 23,444 | 614 | """Dummy anomaly detector which fires as learnt in pretrain, by one of 3 strategies."""
import numpy as np
import pandas as pd
from sklearn.utils.validation import check_random_state
from sktime.detection.base import BaseDetector
_STRATEGIES = ("rate", "pattern", "timefreq")
class DummyPretrainedAnomalies(BaseDete... |
34973af5e8cbab211e845865c5e31c324f2cd5803f2f38a7cee07c490058cc7f | Python | 23,446 | 602 | # 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... |
c935360ea33d1e6dce27adfe32aac5c8e183d15536a5e1d76eb5fdaca55a941b | Python | 23,468 | 804 | #!/usr/bin/env python
# Copyright 2018, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list o... |
460c6d0ccaceb45c14ffff285658a5409b1ed46d315c635c7236e03b7fad4705 | Python | 23,498 | 532 | """ This module contains functions to clean a raw dataset of reaction SMILES strings, which includes
operations such as removing atom mapping and checking for invalid molecule SMILES. There is also
a function to generate a list of SMILES strings of all unique molecules in the given dataset.
NOTE: in rxn-ebm, a 'datase... |
fd79089fafa57e6ed98679ead5f6db6599cb89778ca88dc4ae8ec1758522d459 | Python | 23,508 | 583 | #!/usr/bin/env python3
import tempfile
__doc__ = f"""convert graphml files to ttl files
Usage:
graphml-to-ttl [options] <file>
graphml-to-ttl methods [options] <file>
graphml-to-ttl workflow [options] <file>
graphml-to-ttl paper [options] <file>
Options:
-o --output-location=LOC write converted... |
8e8b1ad3dbf9a8296273cfccac93d8a0c05e64bc14d495a2ade30f8ce31a3cea | Python | 23,512 | 683 | """Interface for the momentfm deep learning time series anomaly detector."""
import numpy as np
import pandas as pd
from sktime.detection.base import BaseDetector
from sktime.split import temporal_train_test_split
from sktime.utils.dependencies import _safe_import
accelerate = _safe_import("accelerate")
Dataset = _s... |
1bc08cab29cd42cab9da310ae3ca5e00750dd3393c4d7936c89e78a29088508d | Python | 23,576 | 690 | import warnings
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import pandas as pd
import pytest
import numpy.testing as npt
import pandas.testing as pdt
try:
import statsmodels.regression.linear_model as smlm
_no_statsmodels = False
except ImportError:
_no_statsmodels = True... |
1a1463a11971e25b0693337d379a2f82dee6e4d13effd647bb288585612b7513 | Python | 23,584 | 667 | from __future__ import print_function
from neuron import h
import numpy as np
import scipy
import scipy.integrate
import scipy.stats
import scipy.optimize
try:
import pyqtgraph as pg
HAVE_PG = True
except ImportError:
HAVE_PG = False
from ..util.stim import make_pulse
from ..util import fitting
from ..ut... |
e844f06b0713804fd8757df613adca5602b0ca4bf2938c30243eb5ea7784b68c | Python | 23,611 | 589 | """Checkpoint-loading checks against a real Hugging Face snapshot.
Every test here runs on the sample snapshot written by
``tests/make_tiny_hf_snapshot.py``: an actual ``config.json`` +
``model.safetensors`` pair produced by ``save_pretrained``, which is the layout
both loading paths accept in production --
* ``tab... |
1b8e918309cee93983b55a5aefdc7ae9a4044c463fdada32674b574d5b824166 | Python | 23,663 | 683 | # 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
from deepmd.dpmodel.atomic_model import DPAtomicModel as DPDPAtomicModel
from deepmd.dpmodel.commo... |
5efbfefdfac65de4bf1c4919708f7ae81834942c5b8dff1050cd3fcbb20c4838 | Python | 23,687 | 441 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import logging
import os
import shutil
import time
from socket import gethostname
from termcolor import colored
import dill
import numpy as np
import ray
from mprl.utility_services.payoff_table imp... |
18f2e83dfbd857545c476894380b06983a91f155322e62332ac13815b0673ee6 | Python | 23,706 | 458 | """
@file: trainer_util.py
Created on 27.09.18
@project: crazyara
@author: queensgambit
Definition of the main training loop done in gluon.
"""
import datetime
import logging
import random
from time import time
import mxnet as mx
from mxnet import autograd, gluon, nd
import numpy as np
from mxboard import SummaryWrite... |
b17d8f46be1486830164c1a581062407e680e360ecb798a8f8f212a6e89a4bfc | Python | 23,712 | 628 | # SPDX-License-Identifier: LGPL-3.0-or-later
"""Data-side transforms of Uni-Mol v1 molecular pretraining.
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 ... |
9f7f454ee20a1c808518afe72e4939ac9f60acdfda2d3f9238219f643007f40e | Python | 23,727 | 856 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
fc3b0c5f87a215d9c5e0ba9dc0deefa592d04ca9ada4490b42cf92ff1f636610 | Python | 23,749 | 558 | """
Script to test nonlinearity metrics
"""
from scipy.stats.mstats import mquantiles
import model
import numpy as np
import matplotlib.pyplot as pl
import utilities
import seaborn as sns
import time
from taylorDecomp import d2ca_dr2, complexity_scores, avg_directional_curvature
import matplotlib as mpl
import os
from... |
d721b116a36ff6fdb9a8395e5be44d33fcfc65e1a219f3332dc92e1e03096255 | Python | 23,760 | 413 | #!/usr/bin/env python
import sys
import os
import re
import math
#import commands
#import pandas as pd
from os.path import isfile, join, isdir
from kn_common import pipetools,pipedef
from kn_pipeline_class import CPipeError,CPipeStep
class CPipeStepR2TC(CPipeStep):
def batch_run(self):
if True:
... |
e0f7a61d9e979db95697deb2269eaf3233f426403e8de24023809d3ede0da92e | Python | 23,801 | 667 | # SPDX-License-Identifier: LGPL-3.0-or-later
"""
Radial building blocks for the SeZM descriptor.
This module defines the cutoff envelope, inner-distance clamp, radial basis,
and radial multilayer perceptron used by SeZM.
"""
from __future__ import (
annotations,
)
import math
from typing import (
Any,
)
imp... |
6fdaa8eb552f3448f13771d4307b48384b18b1bdffc5a551fe741129c24e4912 | Python | 23,819 | 757 | # 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... |
d73ddb1f1de4114d580ae7add524b30e0b76cc4fb038445261cfb06803ab25de | Python | 23,832 | 698 | # 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... |
6164a9fe61aee3fedd048bb7bb9fa98d448b157477ac0daf4adafe070b0f1fb4 | Python | 23,836 | 640 | from typing import Union, Optional, List, Dict
import numpy as np
import pandas as pd
import pickle
import time
import importlib.util
import sys
from collections import OrderedDict
from joblib import delayed, Parallel
from sklearn.preprocessing import StandardScaler
import scanpy as sc
from anndata import AnnData
fro... |
bca1cdf0ec481a3afd60158581f7353662e5901d6dbe287af1a641f2828ffbce | Python | 23,859 | 575 | # -*- coding: utf-8 -*-
"""
Created on Sun Dec 31 16:16:39 2017
@author: Tiger
"""
import math
import pylab as mpl
import numpy as np
import time
import matplotlib.pyplot as plt
#from PIL import Image
import random
#from skimage import measure
""" For plotting the output as an interactive scroller"""
class Inde... |
64d9a111ffde566a7fbf69ad409cde3d01028c9fefbbb15bf81f7e8e3a7f208f | Python | 23,876 | 673 | from __future__ import annotations
from collections.abc import Callable
import math
from typing import Any
from typing import Literal
import numpy as np
import pytest
from optuna.distributions import BaseDistribution
from optuna.distributions import CategoricalDistribution
from optuna.distributions import FloatDistr... |
d9d3b32590fd432e3fc466fa64e0027d230dc1a9f2a82b431d55b71ec6302b3f | Python | 23,934 | 507 | import time
import json
import os
import json
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 = os.environ['CL... |
13e4564b0e5a574dbbd350833ba4e8bcd03ef35185fa35c538fe260e64e91cae | Python | 23,962 | 793 | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
from onnx.reference.ops.op_pool_common import (
get_output_shape_auto_pad,... |
1cd2fe1a27c886f333f9c7d9abe030d511b21870e9a437509c9b7b5060319859 | Python | 24,014 | 506 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import logging
import os
import shutil
import time
import dill
import numpy as np
import ray
from mprl.utility_services.payoff_table import PolicySpec
from mprl.utility_services.worker import Learn... |
8e105cf808d7dbd4d0caaf3631e86c5cb045ef2829e3984fe269d019a04524b4 | Python | 24,014 | 649 | """Atlas download manager: preset registry, cache, and consent flow."""
import os
import shutil
import warnings
import zipfile
import urllib.error
import urllib.request
from dataclasses import dataclass
from pathlib import Path
from typing import Dict, List, Optional
from bcblib.tools.damage_profile._atlas import Atl... |
a68c85f52fe50e102d0482bf7a60bcca97b6339133643a191f117b20ee717198 | Python | 24,021 | 566 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from ray.rllib.env.multi_agent_env import MultiAgentEnv
from ray.tune.registry import register_env
from gym.spaces import Discrete, Box, Dict
import copy
import numpy as np
from stratego_env.game.stratego_pro... |
7c1b3cb749c46271b6dc3f6f58f118536f2853ee2c5ce7c26f6cb63713bb3a30 | Python | 24,022 | 528 | """Notations in this Gaussian process implementation
X_train: Observed parameter values with the shape of (len(trials), len(params)).
y_train: Observed objective values with the shape of (len(trials), 1).
x: (Possibly batched) parameter value(s) to evaluate with the shape of (..., len(params)).
cov_fX_fX: Kernel matri... |
63fae2de9025c48e70be16e5c5e78e3dd762aeded5ce4cabb066e5bf0f6293bd | Python | 24,023 | 443 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import logging
import os
import shutil
import time
from socket import gethostname
from termcolor import colored
import dill
import numpy as np
import ray
from mprl.utility_services.payoff_table imp... |
0c59b408d830fa9eec75b1d35fdd42390ad556f58faa9fcfc0882e59491c9149 | Python | 24,068 | 664 | # 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... |
a09875077aa7dc3b540044f7ee6326fa66ecc059db13a73845d83fa42d6fdf35 | Python | 24,087 | 504 | # Copyright 2019-2021 The AmpliGraph Authors. All Rights Reserved.
#
# This file is Licensed under the Apache License, Version 2.0.
# A copy of the Licence is available in LICENCE, or at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
import numpy as np
#import tensorflow as tf
import tensorflow.compat.v1 as tf
i... |
988485f79624cd42ceed9335d284df4cdcdf7b3d583e052fcbed2dd6bccf0267 | Python | 24,137 | 534 | __author__ = 'tsungyi'
import numpy as np
import datetime
import time
from collections import defaultdict
from . import mask as maskUtils
import copy
class COCOeval:
# Interface for evaluating detection on the Microsoft COCO dataset.
#
# The usage for CocoEval is as follows:
# cocoGt=..., cocoDt=... ... |
8f2ced169823a4fcc1eb0de391158ffcbe99b2cddc11e9c04b6c7bb2073a4577 | Python | 24,189 | 704 | """
Test principal cell responses to tone pips of varying frequency and intensity.
This is an example of model construction from a very high level--we specify
only which populations of cells are present and which ones should be connected.
The population and cell classes take care of all the details of generating the
n... |
1fa34e2b054ccc8ec480ba9f3f259ac8b6a307cc4105b3d55ecb3a6e51c6cb2b | Python | 24,210 | 544 | #!/usr/bin/env python
############################################################################
# Copyright (c) 2015-2019 Saint Petersburg State University
# Copyright (c) 2011-2015 Saint Petersburg Academic University
# All Rights Reserved
# See file LICENSE for details.
###########################################... |
3a9ec3b7fec3178f6bfe988170f4bc510e1fe0724a3845d13eff3849c3499d5b | Python | 24,212 | 914 | from __future__ import annotations
from itertools import combinations
from math import ceil
from pathlib import Path
from typing import Optional, Union, List
import matplotlib as mpl
import matplotlib.pyplot as plt
import pandas as pd
from PIL import Image
from scipy.special import comb
from .STDataset import STData... |
796a45cd28f25fa90f3dad86bb392a30adecae259ec55b7626411148da0eb2f7 | Python | 24,229 | 669 | """
Core Data Types Module for pciSeq
This module defines the fundamental data structures used throughout pciSeq for:
- Cell data management (Cells class)
- Gene expression handling (Genes class)
- Spot detection processing (Spots class)
- Single-cell RNA sequencing data (SingleCell class)
- Cell type classification (... |
853ba1f9581c14214332c51a2869884d3815401f943dd999a27b81ef165f2046 | Python | 24,233 | 634 | import pytest
import numpy as np
from ._lddmm_utilities import _validate_scalar_to_multi
from ._lddmm_utilities import _validate_ndarray
from ._lddmm_utilities import _validate_resolution
from ._lddmm_utilities import _compute_axes
from ._lddmm_utilities import _compute_coords
from ._lddmm_utilities import _multiply_... |
e92f32271deef51d1083b8bc37f47f834987e2f9daf238cd5bc6c6aede5c25ec | Python | 24,268 | 456 | """Reproducible first-round benchmarking of published, isoform-adapted networks."""
from __future__ import annotations
import argparse
import ast
import contextlib
import hashlib
import json
import math
import platform
import subprocess
import sys
import time
from pathlib import Path
import numpy as np
import torch
... |
5ea8f7bee6792729b242a697b7052a2745afd54e5b616c862aa0dd4cc10e98a2 | Python | 24,269 | 698 | #!/usr/bin/env python
"""REST Translation server."""
from __future__ import print_function
import codecs
import sys
import os
import time
import json
import threading
import re
import traceback
import importlib
import torch
import onmt.opts
from onmt.utils.logging import init_logger
from onmt.utils.misc import set_ran... |
d5008a6171a4160dfc01962b1a66cfa986205a58a107ac0ec3011da1ec8c2446 | Python | 24,273 | 588 | """Classes and helper functions for a main function \
'combined_slb_quantized_gw' which first computes the pairwise \
SLB for all cells, then computes a \
fraction of the pairwise qGW values \
until an acceptable threshold of accuracy is met."""
import csv
import itertools as it
from multiprocessing import Pool
from t... |
d7ba24a2dfeb0af6db36a06974ea04db425fcc87e93da0ed31619689d2f89927 | Python | 24,292 | 620 | #!/usr/bin/env python3
'''
Functions for creating and manipulating domain maps, created from maximum projections of independent components detected from mesoscale calcium imaging videos.
Authors: Sydney C. Weiser
Date: 2019-06-16
'''
import numpy as np
import os
import scipy.ndimage
import cv2
from seas.hdf5manager ... |
c657830b6743481e4d872d58e06ea7f151d378a4a0795222849f03268b328a21 | Python | 24,302 | 651 | """ SRU Implementation """
# flake8: noqa
import subprocess
import platform
import os
import re
import configargparse
import torch
import torch.nn as nn
from torch.autograd import Function
from collections import namedtuple
# For command-line option parsing
class CheckSRU(configargparse.Action):
def __init__(sel... |
d3206183a2222ded6ed4893206f284f44dadeb89c1c992fb36dc797db7325da9 | Python | 24,317 | 742 | """Plotting functions for visualizing distributions."""
from __future__ import division
import numpy as np
from scipy import stats
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.transforms as tx
from matplotlib.collections import LineCollection
import warnings
from distut... |
c17edcc76e522e65b8aa25808c967c695415745eae33d9089a941f75e08518f8 | Python | 24,338 | 754 | # 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... |
45abd98dab8c8be8f14627294bcb69ba865a076e4a58db318ae064bfc5dffc79 | Python | 24,355 | 647 | """TEASER early classifier.
An early classifier using a one class SVM's to determine decision safety with a time
series classifier.
"""
__author__ = ["MatthewMiddlehurst", "patrickzib"]
__all__ = ["TEASER"]
import copy
import numpy as np
from joblib import Parallel, delayed
from sklearn.ensemble import RandomForest... |
7eefca43279ee4232e79b6a3b52953cbfe2be75f3bee5f6556ae270e14868483 | Python | 24,357 | 751 | """Relation transforms for ParaDime.
The :mod:`paradime.tranforms` module defines various classes used to transform
relations between data points.
"""
import functools
from typing import Callable, Union, Optional, Any
import numba
import numpy as np
import torch
import scipy.optimize
import scipy.sparse
from paradi... |
59be2e5e2680cf47c16343ff415dcc344e0e85fb3fce66979bb85975065d5781 | Python | 24,366 | 627 | # energyflow needs to be imported before pytorch
# because of https://github.com/pkomiske/EnergyFlow/issues/24
from energyflow.emd import emds
import logging
import warnings
from typing import Union, Tuple
import numpy as np
import torch
from torch import Tensor
from torch.utils.data import DataLoader
from jetnet.da... |
b49eba2b498ca61e6a891f83d5afcfcf0927d77e4387d5017d8f0ba6f4f71ade | Python | 24,407 | 707 | # Copyright 2019-2021 The AmpliGraph Authors. All Rights Reserved.
#
# This file is Licensed under the Apache License, Version 2.0.
# A copy of the Licence is available in LICENCE, or at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#import tensorflow as tf
import tensorflow.compat.v1 as tf
import abc
import lo... |
a870453d2448ef6bc96697a20f623143a662b9780407a27bfd5a03a8ab8830e6 | Python | 24,417 | 697 | """
agent.py
Allen Institute for Brain Science
created on 20 Oct 2016
author: derricw
ZRO device for controlling behavior scripts.
This is essentially a rewrite of the stim_device.py used for CAM.
##TODO: Raises runtime errors because I can't decide on what type the errors
actually should be. Don't want cust... |
e1f64904d6f106e65131f3e4cc025572cc4ae4f9460fba3d70ecac49b2742ae2 | Python | 24,429 | 647 | # Copyright (c) OpenMMLab. All rights reserved.
import math
import warnings
import torch
import torch.nn as nn
import numpy as np
import torch.nn.functional as F
from collections import OrderedDict
from mmcv.cnn import (build_norm_layer, constant_init, kaiming_init,
normal_init, trunc_normal_init... |
c73c52a51005f20e09a89d692f85bb58a5a21a35a069c3f3a10bad30c353b79f | Python | 24,490 | 450 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import logging
import os
import shutil
import time
from socket import gethostname
from termcolor import colored
import dill
import numpy as np
import ray
from mprl.utility_services.payoff_table imp... |
8556740fa414db6ec2d196a533f36c3f1a0da2b33a05d1f7526293cfd1ad20e2 | Python | 24,497 | 623 | import numpy as np
from scipy.stats import pearsonr
from .helper import *
import warnings
def lag_gen(data, time_lags):
'''lag_gen returns the matrix containing the lagged time series of data for
a range of time lags given by the list or numpy array lags. If the data is
multivariate, lag_gen concatenates ... |
7ed1a392adefe6b0c55806004d088473914e5e12f04b62a0230a5366263900fb | Python | 24,561 | 610 | # -*- coding: utf-8 -*-
"""
#------------------------------------------------------------------------------------------------------------------------
# Cross-trained CARE (XTC) based synapse tracking pipeline
#--------------------------------------------------------------------------------------------------------------... |
9b5b89f48b9b1e29b6b6a13d5fa27b0c3f10de37c26e9f981fea6f12410508f2 | Python | 24,579 | 625 | """
@file: rise_builder_util.py
Created on 26.09.18
@project: crazy_ara_refactor
@author: queensgambit
Utility methods for building the Rise NN
"""
import mxnet
from mxnet.gluon.nn import HybridSequential, Conv2D, BatchNorm, Dense, AvgPool2D, MaxPool2D
from mxnet.gluon import HybridBlock
try:
from mxnet.gluon.cont... |
d3072864df98253e3b6d28c81f5da23f5c69e109d0f3986c4da3ab86b8ac9d2f | Python | 24,603 | 670 | from __future__ import print_function
#!/usr/bin/python
#
# utilities for NEURON, in Python
# Module neuron for cnmodel
import numpy as np
import numpy.ma as ma # masked array
import re, sys, gc, collections
import neuron
_mechtype_cache = None
def all_mechanism_types():
"""Return a dictionary of all available ... |
53809fcced86ef1b4ab06c6d1e3521739cf26e5077a7b9e517d57b5201bad3d0 | Python | 24,618 | 777 | # 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... |
d1909271a23a04eaec5130bd5c2329650ca70892f6f67e7252d34f8de08d5ff8 | Python | 24,678 | 634 | # SPDX-License-Identifier: LGPL-3.0-or-later
"""Common utilities for the pt_expt backend.
This module provides the core infrastructure for automatically wrapping dpmodel
classes (array_api_compat-based) as PyTorch modules. The key insight is to
detect attributes by their **value type** rather than by hard-coded names:... |
39621b58e2a3e1ce55b0dab9ec180482ccf5bdc55bec7dd12ee28faa6797f3fc | Python | 24,707 | 514 | # -*- coding: utf-8 -*-
import sys
from functools import wraps
import threading
from os import listdir
import platform
import numpy as np
from PyQt5 import QtWidgets, QtCore, QtGui
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QMainWindow, QLineEdit, QLabel, QSlider, QComboBox
from parameterSetup import Param... |
2107cb89bf976c4a679fe290c421b8f7b4fe9be905306e823559351a03fffa5a | Python | 24,709 | 567 | #!/usr/bin/env python3
from pyontutils.config import auth
import sys
import csv
import json
import pickle
import socket
from pathlib import Path
from itertools import chain
from collections import Counter, defaultdict
from rdflib import Graph, URIRef, Namespace, Literal
from sqlalchemy import create_engine, inspect
fr... |
6992d188f9ef291e6fde929083229fa7baa94b5c7e8cbfd8996ae4389023e9c7 | Python | 24,732 | 638 | # SPDX-License-Identifier: LGPL-3.0-or-later
"""Uni-Mol v1 transformer encoder, ported to the array-API dpmodel layer.
The maths follows Uni-Mol (https://github.com/deepmodeling/Uni-Mol) at commit
90f52c4 and the Uni-Core modules it builds on
(https://github.com/dptech-corp/Uni-Core) at commit ace6fae, both MIT licens... |
9d7e272f56c65fb13d51686ed39f48ad7c0c6e2570abd6cc359f47536a09815d | Python | 24,740 | 865 | """ Turn compiler.ast structures back into executable python code.
The unparse method takes a compiler.ast tree and transforms it back into
valid python code. It is incomplete and currently only works for
import statements, function calls, function definitions, assignments, and
basic expressions.
... |
ef3258eda5b73a656bee25b7324dee5dd073db5621931767779b912f83e8da26 | Python | 24,787 | 581 | # SPDX-License-Identifier: LGPL-3.0-or-later
"""Autograd assembly: graph energy -> force/virial/atom_virial via grad(E, edge_vec).
torch-only. The pure-array scatters (edge_force_virial, pair_force_virial) are
shared with dpmodel; this module supplies the single backward pass that
produces the gradient of the energy w... |
f0f38860aa06c0f1ca5a008f5a655ffb9a438b7b5e5f358512f9ca194ac42eba | Python | 24,820 | 607 | # copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""Implements ARDL Model as interface to statsmodels."""
import warnings
import pandas as pd
from skbase.utils.dependencies import _check_soft_dependencies
from sktime.forecasting.base._base import BaseForecaster
from sktime.forecasting.base.ada... |
355feb5b3e577dd423edeb439c01f5d278732cbfc997da27cc11dbde3996cc7c | Python | 24,885 | 566 | import numpy as np
import pandas as pd
import argparse
import os
import re
import random
import textdistance
import multiprocessing
from rdkit import Chem
from tqdm import tqdm
from rdkit import RDLogger
RDLogger.DisableLog('rdApp.*')
def smi_tokenizer(smi):
pattern = "(\[[^\]]+]|Br?|Cl?|N|O|S|P|F|I|b|c|n|o|s|... |
e56321aaacd5962ecd22c09b2015864401f5d94e450747fa0ae0bb42c4d3b79b | Python | 24,889 | 707 | import logging
from sklearn import metrics
from typing import Dict, List, Tuple, Union
from matplotlib import pyplot as plt
from torch.utils.data import Dataset, DataLoader
from .utils import arcsinh
from pathlib import Path
from scipy import optimize
import torch
import energyflow
import numpy as np
from tqdm import ... |
e3f12582146fb5d2edc962d23d068bc0a177b848058aac945a1394bb9f8a4505 | Python | 24,925 | 613 | #!/usr/bin/env python
"""
Copyright 2018 Matt Settles
Created March 31, 2018
Filter processed raw data reads generated by 10x,
Filter for status
"""
import traceback
import argparse
import sys
import os
import time
import glob
import errno
from subprocess import Popen, PIPE, STDOUT
def sp_gzip_read(file, bufsize=-1)... |
f30f35623727b2a321861eb282d10b3656eb106a0409459192a3574855372cce | Python | 24,925 | 724 | # -*- coding: utf-8 -*-
"""
Created on Thu December 10 11:41:02 2022
@author: Pawan Panwar, Quanpeng Yang, Ashlie Martini
PyL3dMD: Python LAMMPS 3D Molecular Dynamics/Descriptors
Copyright (C) 2022 Pawan Panwar, Quanpeng Yang, Ashlie Martini
This file is part of PyL3dMD.
PyL3dMD is free software: you ... |
c684be3d3afe8bb0f2245f5e6610ef7a4d1c5d367afb940450c96d69fbe568aa | Python | 24,931 | 223 | """
Vector strength for models with SAM tones, different input configurations.
9 Dec 2020 version.
Results are printout from DataTablesVCN after selecting the data runs.
NOTE: This table is automatically written by figures. py and should not be
directly edited. pbm
"""
data = """Cell,Configuration... |
22135fc41f5c71fc906713335a95d2a69fb6a11da38333a45fc4175d85139ac9 | Python | 24,937 | 708 | import logging
from sklearn import metrics
from typing import Dict, List, Tuple, Union
from matplotlib import pyplot as plt
from torch.utils.data import Dataset, DataLoader
from .utils import arcsinh
from pathlib import Path
from scipy import optimize
import torch
import energyflow
import numpy as np
from tqdm import ... |
f291bb6ade95b566ffba345e237f6a4c1ef4bd616001f0a64db5a60e64c99ad5 | Python | 24,946 | 698 | """Statistical transformations for visualization.
This module is currently private, but is being written to eventually form part
of the public API.
The classes should behave roughly in the style of scikit-learn.
- All data-independent parameters should be passed to the class constructor.
- Each class should implemen... |
db1026faacf55eda2ec9100d1e5c822478cca8dc6d91f0df77a1ba4ab96f0ef0 | Python | 24,974 | 766 | # 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 abc
import logging
import six
import tensorflow as tf
from tensorflow.p... |
c7a8c7a3a5144e418637723accf1bd543235e06f8d7234845a3a7e1b09d6eaff | Python | 24,975 | 707 | import logging
from sklearn import metrics
from typing import Dict, List, Tuple, Union
from matplotlib import pyplot as plt
from torch.utils.data import Dataset, DataLoader
from .utils import arcsinh
from pathlib import Path
from scipy import optimize
import torch
import energyflow
import numpy as np
EPS_DEFAULT = 1e... |
a02033bfa3fe5bbbff3afa45c246e5781c145ca647aaf6837b268ce6d4751a89 | Python | 24,976 | 708 | import logging
from sklearn import metrics
from typing import Dict, List, Tuple, Union
from matplotlib import pyplot as plt
from torch.utils.data import Dataset, DataLoader
from .utils import arcsinh
from pathlib import Path
from scipy import optimize
import torch
import energyflow
import numpy as np
EPS_DEFAULT = 1e... |
9cf024b2c94bcfb06b7f43e01cde4637340a9610e6b5fd7b7dbfbe882b7d0a96 | Python | 25,015 | 608 | #!/usr/bin/env python
import sys
import os
import math
import re
from os.path import isfile, join, isdir
import pickle
import time
import numpy as np
import scipy
import scipy.ndimage
import scipy.misc
from kn_common import pipetools,pipedef
from kn_pipeline_class import CPipeError,CPipeStep
from PIL import Image, Ima... |
93b82141e23ed512222bd28af4ee3a30abb9bb81fbb1e896d61fa17c61e08b4d | Python | 25,017 | 648 | from typing import Dict, List, Tuple, Union
import torch
import numpy as np
import logging
from lgn.cg_lib import CGModule, ZonalFunctionsRel, ZonalFunctions
from lgn.cg_lib.cg_dict import CGDict
from lgn.cg_lib.zonal_functions import normsq4, rep_to_p, repdot
from lgn.g_lib import GTau, GVec
from lgn.models.lgn_cg i... |
7c58045cbab1866e5737c90403bc09dfc61c8b26640a22406eb0da0d73d53521 | Python | 25,055 | 707 | import pytest
from itertools import product
import numpy as np
from scipy.linalg import inv
from scipy.ndimage import rotate
from . import _lddmm_utilities
from ._lddmm import generate_position_field
from ._lddmm import _transform_image
from ._lddmm import lddmm_transform_image
from ._lddmm import lddmm_register
fro... |
e5bfbd52425b6d85745c6939bf0e2956f6e364e90bc0a1d91a563abaa6a17d72 | Python | 25,122 | 818 | import sys
from typing import Any
import pytest
import torch
from torch import nn
from torch.nn.utils import prune
from torch.nn.utils.rnn import pack_padded_sequence
from tests.conftest import verify_output_str
from tests.fixtures.models import (
AutoEncoder,
CategoricalOutputModel,
CNNModuleList,
Co... |
2f5fde750a70929b127f866002fee6f0ba6ec234dc9e81571e7b451a02526f4e | Python | 25,131 | 500 | import csv
import sys
import logging
import time
import traceback
import argparse
import os
import numpy as np
import rdkit
import random
import torch
import torch.nn as nn
import torch.optim as optim
import pandas as pd
from rdchiral.main import rdchiralReaction, rdchiralReactants, rdchiralRun
from torch.utils.data i... |
095ce4bbfe5e28ba5a0bf8941b3bcab542100687aabf0e9372372112b3ae7964 | Python | 25,138 | 612 | import argparse
import json
import matplotlib.lines as lines
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
from string import ascii_uppercase
class DrugScreenExcelReader:
"""
A class with utilities for plotting drug screen predictions.
... |
18096156302743aaf662cfe98de7edde2a697906da79b8ef7749fa7df97eef63 | Python | 25,140 | 672 | """DrCIF classifier.
interval based DrCIF classifier extracting catch22 features from random intervals on
periodogram and differences representations as well as the base series.
"""
__author__ = ["MatthewMiddlehurst"]
__all__ = ["DrCIF"]
import math
import time
import numpy as np
from sklearn.base import BaseEstima... |
3edccb02b1aafa539dc628ed6db3bd99813516059bc19c05d38da4bacc1710d0 | Python | 25,140 | 764 | import numpy as np
def piecewise(condition, case1, case2):
if condition:
return case1
else:
return case2
def initStates(rat, hz):
sizeStates = 18
states = np.zeros((sizeStates,), dtype=float)
if rat == "sham":
if hz == 1:
states[0] = -85.1221681609219
... |
74df8d335e6c755d7f1126a9b90e2cf1571f1118a4ab4897340c935e6e6f029b | Python | 25,148 | 664 | # copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""Implements adapter for StatsForecast models."""
from inspect import signature
from warnings import warn
import pandas
from sktime.forecasting.base import BaseForecaster, ForecastingHorizon
from sktime.utils.adapters.forward import _clone_fitt... |
2ffdab8240ef47cbd24dc035edc7050ab594c5a008dd450ff76b6b2cf2384970 | Python | 25,174 | 491 | """
@file: trainer_util.py
Created on 27.09.18
@project: crazyara
@author: queensgambit
Definition of the main training loop done in gluon.
"""
import datetime
import logging
import random
from time import time
import mxnet as mx
from mxnet import autograd, gluon, nd
import numpy as np
try:
from mxboard import Sum... |
60069993b1e39220646a5467ab5eddc6ea1cd2520d6372b50647cd0604b826b8 | Python | 25,244 | 509 | 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 = ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.