sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
0d94b91c7446b691eca3c739d04d6ad6942b7379d3e3b13d56467d9eb98b7e93
Python
18,825
504
# 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...
e2ffd15702381a3fb4d2512d04c7c9d0916304a1d9a4375967456da7dc86cd67
Python
18,831
521
# 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...
8f5e58ac444769e11dd7c0a7e328896de95287cd6b05392ebc35bf5bafbeed7d
Python
18,836
507
"""Tests for source/rbh_tools.py. Covers the hex-color validator, the .rbh file parser (with dtype enforcement), combine_rbh_db (db-mode merge), rbh_to_scafnum, and guards/error paths in rbhdf_to_alglocdf. """ from __future__ import annotations from pathlib import Path from textwrap import dedent import pandas as pd...
01bdd4a4adf0b94966f5d599fe25901dd86638231b24d0cce993a16847e39859
Python
18,848
504
# 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...
0daaf82e92d522ad496660505275893a1eef8e5e8f54fc0d5f7fd552e192b383
Python
18,848
459
#!/usr/bin/env python """test module of `cma` package. Usage:: python -m cma.test -h # print this docstring python -m cma.test # doctest all (listed) files python -m cma.test list # list files to be doctested python -m cma.test interfaces.py [file2 [file3 [...]]] # doctest only these or pos...
d46e28196519b7b53332781d58d52ab8efcc187c1e7055c846802bbcca4fb532
Python
18,866
438
""" Interlex add Triple for examples. Will have the same post triple commands for real ILX. Notes: 1. In beta some old and all new ILX IDs are TMP: prefix instead 2. To install go into the 1st ilxutils directory and run pip3 setup.py install 3. cli.log will be created in your current directory (info an...
662ac7b78ef1bb4c0cc224e3542a677ca06c0806076b0212ac9129bb171261d6
Python
18,886
444
#!/usr/bin/env python """Patch sample generation. For each (cell line, chromosome) named by a split spec, produce patch samples with binary boundary labels under three references: 1. filtered_ontad (OnTAD level==1 AND TADscore>=2) 2. unfiltered_ontad (OnTAD level>=1) 3. intersection (unfiltered_ontad...
78330e3455a67885d2e3bd4e2a0d66efc44a822ddf4abd0c0c48c66a862072ea
Python
18,887
515
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: population_server.proto from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as...
d3623578b9a707200b72bb9041a19067c8b14a70a1579d017adf0e12e1d5c292
Python
18,895
516
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Implements compositor for different forecast by fh index.""" from sktime.forecasting.base import BaseForecaster __author__ = ["fkiraly"] __all__ = ["FhPlexForecaster"] import pandas as pd from sktime.datatypes._utilities import get_slice PA...
7dbded8dac1837acb44e4c1d927324db880949a33340d9619e12b436cc6cdc18
Python
18,909
502
"""ContractableBOSS classifier. Dictionary based cBOSS classifier based on SFA transform. Improves the ensemble structure of the original BOSS algorithm. """ __author__ = ["MatthewMiddlehurst", "BINAYKUMAR943"] __all__ = ["ContractableBOSS", "pairwise_distances"] import math import time import numpy as np from skl...
80af51ba3f61d6702f64119b1fbcbf8b6aefc9f53550f159727de7016794ad04
Python
18,919
431
# 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...
a617bf456e99dfe607a0e831b52c38e2ee4c6d0634d21ccf6cd8fce4c5ddf84e
Python
18,922
450
import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib import seaborn as sns from prepare_datasets_HCSC import load_data_HCSC from prepare_datasets_ADNI import load_data_ADNI, process_descriptive_variables def label_A(row, var, thres): if row[var] < thres: return 'A+' ...
0abd5cb61cad5d2a0e124596b781bbcaebce3dd362fc779d88115aa40e7827b7
Python
18,960
489
#!/usr/bin/env python # import ## batteries import sys,os import copy import argparse import logging import itertools import statistics from math import log from random import shuffle from functools import partial from collections import deque, defaultdict from multiprocessing import Pool ## 3rd party import pysam # l...
4a234fc502c6e622f044747312d6a696652545f527e766c98bedf5aa4ca77f41
Python
18,976
445
__author__ = 'tylin' __version__ = '2.0' # Interface for accessing the Microsoft COCO dataset. # Microsoft COCO is a large image dataset designed for object detection, # segmentation, and caption generation. pycocotools is a Python API that # assists in loading, parsing and visualizing the annotations in COCO. # Pleas...
9d681e1012abd14d79d7e8a44be4d5ae489278334d5686f14b3b29ce2d3af051
Python
19,027
657
# 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...
8ea64ce19f789d9775a6fd69a58eed727f0a371fb5dfac668dc42a436612ba4a
Python
19,037
682
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) # Ported from skchange (BSD-3-Clause), original authors: Tveten, johannvk """Utility and validation functions for the detection module.""" __author__ = ["Tveten", "johannvk"] import numbers import numpy as np import pandas as pd from numpy.typin...
f817ee1ddfd3529fae060c25d20ce91b6f0617c0e64d516b6ba986f444480a27
Python
19,045
548
# 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...
1f213061981f3f96acd814072982906a5fd618b564338dfdc4f3ec1b3530d38b
Python
19,061
641
# -*- coding: utf-8 -*- """ Created on Sun Mar 21 13:29:40 2021 @author: TF """ import os import cv2 import keras '''from keras.applications.resnet50 import ResNet50 from keras.preprocessing import image from keras import models, optimizers from keras.preprocessing.image import ImageDataGenerator from ker...
0652c0d14334f32ac774ea0f8b4b5a8be8f9ad34008ec053ccc94faf5c8952d9
Python
19,076
546
import os import numpy as np import matplotlib.pyplot as plt import utils.allen_functions as allen #from tensorflow.keras.models import load_model #from tensorflow.saved_model import load from time import time #import atlas_generator as allen from colormap import rgb2hex, hex2rgb from allensdk.core.reference_space_cach...
1f2082e6bd4cab3d6d77ca9abc30aa539581e332fa27cc90c2fdc59e142c3524
Python
19,081
610
# -*- coding: utf-8 -*- """This module implements a fractional octave filter bank. The band passes are realized with butterworth second order sections described by [Stearns2002]_. For the second order section filter routines the module :mod:`sosfiltering` is used. With the class :class:`FractionalOctaveFilterbank` you ...
f620fff1c3116563acb2efde04c1f9456fa6265afbe623c502b3621bf8345004
Python
19,086
566
import abc import numpy as np import pandas as pd from sktime.forecasting.base import BaseForecaster from sktime.utils.dependencies import _safe_import torch = _safe_import("torch") Dataset = _safe_import("torch.utils.data.Dataset") def _get_series_from_panel(y): """Extract individual time series from panel/hi...
76b591835e39332cea609fbe7151a682002c94555cdf9ce332b04d656085be58
Python
19,091
413
"""AxialTAD — model factories. 5 architectures, single factory `build(arch, patch_size, **kwargs)`: - 'ACM' — Axial Contrast Module model (param: D ∈ {1, 2}). 'ACF' is accepted as a deprecated alias. - 'deepTAD' — deepTAD repo Cell 3 verbatim, parameterised by patch_size - '...
80d7d2b743342f5112127e93c2f6d7cb85b38929e7a5d736be8dabf5cada6c93
Python
19,092
537
import torch import torch.nn.functional as F import torch.utils.checkpoint as cp from mmcv.cnn import build_activation_layer, build_conv_layer, build_norm_layer from mmcv.runner import BaseModule, Sequential from mmcv.utils.parrots_wrapper import _BatchNorm from ..builder import BACKBONES from ..utils.se_layer import ...
5ef5bbe8e15b6a2788287a061f5616341c43bf416f6aec77518d801a1518ab68
Python
19,103
500
# 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...
df2232bc1c18d1274070b1ab402f8ac921ddc0e9a83f5df75ae8417f8b821845
Python
19,107
527
"""Testing machine type checkers for scitypes.""" __author__ = ["fkiraly"] from copy import deepcopy import numpy as np import pandas import pytest from sktime.datatypes._check import ( AMBIGUOUS_MTYPES, check_is_mtype, check_is_scitype, check_raise, generate_check_dict, ) from sktime.datatypes....
320666f4ebbe58576e0c9c10801f2aafe24e53a964cc084e4857cc2cb1540c68
Python
19,114
566
# 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...
ce7e2e81f1f9a42922a74bd0c4fea193f3a8289a26bb2c23b1821f921732a330
Python
19,119
551
# 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...
975bbd554e8a6db4419f020b58f9b01787dde03cb2f8d6cc047a6565ccb2e257
Python
19,122
416
#!/usr/bin/env python """ This code handles the coloring of the orthlogs in a rbh file. There are a few ways to do this. The first way is to just color the proteins based on their protein IDs. If the protein ID matches the protein ID of the model, then just give the the color specified in the model. This requires det...
86dbe619fd037f24056a3d6da8e0ff80bc185519fd2c53e82035ec336b7ed7c5
Python
19,139
381
#!/usr/bin/env python3 """ Prompt tuning on a pretrained PatchTST-FM time-series foundation model. The backbone is frozen; only the prompt module is trained. Training data comes from the *training* portion of the GIFT-Eval datasets (see ``tabby.posttraining.data`` for the time-based train/validation split), and the ob...
2b258278fabf1cb2b42fc5f7907fd2ed81f712fa272779a79a791eeb25e6deb8
Python
19,143
509
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Mantis foundation-model time series classifier.""" __author__ = ["vedantag17"] __all__ = ["MantisClassifier"] import numpy as np from skbase.utils.dependencies import _check_soft_dependencies from sktime.classification.base import BaseClassif...
617931e36d7fa966d17d617a89f1316284b4b1b9dc8c57ba2747f5c33a935fbe
Python
19,191
500
import pickle as pkl import os import numpy as np import itertools import time from camstim import Stimulus from cred_assign_stims import CredAssignStims """ Functions to initialize parameters for Gabors or Squares, and present and record stimuli. Parameters are set here. """ GABOR_PARAMS = { ### PA...
0a3ffcb0be72c05fc8b45df6fa373b626338179296b478e5f0ad9a06b0f6ab65
Python
19,195
589
import sys import argparse import numpy as np import timeit import pyqtgraph as pg import pyqtgraph.multiprocess as mp # import dask # import dask.delayed from neuron import h from cnmodel.protocols import Protocol from cnmodel import cells from cnmodel.util import sound from cnmodel.util import custom_init import cn...
da093e743eef1a23e15e36dd6899d4f102254df7ba48caf0c67ade1526396283
Python
19,205
379
from __future__ import division import sys import pandas as pd import numpy as np import seaborn as sns import pylab as plt from scipy.stats import mannwhitneyu from scipy import ndimage import mkl from SPHARM.lib import classification from SPHARM.lib.confusion_matrix_pretty_print import plot_confusion_matrix_from_da...
27002e08f96c5f297aa5592e491e573dad30076a19e266fc642e0cdc96c6793a
Python
19,226
651
"""Small plotting-related utility functions.""" from __future__ import print_function, division import colorsys import os import numpy as np from scipy import stats import pandas as pd import matplotlib as mpl import matplotlib.colors as mplcol import matplotlib.pyplot as plt from .external.six.moves.urllib.request i...
5a2eec0416f428a998f4d4a48fc34061b4123421a2281222a901d399ba4bc437
Python
19,226
572
from typing import Tuple, Optional, Dict, Any, Union import logging import os import pickle import sys import tempfile import redis from pathlib import Path import shutil from urllib.parse import urlparse from urllib.request import urlopen import numpy as np import pandas as pd from tqdm import tqdm from pciSeq.src.d...
7493732b66a6312823e7a0b48249aba48de4b31f236c4e248c50e7f8f699aa39
Python
19,226
520
# -*- 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 ...
da41d6836bdcde21e6af1112b60fb391ab6fc852bc49885e08e42ebe74d991ae
Python
19,232
449
# SAFE TEAM # # # distributed under license: CC BY-NC-SA 4.0 (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.txt) # # from binary_similarity.s2v_network_arith_mean import NetworkLSTM as ArithMeanNetwork from binary_similarity.s2v_network_rnn import NetworkLSTM as RnnNetwork from binary_similarity.s2v_netw...
69f5ecc0f665796c14772e4381b549705b0e3ed1339ad09140caccdcc424545b
Python
19,233
577
# 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...
103820dbb7507100042961c82b13674716c9303d59f35fe168b6805e28ad6fb5
Python
19,283
386
# Standard from os.path import isfile, isdir, join from time import time import shutil import pickle import numpy as np # Inherited class from .BaseModel import Base # Random seeds from os import environ from random import seed as rseed import tensorflow as tf # Plotting import matplotlib.pyplot as p...
7174df0717e3c64a506463180582fcbdfea1b386a2cb327a7220f2e1874d89f6
Python
19,305
393
import json import logging import os import threading import time from collections import OrderedDict from concurrent import futures from queue import PriorityQueue, Empty, Queue from socket import gethostname from threading import Lock, RLock from termcolor import colored import grpc from mprl.utility_services.cloud_...
7bd8b18931af48b1564229517d3594892ce11cd7a500cbbb610be7db07bc10fd
Python
19,306
484
"""Generic ortholog-table importers and friends. Provides paths into odp's `.rbh`-based pipeline that don't require the user to run the full diamond / blastp reciprocal-best-hits step. Two input shapes are supported: * **Orthofinder output.** Either the raw `Orthogroups.tsv` filtered to single-copy orthologs, or an...
97f4b21fa6982e1010b064858d960f42d30febce0d46ae7c6ee3a8c882567c02
Python
19,309
456
#!/usr/bin/env python3 ''' Functions for machine learning to classify ICA domains Authors: Brian R. Mullen and Desi Ascencio Date: 2019-04-06 ''' import os import re import sys # import wholeBrain as wb import numpy as np import pandas as pd sys.path.append('/home/feldheimlab/Documents/pySEAS/') # data visualizati...
064195c2e9fd850356c2cf20bcbe84c6cbf877ff1e68f5cee8e0c2b7311de23e
Python
19,321
441
import numpy as np import sys from ray.rllib.env.base_env import BaseEnv from mprl.rl.envs.stratego.stratego_multiagent_env import StrategoMultiAgentEnv # Need raw numba functions from stratego_env.game.stratego_procedural_impl import _get_game_result_is_invalid # Numba Methods from mprl.rl.envs.stratego.stratego_pa...
f42c7da26260191e7a8652bf863c1f2d24d7e9113ebdf81e15685cb89b8df1f9
Python
19,346
473
""" @file: Rise.py Created on 26.09.18 @project: crazy_ara_refactor @author: queensgambit Description of the RISE architecture for learning chess proposed by Johannes Czech in 2018 for CrazyAra 0.2.0. The architecture incorporates new ideas and techniques described in recent papers for Deep Learning in Computer Vision...
5f79f546f945ad104c4b8605aefc2730618879a61e5fb79dd24a98cab2962745
Python
19,354
524
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jan 24 15:34:54 2022 Last update: 3/4/2023 @author: sudhanshu """ # from importlib.abc import Loader # from isort import file import torch from torch.utils.data import DataLoader import numpy as np import os import sys sys.path.append("..") from data_p...
56f8f472a83166c4e3312016e709d7ece1a78ba34ca1684d842a26cbc8d89fc7
Python
19,358
528
# 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...
31e1e1ce5b75fbc5cb1090534a6de652e868c95df5aa1fa8a1f3522148df88c8
Python
19,360
430
import pandas as pd import torch import torch.nn as nn import utils import scanpy import anndata as ad import pickle import scipy import tqdm import matplotlib.pyplot as plt import seaborn as sns import sklearn import numpy as np import os class TACTiCS: def __init__(self, dict_A=None, dict_B=None, match_path=No...
014d761c6a191f5b682cd91efd3597b88511ca842d9ab1a3530c3f5ccab3ade4
Python
19,387
382
import pickle import random import matplotlib.pyplot as plt from Bio import SeqIO def parse_scan_prosites_results(): id2stuff = {} next_app =False next_append=False with open("scan_prosite_results.fasta", "rt") as f: lines = f.readlines() for ind, f_ in enumerate(lines): if f_[0] =...
4e079f883d934404c58923386bafdacede76eb31f964da1b91f1b2d60b9c61a4
Python
19,396
421
"""AxialTAD trainer driver. Usage: python scripts/train.py --arch ACM --D 2 --patch 15 --ref filtered_ontad \ --output trained_models/15x15/filtered_ontad/ACM_D2 --gpu 1 Loads `*_processed.npy` from `samples/{patch_dir}/{ref}/train/`, trains for 30 epochs at batch_size=128, saves model weights + history +...
ba82eb737bf5f65feec56e993e72e70ac18f77561121ad4b63e99bb647c1fd45
Python
19,401
447
"""HMM Estimator. Implements a basic Hidden Markov Model (HMM) as an detector. To read more about the algorithm, check out the `HMM wikipedia page <https://en.wikipedia.org/wiki/Hidden_Markov_model>`_. """ import warnings import numpy as np from scipy.stats import norm from sktime.detection.base import BaseDetector...
db8bf88906e337270547cba81001b833aecca19bbad0b1f0a691d95070beea37
Python
19,410
563
# 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...
ad53f064171829004a5fafe1909939d94b04c4984141222acc0b267c93486250
Python
19,451
590
""" """ from typing import Union, Tuple, List import matplotlib.pyplot as mpl import numpy as np import seaborn as sns from vcnmodel.util import trace_calls from vcnmodel.analyzers import analysis as SPKANA import vcnmodel.analyzers.flatten_spike_array as VAFlatten from vcnmodel.util.basic_units import radians from vc...
75f9a7dcc54d37c30b57cba980533a315a1e7f74031098486bb8cfc3d0dd8131
Python
19,460
539
# 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...
91291ed2c99d347017e2455fa18f2ff4362d66ed98b73d3ba2c54811b31567a7
Python
19,483
482
# Copyright 2022 DeepMind Technologies Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
62118bbdacfaeaaf49fa37d9a8df668352bca5578653894405de62d378168600
Python
19,485
377
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...
483ee6b206f9454873ab88a1dd54abcc11c7b97e023350543f42366824b501b8
Python
19,490
600
"""Tests for the orthologs-to-rbh import path. Covers: - BED parsing (4-column, 6-column, CRLF, blank lines, bad rows). - Orthologs-table parsing (with and without orthogroup-id column, auto-detection, header row, --species-order override, multi-copy rejection, empty cells, mismatched column counts). - Join + .rbh...
d0d1b8ca31d89badbb06c586796c75bb3b5251401cda778304947dc68b1abaca
Python
19,491
514
from __future__ import annotations from io import BytesIO from typing import TYPE_CHECKING, Any, Literal from .core import AdaptationError, Adapter, Pass from .lib import FlagsContainer, HexString, bin_to_int, int_to_bin, swap_bytes if TYPE_CHECKING: from collections.abc import Callable, Hashable, Mapping, Sized...
e4030464c8f49ea886d2c4b3c7660c2e707d7b497fb4ac4162d0e958ae37961e
Python
19,505
528
from itertools import chain import numpy as np from sklearn.metrics import normalized_mutual_info_score, adjusted_rand_score, r2_score, confusion_matrix from scipy.optimize import linear_sum_assignment import torch.nn as nn import torch.optim as optim import torch.utils.data as D from tqdm import tqdm from src.data im...
c19c26fc495e1077f90e70d8b0fd69119151e23af906629a936f3b54b47009c6
Python
19,506
466
import pandas as pd import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt # import shap from keras.models import load_model # import PyNonpar # from PyNonpar import * import scipy as sp # import seaborn as sns import time from scripts_tl import data_handler_tl as dh_tl from scripts_tl i...
55a65cb996ce3af332542a48df81459447e63d15f0c3031724471ee9993b97c8
Python
19,511
544
# 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...
04409c27508370f5d27545840d4b5ed74ff29a2f1676db16bbe860a0e88101bf
Python
19,527
386
# Copyright 2019-2021 The AmpliGraph Authors. All Rights Reserved. # # This file is Licensed under the Apache License, Version 2.0. # A copy of the Licence is available in LICENCE, or at: # # http://www.apache.org/licenses/LICENSE-2.0 # from .EmbeddingModel import EmbeddingModel, register_model from ampligraph.late...
ef06bea6a7518567bd25d033dec9b777cd5b3b89d63551b37f530c98ef53b32c
Python
19,529
445
import argparse import csv import logging import multiprocessing import os import pickle import sys from collections import Counter from datetime import datetime from pathlib import Path from typing import Dict, List, Optional, Union import pandas as pd import rdkit.Chem as Chem import rdkit.Chem.AllChem as AllChem fr...
1c5aaa0cd8142648ad5b63ba978aea9effce79d2e31d6aa6f922248e358da85c
Python
19,540
403
from __future__ import print_function from neuron import h import numpy as np from .cell import Cell #from .. import synapses from ..util import nstomho from ..util import Params from .. import data __all__ = ['TStellate', 'TStellateRothman'] """ Class to instantiate T stellate (planar multipolar) cells from the co...
8942edd8ae4e89ba939572bd28edd87b7ac067b087f6510c12dfa0148973f5e0
Python
19,560
472
# SPDX-License-Identifier: LGPL-3.0-or-later from typing import ( Any, ) import torch from deepmd.dpmodel.common import ( get_xp_precision, ) from deepmd.dpmodel.descriptor.dpa4 import DescrptDPA4 as DescrptDPA4DP from deepmd.dpmodel.descriptor.dpa4_nn.activation import SwiGLU as SwiGLUDP from deepmd.dpmodel....
aae0b8237e97702f7c1894091ab03c08467d32c51f570d0053f77a2c4b043730
Python
19,560
619
from pathlib import Path from typing import List, Union import matplotlib.pyplot as mpl import numpy as np import pandas as pd import seaborn as sns from lmfit.models import GaussianModel from matplotlib import collections as mc from pylibrary.plotting import plothelpers as PH from pylibrary.tools import cprint as CP...
5bb942b0292eb3e7838945a3a041531e13e8a08c32df7e2afc24278518aaacd6
Python
19,562
365
import math import torch import torch.nn as nn from vp_suite.model_blocks import SpatioTemporalLSTMCell as STCell,\ ActionConditionalSpatioTemporalLSTMCell as ACSTCell from vp_suite.base import VPModel import torch.nn.functional as F from tqdm import tqdm class PredRNN_V2(VPModel): r""" This is a reimplem...
6c03ade28c86db796e1da43149e9ca11a902ca14d80ec9d1d77029d1e766eb27
Python
19,571
609
# 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...
713eb0a09b31a0c221b7191dc9351d3c153b64bc0f819fd4e7aed434cfd36a8b
Python
19,581
514
import os import torch import torch.nn as nn import torch.optim as optim import torchvision.transforms as transforms from torch.utils.data.sampler import SubsetRandomSampler import numpy as np import pandas as pd import matplotlib.pyplot as plt import time from tqdm.notebook import tqdm from skimage import io from scip...
0249803521c44fdc59d60f21771530a32f0c53ba8481c49d7e301225ec1dc0f7
Python
19,618
585
# 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 def compute_negative_log_likelihood_loss( input, target, weight=None, re...
ccbd9f14efe2ae14f973a1d096ec432de2b9d84a2756d5c09c791b27470e8e7d
Python
19,640
540
import logging import pathlib import random from collections import defaultdict from enum import Enum from functools import reduce from math import inf from pathlib import Path from typing import Literal, NamedTuple, Optional, Union from numpy import ndarray from scipy.stats import pearsonr, spearmanr from sklearn.met...
46f009d1924ac4c58be19b05a36c6684859deef4dffe1cf2b136b03dad183edc
Python
19,642
539
# ============================================================================= # IMPORTS # ============================================================================= from collections import OrderedDict import functools import math import operator import torch.nn.functional as F import torch.utils.data import torch....
67b73c6d0ff0b3cd587794195b99033e0b6453a5a19026d7f861acf48ccf65c3
Python
19,668
525
#======================================================================================================================= # Copyright (C) 2021 Matvey Safroshkin, Grigory Arutyunov, Patrick Mueller # Computer Vision Studio # Friedrich Miescher Laboratory of the Max Planck Society # Systems Biology of Development, Univer...
560e2cc99877259c34c8ba32d4eaa83198d83ebb021328e61cad1768acae6c65
Python
19,683
595
"""Continuous interval tree (CIT) vector classifier (aka Time Series Tree). Continuous Interval Tree aka Time Series Tree, base classifier originally used in the time series forest interval based classification algorithm. Fits sklearn conventions. """ __author__ = ["MatthewMiddlehurst"] __all__ = ["ContinuousInterval...
7c84747e49ffb6b5034ba197b8d622b91bd91e28cc14945adfb664d7f0e7333f
Python
19,700
483
# Copyright (c) OpenMMLab. All rights reserved. import math import warnings import torch import torch.nn as nn from mmcv.cnn import (build_norm_layer, constant_init, kaiming_init, normal_init, trunc_normal_init) from mmcv.cnn.bricks.transformer import FFN, MultiheadAttention from mmcv.runner impo...
c60563dd14ddec7fa95d369018fb95162e01949ff10b95b03b27ff426a15d58d
Python
19,711
506
# 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...
ef576b68457fbb8835c79cd589f47122a0f4f64c59ca2cae63bc3915cedf8973
Python
19,714
495
"""Utilities for SingleCellFusion """ from .__init__ import * import functools import collections import itertools import re from scipy import sparse from scipy.stats import zscore import fbpca import sys import logging import fbpca import anndata from . import basic_utils from . import clst_utils def sparse_adj_to_...
58cab96aa9abd730d1b13965bfd2dba1f263012eac05aa8c114d79db0f4488ee
Python
19,717
642
# Copyright (c) ONNX Project Contributors # # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np import onnx from onnx.backend.test.case.base import Base from onnx.backend.test.case.node import expect class GridSample(Base): @staticmethod def export_gridsample() -> Non...
06706763010736d234bf6b2846f3a43e870e01ddc3571e22cd74185101bcb442
Python
19,719
476
""" @file: builder_util Created on 31.05.22 @project: CrazyAra @author: queensgambit Utility methods for building the neural network architectures. """ import math import torch from torch import nn from torch.nn import Sequential, Conv1d, Conv2d, BatchNorm2d, ReLU, LeakyReLU, Sigmoid, Tanh, Linear, Hardsigmoid, Hards...
5d1dbc3414d7e48b688813cd95bdc9d2d925ad1313629089be56136b3285ced3
Python
19,720
417
""" Main test script """ import model import numpy as np import matplotlib.pyplot as pl import utilities import seaborn as sns from scipy.signal import convolve import time from pandas import DataFrame, concat from taylorDecomp import taylor_decompose import matplotlib as mpl import os import statsmodels.formula.api ...
e5fa3f2d2b28a026dde824a47496d40233a91e98758739cc0197177303ec900b
Python
19,725
590
# 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...
c5c151d330ee9f022949537ba6ba14d34131b7145608326d98780d3e9ec8f46f
Python
19,732
226
#!/bin/python3 # Author: Thomas Rolland jerikoo75@gmail.com # Date: 03/31/2022 import pandas as pd from numpy import mean, std from plotnine import * import statsmodels.stats as sm from statsmodels.miscmodels.ordinal_model import OrderedModel from statsmodels.formula.api import ols #==================================...
94025e0ebbcf222ce8e6a1a693969c942a6dd8be16569ffce02e14180143c46c
Python
19,737
657
import json import os.path import pickle from collections import defaultdict, OrderedDict import pygel3d.gl_display import pyvista from scipy.interpolate import RegularGridInterpolator from scipy.ndimage import distance_transform_edt from utils import * from pygel3d import graph from pygel3d import hmesh import numpy...
9583ae5cff7e8ba162e4e523a12045b724469999fbeb6f24a5a09fd686a0199b
Python
19,740
704
# 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...
d0f747cf368dd08f39fbb830e305b4cc163e53f41ab026998fe03b5a6996702d
Python
19,761
625
""" test_utilities.py Miscellaneous utility functions. For the most part this module serves as a custom circular statistics library. References: Shaverdian et al. (2022) - Weighted Cue Integration for Straight-line orientation Wilkie (1983) - Miscellanea Rayleigh test for Randomness of Circular Data Batschelet (1981)...
60829f80b7bac9037cc06f66b6ab50e82450a18698ab8f4ec5da02b0391d71ea
Python
19,763
404
from __future__ import print_function from neuron import h import numpy as np #import neuron as nrn from .cell import Cell from .. import synapses from ..util import nstomho from ..util import Params from .. import data __all__ = ['Tuberculoventral'] class Tuberculoventral(Cell): celltype = 'tuberculovent...
36db9039d5877a458ed0fc701b27595e7880c40237d2072a8bb04133f62ddb6a
Python
19,764
488
# 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...
9a27ca6b43ead320bfe5c210da2427d2e24da77342c8ee3f591e7c4390a172e1
Python
19,780
551
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Interface for the TSPulse time series classifier via granite-tsfm.""" __author__ = ["Faakhir30"] __all__ = ["TSPulseClassifier"] import tempfile from copy import deepcopy from sktime.classification.base import BaseClassifier from sktime.utils...
f4fd2ef30882aad42ecdad5322dd29531c98e9fdad5f7312813318ba1b0d6ce7
Python
19,787
414
from __future__ import annotations from dataclasses import dataclass import decimal from functools import lru_cache import math from numbers import Real from typing import Any from typing import cast from typing import TYPE_CHECKING import numpy as np from optuna._experimental import experimental_class from optuna.d...
4833853cb11bbaa93e649e1bfc69b8b50b069bd3c6f8f5b0d3831ec2f1f25796
Python
19,818
625
# 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 # # ...
335c140558989d6cedb94b2c6b8d0f9e063dfee5440a574bca444a81667aed30
Python
19,845
469
# This file provides functions to perform the oversampling and undersampling of compositional data. # Author : Teo Nguyen import random import numpy as np import pandas as pd import matplotlib.pyplot as plt from scipy.stats import gmean from sklearn.preprocessing import StandardScaler ###############################...
76d1bec4fd392486399e302858dc433f564a12de1fdeb4938bc119d67032ab89
Python
19,851
462
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np import onnx from onnx.reference.op_run import OpRun from onnx.reference.ops.op_matmul import numpy_matmul _INPUT_RANK_3D = 3 _INPUT_RANK_4D = 4 _QK_MATMUL_OUTPUT_WITH_BIAS = 2 _QK_MA...
24868c756796253ce565ff9e3ea41e0e016550a8e190d2c0f319feab890425a0
Python
19,852
516
# 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...
5cae4d9b9cd1db4404981e7b7b5b5443827cf11174fdeebadec16f7bda3a9651
Python
19,909
485
# 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...
bc06bb19e955a55993bbcb5462f535b67d087ef805b6a21b31e64e00fbc4690c
Python
19,920
576
# 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 pytest import os from ampligraph.latent_features imp...
d6839f569def88d29a3ccdc79b5b40389ba5cc29f9421729a2cd16b77642b4da
Python
19,924
589
import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import pandas as pd import nose.tools as nt import numpy.testing as npt try: import pandas.testing as pdt except ImportError: import pandas.util.testing as pdt from numpy.testing.decorators import skipif from nose import SkipTest try:...
56ba6523a1ccdb77bbdb0b924c0ea479db68efd0b6b0ba211518b25c075afe3a
Python
19,954
235
# 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...
15422172f64d29ca9be7543d6cb06c1a65cb28ec92da3cc6bc71b6bb1429629e
Python
19,962
466
# 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 from ..datasets import AmpligraphDatasetAdapter import tempf...
0a7971c6606c328ddb4e96c5f957f482b8ba0e6af6c6f90d95959e4530414f88
Python
19,974
554
import re from enum import Enum class XiangqiBoard: """ Represents a Xiangqi board. The board is initialized from the view of the red player (on the bottom). Empty fields and fields without figures of the corresponding player are represented as zeros. """ def __init__(self): self.figu...
e57ef2ce06358497984059e2b801746ba2f28f0f17e7f04a44c7de0ebe515f6c
Python
19,978
459
# 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...
229c0b08836a88c3107079c12c370244ce38c0ef5ae0da2b65698da615e25405
Python
19,989
435
import numpy as np import numpy.typing as npt from scipy.stats import rankdata, t, f from typing import Optional def pearson_coefficient( feature_arr: npt.NDArray[np.float_], joint_dist: npt.NDArray[np.float_], permutations: int, ) -> npt.NDArray[np.float_]: r""" Let X, Y be two random variables o...