sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
9d28cddc7e37b46efa116fc3eb6f20e945003b2c27ab2afb6f523aff68d89b9c
Python
21,595
444
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 = ...
110c240ca63d6f43c8006463db33a03cb9d8b0029b429abce72d1a41ad833cf1
Python
21,614
579
# 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...
b577491880635b40b2ca1204c5e759f9bc175f215a6da38520f04f11f5b00dfd
Python
21,647
563
# 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...
ff882f8155116ca97daec52d20c78690f50be68b8141f0ba91e3b8065924c3ac
Python
21,675
403
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...
3828919724d0d60051c4c19b33cb951d67b62d8ddd8bfe7e3c548303af83dcc6
Python
21,678
512
import csv import logging import multiprocessing import numpy as np import os import pickle as cp import random import time from base.processor_base import Processor from collections import Counter, defaultdict from gln.common.mol_utils import cano_smarts, cano_smiles, smarts_has_useless_parentheses from gln.data_proce...
5f35221e1d476430dfc56fab73d0192c6f08e4122179f96b615dfdd4a215fada
Python
21,680
620
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Intermediate base class mixin with common functionality for panel tasks. Inherits from BaseEstimator, descendents are: BaseClassifier BaseRegressor """ __author__ = ["fkiraly"] __all__ = ["BasePanelMixin"] import numpy as np import pandas a...
0a533e07284b37b1f287472f06056fbd7bb48da5ec5cbef6186e6c19746a51b6
Python
21,686
480
"""Abstract base class for the Pytorch neural network classifiers.""" __authors__ = ["geetu040", "RecreationalMath"] __all__ = ["BaseDeepClassifierPytorch"] import abc from collections.abc import Callable import numpy as np from sklearn.preprocessing import LabelEncoder from sktime.base.adapters._pytorch import _P...
63ce0454e938c5a1dc04298e924335d638760eafb04c86ea6d723239ed9ef162
Python
21,729
386
# Transform is the primary class in ARDENT. import numpy as np from pathlib import Path import pickle from .presets import get_registration_preset from .lddmm._lddmm import lddmm_register, lddmm_transform_image, lddmm_transform_points from . import file_io class Transform: """ Transform stores the deformati...
923431718f45d820f973a0a07e78f77e2166c4c2b7433cfdefd6ce8d3a19093c
Python
21,788
600
""" readmodel.py - tools to read model data files. All reading should be done through this module, as it handles different formats, and retuns a uniform "ModelData" data structure This module is part of *vcnmodel*. Support:: NIH grants: DC R01 DC015901 (Spirou, Manis, Ellisman), DC R01 DC004551 (Manis, 2...
945006817b2ba30f20d7dd3a5c8bb49d73252fd4dd733487dc04ba7bc931b117
Python
21,807
557
# 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...
facb6530ac45bdfb267699628233294ea45f46b4442bfbd428311b49e1aa8d1a
Python
21,818
451
""" This script produces figure S7n (the right part) of the paper. """ import os import numpy as np import pickle as pkl import pandas as pd import src.models.kernel_regression as kernel_regression import src.models.psth_regression as psth_regression import src.visualization.vizregression as vizregression import src....
61be50cfe1eaeb554efd8b7fcf1a60fa32fc3d12a0b1d3968227113eb4176276
Python
21,819
451
""" This script produces figure S7p (the right part) of the paper. """ import os import numpy as np import pickle as pkl import pandas as pd import src.models.kernel_regression as kernel_regression import src.models.psth_regression as psth_regression import src.visualization.vizregression as vizregression import src....
be04e1e26d47f32b3e279ef0fc314fcfc3b0932a81d751c856c82c5501d3d807
Python
21,839
483
import argparse import logging 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 from rdkit import RDLogger from tqdm...
8f823d4b1e75ed2f0de22e3706bd33b1097f7c1e7e88f92d4e631fd251a34f99
Python
21,846
628
# 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...
42cc0b447b8a5ec92bca7358255b24e24d12e0bcfba695e453241ddc9aca6017
Python
21,853
579
import numpy as np import torch from torch.utils.data.dataset import TensorDataset from torch.utils.data import DataLoader import torch.nn.functional as F from torch.autograd import Variable def my_softmax(input, axis=1): trans_input = input.transpose(axis, 0).contiguous() soft_max_1d = F.softmax(trans_input,...
9e8feaa89d0ddc9257dc831423b016815dd468735527ea4c9cab8283ce4c5b4b
Python
21,859
487
#!/usr/bin/python # @author Neil Munjal # @date 2019-07-27 import pandas as pd import numpy as np import matplotlib.pyplot as plt import scipy.stats as stats from functools import partial from sklearn.model_selection import train_test_split from sklearn.ensemble import RandomForestRegressor from sklearn.ensemble imp...
8c3cf26d97d4bd01ead759266a488e53987d57ef74f10c7ea5af63f1aba349ef
Python
21,891
573
"""Functions for computing the quantized Gromov-Wasserstein distance and the SLB between \ metric measure spaces, and related utilities for file IO and parallel computation.""" # std lib dependencies import csv import itertools as it import sys from math import sqrt from typing import Collection, Iterable, Ite...
2c3611415c50c86d71521420b5634c48f3802d4f58e20b07967aa877b41a70fc
Python
21,893
450
""" This script produces figure S7H (the right part) of the paper. This is the mean value of the auditory kernel as a function of ML and AP position """ import os import numpy as np import pickle as pkl import pandas as pd import src.models.kernel_regression as kernel_regression import src.models.psth_regression as ps...
402750b9d67960df92e8b3d2091d9aa38a4d0cf37723717de44aac6084f5b0bc
Python
21,893
450
""" This script produces figure S7F (the right part) of the paper. This is the mean value of the auditory kernel as a function of ML and AP position """ import os import numpy as np import pickle as pkl import pandas as pd import src.models.kernel_regression as kernel_regression import src.models.psth_regression as ps...
04c90ab31188b0f7c7236b7b913eeca28c23fbb1fe5f744e158871defdf2365a
Python
21,899
451
""" This script produces figure S7l (the right part) of the paper. This is the mean value of the auditory kernel as a function of ML and AP position """ import os import numpy as np import pickle as pkl import pandas as pd import src.models.kernel_regression as kernel_regression import src.models.psth_regression as ps...
07a9355fc6d72d6220a5632c8e7825dfe0191ad51969df037ab15ee2f65e1443
Python
21,899
451
""" This script produces figure S7j (the right part) of the paper. This is the mean value of the auditory kernel as a function of ML and AP position """ import os import numpy as np import pickle as pkl import pandas as pd import src.models.kernel_regression as kernel_regression import src.models.psth_regression as ps...
1a5fc7dbcfd65feeac89e490e8d369fd7fb009458e1baff6bc1cb3cce53b0ecf
Python
21,906
26
from regionscode.regions_per_sections_adult import regs_per_section, Regions_n_colors_List def create_regs_n_colors_per_sec_list(atlasnum): regs_per_sec_List = regs_per_section[int(atlasnum)] #list regs_n_colors_per_sec_List = [('root', 'not detected', '000000', (0, 0, 0))] for elem in Regions_n_colors_Li...
a6517f80f82027be2e672edeb58aee1b6061e10997dc06e04a234b8b48f5d150
Python
21,906
592
# 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 # # ...
da9fdb038ba0d1ba6f7fe5ee7d2184b9db539ac029b72d08c202580fe3bdfea9
Python
21,918
500
"""Models for outlier detection""" import numpy as np import torch from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F def reconstruction_loss(x, x_hat): return F.mse_loss(input=x_hat, target=x) def kl_divergence(mu, logvar): return torch.mean(-0.5 * torch.sum(1 + logv...
b0fcaa8000e7cd301aaa2d79e9fcdf462249f30fe63fe539f2f83ed021ab1b55
Python
21,923
654
# 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...
78471b6088f9ac27563b89fb0dc3e3303a3106126c2331363ab3a22a225dc322
Python
21,941
554
# 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...
bc11578864e1e70a87f469375f2a994692155180ee2b30c22233e64c963a4806
Python
21,951
566
# -*- coding: utf-8 -*- """ @author: ronwd """ #%% Import everything import numpy as np import pandas as pd import seaborn as sns from pathlib import Path, PureWindowsPath from scipy import io import matplotlib.pyplot as plt #%% Set seaborn stuff sns.set_theme() #set seaborn default theme #grabbed hex codes if n...
c2c363bbfc6e3d870532633f2eae7247e4fd691914007c03411a4e4df0c33749
Python
21,960
470
# this software is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. import imp import signal import numpy as np #import tensorflow as tf import tensorflow.compat.v1 as tf tf.disable_v2_behavi...
946192448e0eede4c3d01059670d548ea476f4e9173097003661cc3ea3f78c5f
Python
21,967
733
#!/usr/bin/env python # # Copyright 2006, 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...
2d048fc669478adce11394e5709e4652488bbc6f84fbc6c650cf1f859942338f
Python
21,975
550
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) from mmcv.cnn.bricks.drop import build_dropout from mmcv.cnn.bri...
6595d8382b8f084764d73debad52ed6f60bb16e1ef177a21ed8ef1d8c004b107
Python
21,981
487
import numpy as np import sys import json from ray.rllib.env.base_env import BaseEnv from mprl.rl.envs.stratego.stratego_spatial_multiagent_env import SpatialStrategoMultiAgentEnv # Need raw numba functions from stratego_env.game.stratego_procedural_impl import _get_game_result_is_invalid # Numba Methods from mprl.r...
094768374ef42208c2b90976f8ea1e5ebf1fe0c9866250c4378a96a66ae4e07c
Python
21,999
306
import matplotlib.pyplot as plt import numpy as np import numpy.ma as ma import sys from scipy.stats import norm from PIL import Image from sklearn.linear_model import LinearRegression sys.path.insert(1, "/Users/hyung/Research23_Network_Analysis/mBIN/Python/NetworkAnalysisGeneral/Code/SupportFunctions/") from analysis...
b7a00831154373a6f784a1c166e47227a3cce73182bcfd92d35ea7c722aea066
Python
22,019
504
from abc import ABCMeta, abstractmethod import os import pandas as pd from tensorflow.keras.callbacks import EarlyStopping from tensorflow.data import TFRecordDataset import tensorflow as tf ################################################################################## ################### Meta classes ...
9d6906cbd2d9f62d29643aa786073f1c51a62689e7f7c4becabf313fbaeddea1
Python
22,037
515
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jul 4 11:38:51 2021 @author: Mesfin Diro """ from typing import Callable, Optional import os.path as osp import torch from torch_geometric.data import InMemoryDataset, Data import re import numpy as np from tqdm import tqdm #from tqdm.notebook import t...
3d61edfd21fe053eb6c77b181f04a9087091d09346b887b593411f6ca56d303f
Python
22,045
605
"""Tests for source/odp_color_manager.py. Focus on the pure-function color utilities — hex↔rgb conversion, hex validation, contrasting-color picker, brightness / saturation math, random / palette color generators. These run without any I/O, so they exercise the helpers used everywhere downstream (synteny plots, ribbon...
3dae41563f2438f05a5858bee28c192fcc9ba8dac485c43da80a1b9f72e90406
Python
22,051
536
"""Module with functions for creating plots for training report""" import matplotlib.pyplot as plt from matplotlib.ticker import MaxNLocator import seaborn as sns import numpy as np import pandas as pd from torch_geometric.loader import DataLoader from sklearn.metrics import r2_score import torch from gnn_eads.functi...
dd2371dd2f9cf792db26b2abf420d409d251b2c8391bd4368e85bffd7313058c
Python
22,056
436
from __future__ import print_function from functools import reduce from operator import or_ import numpy as np import pickle from os import listdir from os.path import splitext import random from classicalClassifier import ClassicalClassifier from deepClassifier import DeepClassifier ''' def classifierMetadata(finalCl...
3299d12751cc2b73426ed3590c6992f202724c3ec4aa5cb99c14a1f64425fd5f
Python
22,066
681
# SPDX-License-Identifier: LGPL-3.0-or-later import argparse import io import json import logging import os from pathlib import ( Path, ) from typing import ( Any, ) import torch import torch.distributed as dist import torch.version from torch.distributed.elastic.multiprocessing.errors import ( record, ) ...
bedbc6a5bd74c071d69d73a2ecc83fcea1166874cfc440ddbef3a5f35fe503b4
Python
22,089
642
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 """Every class imported in this module defines an implementation of an operator of the main domain. Any class name uses `_` to specify a version defined in a specific opset. The class name without `_` defines the current implementation. If...
6e98607bf4d824359d7dc567cf8c416ac4b829904a40f24ec7f7822ef3f09622
Python
22,094
456
#!/usr/bin/env python import logging import os import importlib import sys import pickle import numpy as np import pandas as pd from keras.callbacks import ModelCheckpoint, LearningRateScheduler from keras.models import load_model from scipy.stats import spearmanr from keras.layers import Input import tensorflow as tf...
66673bc09f12f57c5ff0b4b234d29d2c2ac28c5a64614a1ba2c51ba9b52e1537
Python
22,111
725
# 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,...
f1e978d4a3de739db730252a5a352e3312503fbbff9ee102369790da1f5d28e9
Python
22,128
634
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import struct import sys import zipfile from typing import TYPE_CHECKING from onnx import TensorProto, helper if TYPE_CHECKING: from collections.abc import Mapping def _make_model( op_type: st...
df4c83c4b83dbaf3c68009c77836614f35da51167f292a55dc844ac149ced0e2
Python
22,146
578
#!/usr/bin/env python # -*- coding: utf-8 -*- """BLAST real-data streaming utilities for PatchTST-FM pretraining. This module provides the BLAST stream used by the mixed-data trainer. It exposes ``BlastRealIterableDataset`` and preserves the trainer's sample contract:: { "x": FloatTensor[context_length], ...
a77890a3fc546f52600bf362dcd0c577fd0cb89d93c19dd42990c91fa20755c3
Python
22,157
458
""" Implement the Numpy backend, and collect timing information with different parameters William Nourse August 26th, 2021 I have set myself beyond the pale. I am nothing. I am hardly human anymore. """ import numpy as np import pickle import time import sys """ #######################################################...
6766e60932fd1fc0695fb72d96f9116ac0da1feb4186c41921bc668ea3ad1c2c
Python
22,213
492
import numpy as np import torch from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F from losses import reconstruction_loss, kl_divergence class ConvBlock(nn.Module): def __init__(self, **kwargs): super(ConvBlock, self).__init__() self.conv = nn....
dab15d8ec69b84e4bca9a4c74b706831dff6749a0a049d56bda5e94de8eec794
Python
22,218
674
#!/usr/bin/env python3 """Configuration file for the Sphinx documentation builder.""" import datetime import os import sys import warnings from pathlib import Path from bs4 import BeautifulSoup import sktime # -- Path setup -------------------------------------------------------------- # If extensions (or modules ...
1d48624cb75c4eb4c736d8e2d80ba7b6a4bad29bb9e38f974f31e67aa75d65dd
Python
22,246
499
# SPDX-License-Identifier: LGPL-3.0-or-later """Unit tests for the dpmodel DPA4 (SeZM) descriptor. The suite runs on the dpmodel backend alone except for the source-gate cross-backend check, whose pt import lives inside the test function because ruff TID253 bans module-level ``deepmd.pt`` imports under ``source/tests`...
391a2ad640e525e6f748897a100a5d36fcd7ebc99ecc31f36a9c2098f77155a9
Python
22,295
545
from collections import defaultdict import numpy as np from numba import njit import json from helper_functions import find_runs, Annotate_with_ref_genome, Make_folder_if_not_exists, flatten_list # ------------------------------------------------------------------------------------------------------------------------...
198e465b65ccfb9e7a11ec151b9d3652e9b6a0d78cc252022f26579811d4f8e8
Python
22,308
530
import random from pathlib import Path from functools import partial import numpy as np from scipy import ndimage from scipy.ndimage import label, generate_binary_structure from scipy.spatial.distance import cdist from bcblib.tools.arrays_utils import coord_in_array from bcblib.tools.blob import Blob from bcblib.tool...
17efa717af3cb69c416a31b4c12b6e20d6c7f96158b514ddcbceccb443bf235f
Python
22,309
529
# SPDX-License-Identifier: LGPL-3.0-or-later """The Uni-Mol v1 backbone as a deepmd descriptor. Wraps the ported Uni-Mol encoder (:mod:`deepmd.dpmodel.descriptor.unimol_nn`) in the descriptor interface. Unlike every other descriptor here, Uni-Mol is global rather than local: it attends over all atom pairs with no cut-...
d5e725302a05fa90ad47b2a4c05485279c7273bd94999174915e2bf796291da9
Python
22,309
561
""" Core Algorithm Implementation Module for pciSeq This module implements the main Variational Bayes algorithm for spatial transcriptomics analysis, primarily through the VarBayes class. The algorithm iteratively: 1. Assigns spots to cells 2. Determines cell types 3. Estimates gene expression patterns 4. Updates mode...
a050835716028a3a63c0a74b82344ec312d79f95e98e47f65a2b36bc1fc6dd96
Python
22,314
515
# Copyright 2019 Martin Haesemeyer. All rights reserved. # # Licensed under the MIT license """ Module with general utility functions and classes """ try: import Tkinter import tkFileDialog except ImportError: import tkinter as Tkinter import tkinter.filedialog as tkFileDialog import numpy as np im...
e760a642f58c61d17e082f6a2445d1532473ad6fb9696e0609e36e0444fdc12c
Python
22,350
624
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Implements Generalized Autoregressive Conditional Heteroskedasticity models.""" __author__ = ["Vasudeva-bit", "SzymonStolarski"] __all__ = ["ARCH"] import itertools from collections import OrderedDict import numpy as np import pandas as pd i...
edf6cfe80422678bcc2c8e11148d9d330f36975bbba39d057cbca0429a44a135
Python
22,374
582
# 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...
81f72e7aa4ae843984dd07297399134b1f964e69bf910f1020eb84073d924b89
Python
22,417
619
""" Results class that summarizes the results of scCODA and calculates test statistics. This class extends the ´´InferenceData`` class in the ``arviz`` package and can use all plotting and diacgnostic functionalities of it. Additionally, this class can produce nicely readable outputs for scCODA. :authors: Johannes Os...
8c4e1ab9a7827805750e2cc71b047841fa9e4e7f91c8842fbeb246e716dd3d45
Python
22,424
466
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 = ...
df126dc0ccb11c916bd425188d2bbb1015083ade6349b2a5aaa475900985d008
Python
22,436
616
from typing import Sequence import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import build_activation_layer, build_norm_layer from mmcv.cnn.bricks.drop import DropPath from mmcv.cnn.utils.weight_init import trunc_normal_ from mmcls.utils import get_root_logger from ..builder import BACK...
f95dc6faa67b8566b965c95e45f0ae2cdb5fe72521831a086207eef4d4f346fb
Python
22,447
558
import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.colors as mcolors import matplotlib.cm as cm import numpy as np import dolfin as df # set font & text parameters font = {'family': 'serif', 'weight': 'bold', 'size': 16} plt.rc('font', **font) plt.rc('text', usetex=True) mpl.rcP...
dc08f5c4e5eb8f3142333ed604fe92843d09bd0f70b5c9cbdbe74eca5b52e88e
Python
22,457
597
# 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 # # ...
9ce3b891b79aa7afcdf9dbc85ca96a2bc9cef29c1bc8ccc1bb2946819436b936
Python
22,467
717
import pytest from unittest.mock import patch import pandas as pd import numpy as np import scanpy as sc import matplotlib import matplotlib.pyplot as plt from matplotlib.markers import MarkerStyle from palantir.plot import ( density_2d, plot_molecules_per_cell_and_gene, cell_types, highlight_cells_on_...
135c03455cf253cd6814107dd5b6e183c8e0287564775728034e84790e3bfd8a
Python
22,485
626
from __future__ import annotations import datetime import enum import math from typing import Any from sqlalchemy import asc from sqlalchemy import case from sqlalchemy import CheckConstraint from sqlalchemy import DateTime from sqlalchemy import desc from sqlalchemy import Enum from sqlalchemy import Float from sqla...
64cb8e9c9739516166c19b98d55299b38e5955de47e1e620999311f9f47366c3
Python
22,513
555
""" @file: input_representation Created on 26.09.19 @project: CrazyAra @author: queensgambit Input representation for all available lichess chess variants board states (including crazyhouse) which is passed to the neural network """ from chess.variant import CrazyhouseBoard import DeepCrazyhouse.src.domain.variants....
e36050d8e6bdd92bc6a0f43c9a80b93f04815dd95fdde0bec4d834ae435c9d77
Python
22,529
566
import numpy as np import pandas as pd import argparse import os import re import random import multiprocessing from rdkit import Chem from tqdm import tqdm from rdkit import RDLogger RDLogger.DisableLog('rdApp.*') # Get the mapping numbers in a SMARTS. def get_idx(smarts_item): item = re.findall('(?<=:)\d+', ...
17470c69041688523c682959ad0873e47cb35cb2829712430da67de6d3c02d69
Python
22,553
373
# using huggingface transformer to fine-tune BERT for rare disease entity linking # a mentionBERT is created, here we use the contextual mention representation (average of token represetntations in the mention of the second last layer of BERT). from sent_bert_emb_viz_util import load_data, get_context_window, get_c...
a4ede00463673ad798ee601662eb2ff47d996aa52d502c8dd128a8e8145efa7b
Python
22,564
489
"""Contextual Time-series Neural Classifier for TSC. Implemented in torch backend. """ __authors__ = ["fnhirwa", "srupat"] __all__ = ["CNTCClassifierTorch"] from collections.abc import Callable import numpy as np from sktime.classification.deep_learning.base import BaseDeepClassifierPytorch from sktime.networks.cn...
c06284650de5397ed99bf0017dd782e4bb36b0dc4ffad52d057a100f5a99ce3d
Python
22,599
612
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Aug 2 22:57:19 2021 Analysis on grid search results - First a rough grid search (fingsearch=False) then a finer gridsearch (finegsearch=True) - standard SHJ (nbanks=False); or simulation with two banks of units modelling anterior and posterior hpc (nb...
570bb5cdee575cf2cb968953244612b4d691ea435fae3fdd658c599b44ec4f35
Python
22,627
583
# imports import os import numpy as np import pandas as pd from skimage import io import seaborn as sns import matplotlib.pyplot as plt import cv2 import torch import torchvision import torchvision.transforms as transforms import torch.nn as nn from scipy.stats import pearsonr from scipy.stats import spearmanr from ...
a285cbf82b34755dbcd8250179f9b11471d06c3f72775286658a5fe3bc5874ed
Python
22,652
539
#!/usr/bin/env python # -*- coding: utf-8 -*- # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This prog...
202395f75e38e976831b7e9c82f133e1c5262e81c45e6f42e6ebf308b0cd6190
Python
22,655
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...
e6c41a72487a5f1e2ee754af7484b3bbeeed2c320328ece9a954c3f711105b50
Python
22,665
631
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Eclectic utilities for the datatypes module.""" import numpy as np import pandas as pd def _get_index(x): if hasattr(x, "index"): return x.index elif isinstance(x, np.ndarray): if x.ndim < 3: return pd.Rang...
ebdb9efd8c3874ed8bc14196c7d24ba9a624739c79e5642ef526b384a7c8b3fe
Python
22,668
589
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 sr...
ab34140ac59b06c952c7bccec7d311951abba8a0bb4a1503153d9fabc67c2261
Python
22,673
616
""" Sparc View Tree WorkFlow: 1. Create schema class 2. Create sheet importing schema class 3. update collect_sheets in GoogleSheets 4. any merging in graphs and harding is down in the following functions in GoogleSheets (merge_graphs & hardcode_graph_paths) 5. rerun sheet.py to generate spa...
b3c9e2f845f6f57c787feeb4daf8143080a6059878bcd373696d8c90275ce94d
Python
22,676
648
# 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...
00cf257580af0c178c6e58f7bc1331677980f2e1cfa5a7a0ad626f803119a747
Python
22,705
502
""" Generate clustered datasets for use in neuroimaging analyses Authors: Chris Foulon & Michel Thiebaut de Scotten Description: ------------ This script is designed to generate clustered datasets, particularly synthetic lesions, for neuroimaging analyses. It supports multiple clustering methods, including KMeans and...
276ee60a2dd803da427599259c83308ca4e437604f054333e0d3fb3b3f9cba69
Python
22,722
539
import os import warnings from pathlib import Path import csv from typing import Union from matplotlib import font_manager, pyplot as plt from nilearn import plotting from nilearn.image import image from nilearn.regions import connected_regions from tqdm import tqdm import numpy as np from scipy.spatial.distance impor...
222cae65277e6fcd91d9fe63089c71692b8038d6f3cb20ba53454e24001923f0
Python
22,744
694
#%% import numpy as np from scipy.stats import spearmanr, kendalltau from numpy.typing import NDArray from joblib import Parallel, delayed from tqdm_joblib import tqdm_joblib #%% class RSA: """Perform RSA between RDMs. Parameters ---------- rdm1 : NDArray The first RDM or a set of RDMs. rdm...
2e43d6c3f049d4842d1260d036605c305c763f219d7a3fc128ec469863d3b522
Python
22,750
402
"""Isolated GPU pilot for competitive allocation; frozen benchmark data are read-only.""" from __future__ import annotations import argparse import gc import json import os from pathlib import Path import shutil import sys import tempfile import time import traceback import numpy as np import torch from threadpoolctl...
7a9ab71b07a008dc2ff9b4e26d4cc7748dfb18a74fded768b94666e51e48caeb
Python
22,789
558
# Copyright (c) ONNX Project Contributors # # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import functools import glob import os import re import shutil import sys import tempfile import time import unittest from collections import defaultdict from re import Pattern from typing import TYPE_...
b2b871c4e016feac9f7bba0815fba25fa82f8a8bb90917e57b90d529ef05b41d
Python
22,798
594
# 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...
7c5146cebf35ffce0bcfaf2778effb9f6c393e23c6db218d9f503e2d1e3e7758
Python
22,803
652
# 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...
ba95ced325dd4fe92927a1dac3b946970efb499637205cbc85154449192b84d6
Python
22,824
484
# SPDX-License-Identifier: LGPL-3.0-or-later """pt_expt SO(2) runtime bindings for accelerated inference kernels. The dpmodel SO(2) modules are array-API only. These wrappers inject the reference PT inference paths around three hot paths, mirroring ``deepmd.pt.model.descriptor.sezm_nn.so2``: - the block-diagonal GEMM...
5aa1213fc31fc6316741e6a7e34f5ab4e7eba681955f3b2c2bf8835a821cc3a6
Python
22,832
658
""" Copyright (c) 2018 Ryuichiro Hataya the source code of SELayer is released under the MIT License https://github.com/moskomule/senet.pytorch/blob/master/LICENSE We built our base CNN model using timm(https://github.com/rwightman/pytorch-image-models). Copyright (c) 2019 Ross Wightman the source code of timm...
e703f2967b80b6ba7bac138c6c90818eb95c42776494662b8307e0e838571e32
Python
22,833
522
import torch import torch.nn as nn import logging from cormorant.cg_lib import CGModule, SphericalHarmonicsRel from cormorant.nn import RadialFilters from cormorant.nn import InputMPNN, InputLinear from cormorant.nn import OutputPMLP, OutputLinear, GetScalarsAtom from cormorant.nn import NoLayer from cormorant.nn im...
03fd6b1c043ec7b438570092f7b41961301b54ef7f98151f41779126d47e8655
Python
22,844
457
# -*- coding: utf-8 -*- """Integer handling class `IntegerCentering` to be used in combination with CMA-ES. Reference: Marty et al, LB+IC-CMA-ES: Two simple modifications of CMA-ES to handle mixed-integer problems. PPSN 2024. """ import warnings as _warnings import numpy as np centering_on = True '''convenience flag t...
1efa7b30dbf1360af36b2a874e81c8305bfa464998fa8f7b0754fe367c70fa53
Python
22,854
435
""" Script for identifying stimulus and behavior related neurons in random-wave experiment data """ import model import numpy as np import utilities import h5py from scipy.ndimage import gaussian_filter1d import os from os import path from experiment import Experiment2P from numba import njit from multiprocessing imp...
2ae3f76f95b548fc59489aa3359d3c9af553c13fdb4ce099b61ba22f42e48edf
Python
22,943
504
from futhark_ffi import Futhark from types import MethodType from typing import Union, Optional from cajal.run_gw import DistanceMatrix from cajal.run_gw import Distribution from cajal.run_gw import cell_iterator_csv from cajal.utilities import n_c_2, uniform import numpy.typing as npt from math import exp, log import ...
cffa13f439c6abab6ae9d5c1997f12b37d0f4311355d20d431996b5959bbfc4d
Python
22,956
496
import numpy as np import tensorflow as tf import tensorflow.keras.layers as KL """ copied from https://github.com/rishigami/Swin-Transformer-TF/ """ CFGS = { 'swin_tiny_224': dict(input_size=(224, 224), window_size=7, embed_dim=96, depths=[2, 2, 6, 2], num_heads=[3, 6, 12, 24]), 'swin_small_224...
0998db5b9074dc9413535ba86f17df2efa44a2605d7688b65bfeff9863058624
Python
22,981
638
from VesselGen.result_analysis.simulate_fow_pressure import * from matplotlib import rcParams rcParams.update({'figure.autolayout': True}) import scipy import os import matplotlib.pyplot as plt import numpy as np class VtkMorphAnalyer(VtkNetworkAnalysis): def __init__(self, pt_file=None, root_loc=None, vsize=22...
bd7fdbf88fa05c9ad34f71810be52000f48bd605436005e1c5a021eecdfa324f
Python
23,028
667
# Copyright (c) OpenMMLab. All rights reserved. import torch.nn as nn import torch.utils.checkpoint as cp from mmcv.cnn import (ConvModule, build_conv_layer, build_norm_layer, constant_init) from mmcv.cnn.bricks import DropPath from mmcv.utils.parrots_wrapper import _BatchNorm from ..builder imp...
1bbab26a219b1b0ae2dca8e903427ef08f6cf052ec7b14bc42a85a155b8c0d98
Python
23,035
671
"""Methods to convert between different file formats.""" import collections as col import gzip import os import re import Bio.PDB.Atom import Bio.PDB.Chain import Bio.PDB.Model import Bio.PDB.Residue import Bio.PDB.Structure import numpy as np import pandas as pd # -- MANIPULATING DATAFRAMES -- def split_df(df, ke...
1d7b87129b7b0d497507e890cd0f80976102ef7759bc396af598a59f6ba5e381
Python
23,068
618
from pyontutils import identity_bnode as idbn from collections import Counter, defaultdict def nst_to_adj(l): if not l: return [] start = l[0] if (isinstance(start, list) or isinstance(start, tuple)): raise ValueError('malformed') first = [] if start == "blank" else [(start, e[0]) fo...
373d513ad2ba0da242fd87c0b071bc665a53ef596e6863ff6a29d1150180452a
Python
23,069
427
"""Resumable unified matrix-only benchmark. External truth enters evaluate only. Run: python -m short2long.unified_benchmark --output-root ... [--smoke] The small smoke uses full catalogues but never becomes a main-table result. """ from __future__ import annotations import argparse import copy import gc import json i...
8f602fb276f9e6f2767eaf8a067946fd01c9f01647c78a6d63af8598dadf6076
Python
23,079
565
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Base class templates for distances or kernels between time series and tabular data. templates in this module: BasePairwiseTransformer - distances/kernels for tabular data BasePairwiseTransformerPanel - distances/kernels for time series...
bfd765b0aec3893327bef37aa4c1fecef3ddbf6c96a2ffc860598a6bb78b5c3b
Python
23,093
603
#------------------------------------------------------------------------------- # elftools: dwarf/enums.py # # Mappings of enum names to values # # Eli Bendersky (eliben@gmail.com) # This code is in the public domain #------------------------------------------------------------------------------- # Keep dict(...) cons...
5610270fc9932b6e981d5bf485a5a37d871d9c9b8783ab878590fe4d2b3c09fa
Python
23,094
661
# 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...
535c047760a0b31977035aa1a5ba4faae751104c5b9e6e920ebf7aacb7fec7b9
Python
23,097
519
# -*- coding: utf-8 -*- """ Copy for generating basic stats used in paper @author: ronwd """ import numpy as np from pathlib import Path, PureWindowsPath from scipy import stats, io #%% Feature sweep data #Set file filepath = "Your cool file path goes here" results_file = PureWindowsPath( filepath + "\\GitHub\\Tem...
cefffe0a6f3a227a3de750a992ff9917e80298a1ce1d7faa1dace47fbca85ec1
Python
23,143
471
from __future__ import print_function from neuron import h from ..util import nstomho import numpy as np from .cell import Cell from ..util import Params from .. import data __all__ = ['Pyramidal', 'PyramidalKanold', 'PyramidalCeballos'] class Pyramidal(Cell): celltype = 'pyramidal' scaled = False @...
ea17c6a7898e8db1157757ece54e3ac48cc11caf6da1e48d2d8cb2d4f806ab23
Python
23,176
606
# SPDX-License-Identifier: LGPL-3.0-or-later r"""Pair-clearance check for frame validity filtering. A frame is admissible when every atom pair keeps the clearance the training-frame filter prescribes. That clearance is a fraction of each pair's own length scale, so the check is scale-free: the quantity compared agains...
66ba055735e00fef3b23159bb19d3136a6bb1c40837cf238d9e433b5ac0c5e80
Python
23,188
457
import os import numpy as np from collections import deque from datetime import datetime, time, timedelta from statistics_processing import standardizer, standardize from connect_laser_device import connect_laser_device from parameterSetup import ParameterSetup from stagePredictor import StagePredictor import timeForma...
340b3eca5a0f791e3b903508661028c1beba7c90607c8b391ad7e74e552a6810
Python
23,256
522
""" Functions for sampling points from an SWC reconstruction of a neuron. """ import math from typing import Iterator, Callable import numpy as np import numpy.typing as npt from scipy.spatial.distance import euclidean, pdist from pathos.pools import ProcessPool from .swc import ( NeuronNode, N...