sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
167265662318e62a4d4f12b627428602ea4e2e7b3afb78106e0fb07a10612d21 | Python | 8,715 | 241 | from pathlib import Path
import mne
from mne.io import BaseRaw
from mne.epochs import BaseEpochs
from mne.evoked import Evoked
from .current_source_density import current_source_density
from .filter import spectral_filter, notch_filter, laplacian_filter
from .rename_channels import rename_channels
from .resample impo... |
cd5ec38c799df326d7d941fcfcffefa3e5185c089bc334d170dcfad9375dca26 | Python | 8,717 | 162 | """Stage time budgets scale with the number of input rows on the same core count.
The reviewed reference profile records seconds and input rows. Assembly uses
records assembled from chunks; motifs use input chains. A stage's budget is
(reference seconds + tolerance * reference compute seconds) * current/reference rows... |
94c51212e14a89ececfc1cc8913c381a4852080afc164cb630feaeb9e493b5b6 | Python | 8,728 | 284 | from PymoNNto.Exploration.StorageManager.StorageManager import *
import paramiko
from scp import SCPClient
def is_invalid_evo_name(name):
return '/' in name or '.' in name or ' ' in name or ' ' in name or '\\' in name or name in ['Documents', 'Pictures', 'Music', 'Public', 'Videos', 'Dokumente', 'Bilder', 'Musik... |
678d3b27e270800d79ec9b6b485f54a9c68eb8123f2ed9233871e61111943a68 | Python | 8,734 | 184 | # This file is a part of the `nequip` package. Please see LICENSE and README at the root for information on using it.
import math
import torch
from torch.fx.experimental.proxy_tensor import make_fx
from torch._decomp import core_aten_decompositions
from nequip.data import AtomicDataDict
from .versions.torch_versions ... |
790fc8f066aab9cf7912bfac42d24f2bf1558ac12dc10be99c648a19be30ef2a | Python | 8,734 | 260 | from __future__ import annotations
import itertools as it
import os
import sys
import warnings
from pathlib import Path
from typing import Protocol
import more_itertools as itx
from snakebids.io.console import in_interactive_session
from snakebids.paths import specs
from snakebids.paths._utils import BidsPathSpec, f... |
db3e72976756084a8f230eba2322ba7510014d699da11e3c55cf1f7428b680d3 | Python | 8,739 | 236 | # Copyright 2020 Forschungszentrum Jülich GmbH and Aix-Marseille Université
# "Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements; and to You under the Apache License, Version 2.0. "
import sys
import numpy as np
from mpi4py import MPI
import os
import time
def run_mpi... |
19dc9f330ce40c4ebe433f92f23002000971ca881b9bdafa0633140d5f5b66bc | Python | 8,740 | 227 | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
398aac6344de45836793324aa00e6153e39961020e6ff0f8430500ac193b4d0a | Python | 8,742 | 217 |
import os
import gc
import sys
import torch
import numpy as np
from tqdm import tqdm
from itertools import tee
from typing import Any, Dict, List, Generator, Iterable
from concurrent.futures import ThreadPoolExecutor
def encode_drug(batch, encoder, name):
""" Wraps encoding of drug compounds, i.e. drugs, from di... |
84b96a2b5a76bfcc298834bed037d06c060edb62c0df616e0232aab1836ecd50 | Python | 8,744 | 221 | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
54984d5e05ad2c8596cc4afc149b74680eb20fbe9a837d11a8d63c4637b23fb2 | Python | 8,745 | 235 | #
# For licensing see accompanying LICENSE file.
# Copyright (C) 2022 Apple Inc. All Rights Reserved.
#
import torch
from torch import Tensor
from typing import Optional, Tuple
from torch.nn import functional as F
from .base_layer import BaseLayer
from .conv_layer import ConvLayer
from .dropout import Dropout
from ..m... |
4d64b051a01525df6f8fbcd0c800c173c1629fd0ddedcc9af413653e03dc76ae | Python | 8,746 | 178 | """Offline discrete graph learning and unknown-outcome EM for record scores."""
from itertools import combinations
import networkx as nx
import numpy as np
from scipy.special import logsumexp
TARGET = "validated"
def _labels(labels, n):
values = np.asarray(labels)
if values.shape != (n,) or not np.isin(valu... |
f287d1931c41203da346987c2c314d61ad14c18ac445b809841d245b48f635ed | Python | 8,756 | 254 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
import numpy as np
from fairseq.data import (
AppendTokenDataset,
ConcatDataset,
DenoisingDataset,
... |
91eea914f36e2b06055b17f7db460e326071a5d01ba5d7d88225828255ef5195 | Python | 8,757 | 287 | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 22 14:30:31 2021
@author: nicol
"""
import os, glob, tqdm
from skimage.io import imread, imsave
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from matplotlib import rc
import matplotlib as mpl
import scipy.ndi... |
c85ec46c8ca2a302df27aec1fb4f67f3053c5b5948c864c700c98b92d27804b7 | Python | 8,757 | 221 | import argparse
import os
import torch
import numpy as np
import pytorch_lightning as pl
from pytorch_lightning.callbacks import ModelCheckpoint
from pytorch_lightning.loggers import WandbLogger
# Imports from this project
from ..src.graph_models import Estimator
from ..src.data_loading import GeometricDataModule
de... |
fdadd58eb64ecd8441bc2d60a996163b409627a985beb5029c88c86d40db08f4 | Python | 8,772 | 265 | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
b854fe64a7dfb6f848e8f4898e9fc5d4ccea86701ccd45fe9e4dc99aadd6c8b6 | Python | 8,775 | 140 | """
This is the configuration file for fine-tuning.
We implemented two pretrain tasks: mask prediction and mask contrastive learning.
--- Mask prediction is just the same pretrain task used in original BERT paper, predicting the ids of masked tokens
--- Mask contrastive learning is our propsed pretraini... |
4aaeacaf84587878e775b6981b35708ad2eb65a1693248a2baf085f5e90f82e9 | Python | 8,776 | 140 | """
This is the configuration file for fine-tuning.
We implemented two pretrain tasks: mask prediction and mask contrastive learning.
--- Mask prediction is just the same pretrain task used in original BERT paper, predicting the ids of masked tokens
--- Mask contrastive learning is our propsed pretraini... |
5bcb3c6812c915f917c2bd228860d64a5548d3427ce1506b1516557413c20531 | Python | 8,776 | 140 | """
This is the configuration file for fine-tuning.
We implemented two pretrain tasks: mask prediction and mask contrastive learning.
--- Mask prediction is just the same pretrain task used in original BERT paper, predicting the ids of masked tokens
--- Mask contrastive learning is our propsed pretraini... |
2b026b9f8e215b425450198124d71850e217925fdb622b530183c89031d9fe4d | Python | 8,777 | 220 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from functools import lru_cache
import numpy as np
import torch
from fairseq.data import Dictionary, data_utils
from . import BaseWrapperDat... |
71ed6164d5ac06ffcf3e248aef1dce0d96c4c4a5bf4467fa8a70b51ba5998dea | Python | 8,777 | 140 | """
This is the configuration file for fine-tuning.
We implemented two pretrain tasks: mask prediction and mask contrastive learning.
--- Mask prediction is just the same pretrain task used in original BERT paper, predicting the ids of masked tokens
--- Mask contrastive learning is our propsed pretraini... |
7cf697bb40933d3e9c1ae0b7f55e97634f6d792879388f95ea647014c2292a1f | Python | 8,778 | 140 | """
This is the configuration file for fine-tuning.
We implemented two pretrain tasks: mask prediction and mask contrastive learning.
--- Mask prediction is just the same pretrain task used in original BERT paper, predicting the ids of masked tokens
--- Mask contrastive learning is our propsed pretraini... |
f213fa54607e988603d3abcfd87061d09ac96117fea0daa8e63316044e73c313 | Python | 8,778 | 140 | """
This is the configuration file for fine-tuning.
We implemented two pretrain tasks: mask prediction and mask contrastive learning.
--- Mask prediction is just the same pretrain task used in original BERT paper, predicting the ids of masked tokens
--- Mask contrastive learning is our propsed pretraini... |
4353ccadb5660f304c46298b029e4eee6616e80cea4b39545e2e4e2427e63630 | Python | 8,779 | 140 | """
This is the configuration file for fine-tuning.
We implemented two pretrain tasks: mask prediction and mask contrastive learning.
--- Mask prediction is just the same pretrain task used in original BERT paper, predicting the ids of masked tokens
--- Mask contrastive learning is our propsed pretraini... |
9a798fbf363b331576ac3d7642e223aa0ebed180af43a9226ae848617fe53d94 | Python | 8,779 | 140 | """
This is the configuration file for fine-tuning.
We implemented two pretrain tasks: mask prediction and mask contrastive learning.
--- Mask prediction is just the same pretrain task used in original BERT paper, predicting the ids of masked tokens
--- Mask contrastive learning is our propsed pretraini... |
a89194824906adf47a63f11b1a0bab06b19cb0fe9ae7d04bdd1a559bfd83a2c1 | Python | 8,779 | 140 | """
This is the configuration file for fine-tuning.
We implemented two pretrain tasks: mask prediction and mask contrastive learning.
--- Mask prediction is just the same pretrain task used in original BERT paper, predicting the ids of masked tokens
--- Mask contrastive learning is our propsed pretraini... |
a8bdb9a6874068cdb32f59e7caeef0fcd016eeb5934f88284226090ef46cc4a9 | Python | 8,779 | 140 | """
This is the configuration file for fine-tuning.
We implemented two pretrain tasks: mask prediction and mask contrastive learning.
--- Mask prediction is just the same pretrain task used in original BERT paper, predicting the ids of masked tokens
--- Mask contrastive learning is our propsed pretraini... |
7575ce9065c69ffffacbc7addcc007de2a60007d40606ca0bc9d03177478ed0c | Python | 8,782 | 262 | import random
from geomstats.metric_geometry.trees import ForestTopology, Split
from geomstats.test.data import TestData
class GenerateSplitsTestData(TestData):
def len_test_data(self):
n = random.randint(6, 9)
data = [
# Three things can be partitioned three ways
dict(n_... |
0c90a1de8e13a2bdee68c1418df123a25d9398c0b1e309854bc3c821e161e148 | Python | 8,783 | 140 | """
This is the configuration file for fine-tuning.
We implemented two pretrain tasks: mask prediction and mask contrastive learning.
--- Mask prediction is just the same pretrain task used in original BERT paper, predicting the ids of masked tokens
--- Mask contrastive learning is our propsed pretraini... |
318c10a723e4a77ba85ab1ac2597a2711dfcca4a4b8dc0865dcd8807c20ee422 | Python | 8,783 | 140 | """
This is the configuration file for fine-tuning.
We implemented two pretrain tasks: mask prediction and mask contrastive learning.
--- Mask prediction is just the same pretrain task used in original BERT paper, predicting the ids of masked tokens
--- Mask contrastive learning is our propsed pretraini... |
7feca93b4be822b779a4976a544278aaf3245748969cca175b97f55267d532fb | Python | 8,784 | 220 | """Backend-agnostic GNC pipeline stages: pre-eddy correction and the
post-eddy single-interpolation recombination."""
import shutil
from pathlib import Path
from typing import Any
from lib.designer_input_utils import splitext_
from lib.gnc.backends import compute_gnc_warp, derive_gnc_graddev
from lib.utils import for... |
ab4216a701dd33432ae9d50c72e307bc3b9d76a22535aba64fc0c7b8f7b1c79f | Python | 8,785 | 140 | """
This is the configuration file for fine-tuning.
We implemented two pretrain tasks: mask prediction and mask contrastive learning.
--- Mask prediction is just the same pretrain task used in original BERT paper, predicting the ids of masked tokens
--- Mask contrastive learning is our propsed pretraini... |
c6d45e033c2d6ba1085efbe6d65c8c46b09a02fe8e12a35ad82242e02aaba7d4 | Python | 8,786 | 140 | """
This is the configuration file for fine-tuning.
We implemented two pretrain tasks: mask prediction and mask contrastive learning.
--- Mask prediction is just the same pretrain task used in original BERT paper, predicting the ids of masked tokens
--- Mask contrastive learning is our propsed pretraini... |
754d4d065906f7ba570da911021dfdc5a82be8cb75e1a1afb3d9613f1143b641 | Python | 8,787 | 292 | #!/usr/bin/env python3
import argparse
import pickle
import matplotlib.pyplot as plt
import numpy as np
import odil
from odil import plotutil, printlog
"""
Solves the Poisson equation in a multi-dimensional cube
with zero Dirichlet boundary conditions.
"""
def get_ref_u(name, args, domain):
xw = domain.points... |
184067944e4d9f7b9f9801664a4f9963afe697d07bf882cf6b90d2d4701206d0 | Python | 8,789 | 234 | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
c3c97f5fb6fe71df755e8b40566fdca0d16a2daf7693b7dcc015f1dcf1c11a2e | Python | 8,790 | 237 | import time
import h5py
import json
import sys
import os
import six
import copy
import argparse
import torch
import torchfields
from cloudvolume import CloudVolume
import numpy as np
from pathlib import Path
from tqdm import tqdm
def get_dset_path(dst_folder,
x_offset,
y_offset,
... |
e3178a3cb2a4cb60dfbfe58069fec07fb71e8389653028261bef4373c7650923 | Python | 8,796 | 229 | import matplotlib.pyplot as plt
import numpy as np
import csv
def load2(filename):
sim = []
col = []
num = []
mes = []
with open(filename, newline='') as csvfile:
reader = csv.reader(csvfile, delimiter=',')
for i, row in enumerate(reader):
if i>0:
sim.app... |
5c7ee76413c8326c2af96b45e98f117c735eb85d59f4abe7b28a7ef7ced46eb1 | Python | 8,800 | 237 | import os
from tqdm import tqdm
import argparse
import time
import numpy as np
import random
from distutils.util import strtobool
import torch
from torch_geometric.data import DataLoader
import torch.optim as optim
import torch.nn.functional as F
from torch.utils.tensorboard import SummaryWriter
from torch.optim.lr_sc... |
7bcbbaac4172133dad1753037dd6ac1e8fa4302a33988af02a8e9bac7b87fb99 | Python | 8,801 | 268 | #!/usr/bin/env python3
#
# Sniffles2
# A fast structural variant caller for long-read sequencing data
#
# Created: 20.09.2024
# Author: Hermann Romanek
# Maintainer: Hermann Romanek
# Contact: sniffles@romanek.at
#
"""
Genotyping
"""
import logging
import math
from dataclasses import dataclass
from typing... |
8c7c1481d2be224252d0beeaf3b8ae60a7703e9f48e67452bbe9abd49430e86e | Python | 8,801 | 243 | import torch
import torch.nn.functional as F
from torch.nn import Embedding, Sequential, Linear, ModuleList
from torch_scatter import scatter
from torch_geometric.nn import radius_graph, MessagePassing
from ogb.graphproppred.mol_encoder import AtomEncoder, BondEncoder
try:
import ase
except ImportError:
ase = ... |
43cc17ebcfa4afcfc1b6f86190ab16e966fc8ad309b46a2e0502b02e987fc1fc | Python | 8,804 | 223 | import contextlib
import numpy as np
import torch
import torch.nn as nn
from einops.layers.torch import Rearrange
from model_angelo.models.common_modules import FcResBlock, LearnedGate
from model_angelo.gnn.backbone_frame_net import BackboneFrameNet
from model_angelo.gnn.cryo_attention import CryoAttention
from model... |
8d5523404dc01757c1ccc748a486d37a7abc0711b9fa4be77470909c3f0b6638 | Python | 8,817 | 157 | from DeepPurpose import utils, dataset
from DeepPurpose import DTI as models
import warnings
import itertools
import numpy as np
import pandas as pd
import wandb
from tqdm import tqdm
import sys
warnings.filterwarnings("ignore")
import random
import argparse
def main(num_samples, val_setting, cuda_id, num_workers, da... |
2ef22dd59dd37ce21edcd2656a84000b853cfe2be1620e558f96279195c06234 | Python | 8,818 | 294 | import click
import procspec
from corgie import scheduling, argparsers, helpers
from corgie.log import logger as corgie_logger
from corgie.layers import get_layer_types, DEFAULT_LAYER_TYPE, str_to_layer_type
from corgie.boundingcube import get_bcube_from_coords
from corgie.argparsers import (
LAYER_HELP_STR,
... |
57e11e053447f67ffa5b0fc0eea648670f2174dd8a4d9614d14688650e612881 | Python | 8,822 | 257 | import os
import csv
import codecs
import numpy as np
import networkx as nx
import pickle
import torch
from rdkit import Chem
from typing import List, Tuple, Union
from torch_geometric.utils import from_networkx, tree_decomposition
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--ori_da... |
0e26cc8c701a034e37318b0500969623d6b438e429ff0f0671dba7833efe6155 | Python | 8,825 | 156 | from DeepPurpose import utils, dataset
from DeepPurpose import DTI as models
import warnings
import itertools
import numpy as np
import pandas as pd
import wandb
from tqdm import tqdm
import sys
warnings.filterwarnings("ignore")
import random
import argparse
def main(num_samples, val_setting, cuda_id, num_workers, da... |
caf83c0fc3b4bd502d1ec0f282eef8e75d8953ba1a36bb0a7e50ffce6636e4cd | Python | 8,825 | 244 | import os
import sys
import warnings
import numpy as np
import torch
import tqdm
from loguru import logger
from model_angelo.data.generate_complete_prot_files import get_lm_embeddings_for_protein
from model_angelo.gnn.flood_fill import final_results_to_cif
from model_angelo.utils.fasta_utils import fasta_to_unified_s... |
ab5ec0bbd7e745a81b441f50f7f3912e4a6b648ee129b7d00da4425a14a2376e | Python | 8,831 | 239 | r"""Wrapped Gaussian Process.
Lead author: Arthur Pignet
Extension of Gaussian Processes to Riemannian Manifolds,
introduced in [MF2018]_.
References
----------
.. [MF2018] Mallasto, A. and Feragen, A.
“Wrapped gaussian process regression on riemannian manifolds.”
IEEE/CVF Conference on Computer Vision and P... |
c052ee72e0fd244d7d7607b96c6615a0352b1267a0c9d2360cad2c63730704b6 | Python | 8,833 | 216 | # -*- coding: utf-8 -*-
import unittest
from io import StringIO
from unittest.mock import patch
import json
import odl
from odl.solvers.util.callback import CallbackApply, CallbackStore
from odl.operator.default_ops import ScalingOperator
from dival.reconstructors.reconstructor import (Reconstructor,
... |
db3b5417ddd7fcc55ae3c92329a3d54f92e8abb87a84b338fa8411a8b8ba3385 | Python | 8,835 | 314 | """
Module to generate features using SMILE descriptors
Author: Son Gyo Jung
Email: sgj13@cam.ac.uk
"""
import numpy as np
import pandas as pd
from pathlib import Path
import joblib
import os
import re
import logging
import deepchem as dc
from rdkit import Chem, DataStructs
from rdkit.Chem import DataStructs
from ... |
91eb86da0ff6685df45992477543af67ebd0f19148f3ed277be543e24dc9dbbc | Python | 8,836 | 163 | from rdkit import Chem
import numpy as np
from dig.ggraph.utils import check_chemical_validity, qed, calculate_min_plogp, reward_target_molecule_similarity
class RandGenEvaluator:
r"""
Evaluator for random generation task. Metric is validity ratio, uniqueness ratio, and novelty ratio (all represented in perc... |
50f3a5af9035ea6d464ecabd1ea8e3a401fd5cb3c9950d7e6c260a821c7f1be3 | Python | 8,840 | 231 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
import numpy as np
from fairseq.data.audio.speech_to_text_dataset import S2TDataConfig
class SpeechGenerator(object):
def ... |
aed9e8ad229386f79cef554f8817addd59d13e9ad352185e8530491fd5e04205 | Python | 8,840 | 281 | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... |
78d961a9085b2042eaee0f9c47a3af3a48d1d67471442f9783d359e637015491 | Python | 8,841 | 156 | from DeepPurpose import utils, dataset
from DeepPurpose import DTI as models
import warnings
import itertools
import numpy as np
import pandas as pd
import wandb
from tqdm import tqdm
import sys
warnings.filterwarnings("ignore")
import random
import argparse
def main(num_samples, val_setting, cuda_id, num_workers, da... |
ea413f3ba44d626cd3e5a3012a468df0748e140acdb3e925b5292ba51d9bf37a | Python | 8,843 | 269 | # Copyright 2020-2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Straggler handling module."""
import threading
import time
from abc import ABC, abstractmethod
from logging import getLogger
from typing import Callable
import numpy as np
logger = getLogger(__name__)
class StragglerPolicy(ABC):
... |
67f1f2327c56f004c3c0112cf7401263909965288e81825f4d05a8de01da7495 | Python | 8,852 | 270 | # -*- coding: utf-8 -*-
"""
multi_analysis class
Created on Jun 29 2023
@author: Mohammad Torabi
"""
from copy import deepcopy
import numpy as np
from joblib import Parallel, delayed
from .dfc_methods import *
from .dfc_utils import common_subj_lst, get_subj_ts_dict
############################# MultiAnalysis clas... |
8800779673a69ff3536988d8f7984b7847a26ee77e85bd00772ccf235b20dec7 | Python | 8,854 | 156 | from DeepPurpose import utils, dataset
from DeepPurpose import DTI as models
import warnings
import itertools
import numpy as np
import pandas as pd
import wandb
from tqdm import tqdm
import sys
warnings.filterwarnings("ignore")
import random
import argparse
def main(num_samples, val_setting, cuda_id, num_workers, da... |
e7c29e22578e9766ff63f517941ffadb2d6b105436476590717b560d81952382 | Python | 8,856 | 228 | # -*- coding: utf-8 -*-
"""
Created on Fri Nov 26 19:01:25 2021
@author: User
"""
import numpy as np
import pickle
import time as t
from aux_fun import remove_SPH, construct_target_A, construct_target_B, construct_target_C, class_balancing, standardization, select_features, classifier, performance
def main... |
38b0cfe0b6a61bd320a5137c371c7001f782ba3ba3391ac80a3a651da1833dfe | Python | 8,862 | 281 | import copy
import itertools
import networkx as nx
from rdkit import Chem, DataStructs
from rdkit.Chem import AllChem, rdMolDescriptors
from rdkit.Chem.Descriptors import MolLogP, qed
from rdkit.Chem.FilterCatalog import FilterCatalogParams, FilterCatalog
from .sascorer import calculateScore
def convert_radical_elect... |
f89c67c4d5a0338ba7514dce69f5395dab9f1366e5116559bdd195fb76c74116 | Python | 8,864 | 252 | # Matrix operations
import numpy as np
# Loading data
import flammkuchen as fl
# from keras.utils import Sequence
from tensorflow.keras.utils import Sequence
# Image manipulation
import cv2
# Image augmentations
import albumentations as A
# Shuffling images
import random
class DataGeneratorStream(Sequence):
def __... |
2ac0ce630263b40769c55d618e5b24f59c11f54a137da3d31fa7d75f9039f392 | Python | 8,865 | 260 | import os
import copy
import yaml
import argparse
import ray
import utils as u
logger = u.getLogger(__name__)
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument(
'-c',
'--experiment_config',
required=True,
type=str,
help='Format: exper... |
159302542ac72001f594ee60acd93342e7493b53f4093d66acb1571799cb93b8 | Python | 8,872 | 258 | import os, sys
import h5py
import torch
import torch_geometric
from torch_geometric.data import Data, InMemoryDataset
from tqdm import tqdm
from torch_geometric.nn import global_mean_pool, global_max_pool
import torch.nn.functional as F
from torch_geometric.nn import SAGEConv, GENConv, GraphConv, JumpingKnowled... |
9536d2a6003e459e1ac960f87b7610a5bc63ef5ff1f96b8339ead158b61ea2d6 | Python | 8,872 | 255 | """
ModelAngelo evaluate model
Compare a predicted model with a ground truth model. You need:
1) A predicted mmCIF file, passed to --predicted-structure/--p/-p
2) A target mmCIF file, passed to --target-structure/--t/-t
"""
import numpy as np
import os
import pickle
import torch
from Bio.SVDSuperimposer import SVDSuper... |
f6d6d74b73bcbbcc9677ed3a332cc29e2b3d52edf224de24984f85dc233c5e61 | Python | 8,873 | 177 | import io
import numpy as np
import pandas as pd
from asgiref.sync import async_to_sync
from channels.layers import get_channel_layer
from django_rq import job
from uniprotparser.betaparser import UniprotSequence, UniprotParser
import requests as req
from celsus.models import Curtain
@job("default")
def compare_sess... |
cbf22cfaf6c2de5f9f6d93ead63e97520b92289f2cb0fe3225e63ba762bb89b5 | Python | 8,881 | 305 | """Module exposing the `ComplexMatrices` class.
Lead author: Yann Cabanes.
"""
import geomstats.backend as gs
import geomstats.errors
from geomstats.geometry.base import ComplexMatrixVectorSpace
from geomstats.geometry.hermitian import HermitianMetric
from geomstats.geometry.matrices import Matrices
from geomstats.ve... |
404df3d359354746b3dd27aae58e33737bf64d19b7685389b197d23a7ff9d81b | Python | 8,883 | 284 | # Copyright 2020-2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Utilities module."""
import hashlib
import ipaddress
import logging
import os
import re
import shutil
import stat
from collections.abc import Callable
from functools import partial
from socket import getfqdn
from typing import List, Opt... |
0a68347125e38e6c16391945d28bd75b5627d6146cf0178ac199fa314227d496 | Python | 8,885 | 246 | import matplotlib.pyplot as plt
from neuron import h, load_mechanisms
from neuron.units import ms, mV
import subprocess
import numpy as np
import os
import sys
from nest_elephant_tvb.utils import create_logger, _make_plot
import time
load_mechanisms(os.path.dirname(__file__)+'/../../neuron_test/detector/')
# initialis... |
317b3a95e5eb6811f54ca44e20dcd17ee05bd64d1bd3cd65c9467e6ddffd626f | Python | 8,886 | 220 | '''
Demonstration of simultaneous analog input and output
pynidaqmx.mixed.basicAOandAI.py
Description:
This example demonstrates how to continuously run data acquisition (AI)
and signal generation (AO) at the same time and have the tasks synchronized
with one another. Note that a single DAQmx task can supp... |
6dcd069a4b356ec9deca8644d275300abe5367175cf60d458733aa34c4ce3850 | Python | 8,894 | 278 | import random
import pytest
import geomstats.backend as gs
from geomstats.geometry.invariant_metric import (
BiInvariantMetric,
_InvariantMetricMatrix,
_InvariantMetricVector,
)
from geomstats.geometry.special_euclidean import SpecialEuclidean
from geomstats.geometry.special_orthogonal import SpecialOrtho... |
f9613b8413087f1ecba518e4a70d14d23a54fa65d56368ead9df3c399d8480cb | Python | 8,899 | 210 | """
This is the data preprocessing that should return
the .pt with the data to run the model
TO BE EXECUTED FROM MAIN FOLDER (relative paths)
This code is for generating the especial datasets
this is, datasets but leaving out positive data in both datasets
"""
import os
import pandas as pd
from scipy.sparse imp... |
a0dd5c0a23b9e0fce839bf233ab61f3bb8125bab823567529e62c690926ca7f9 | Python | 8,900 | 249 | import os
import tensorflow as tf
tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR)
import torch
from torchvision.models import (
resnet18,
resnet50,
alexnet,
vgg16,
squeezenet1_0,
)
from candidate_models.base_models.unsupervised_vvs import ModelBuilder
from model_tools.activations.py... |
b60c1a75db711dfa714fcc0cf9284e2356317bc45a0f3a7c3b8f488087e65e02 | Python | 8,901 | 247 | "A simple module to inspect contrastive clusters after tracking, see :ref:`cluster inspection`."
import argparse
import logging
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import torch
from matplotlib.axes import Axes
from scipy.spatial.distance import cdist
from sklearn.manifold impor... |
023e8f2a9a27ad9426453ed173345ce069c01d4ef7d2f1daf9fdac1f950b3eaa | Python | 8,902 | 230 | """Multiple comparison corrections and thresholding."""
import numpy as np
def fdr(p, q=0.05):
"""Determine an FDR threshold for an array of p-values.
Benjamini-Hochberg procedure at false discovery rate `q` (valid under
independence or positive dependence). Written by Tal Yarkoni.
Args:
p ... |
f55ef1244b9dd97166bfa106e644458001158aaca23f9ec596070b38e974496a | Python | 8,902 | 279 | import argparse
import gc
import gcsfs
import nibabel as nib
import nilearn
import nobrainer
import numpy as np
import os
import os.path as op
import pandas as pd
import tensorflow as tf
def interpolate_images(baseline, image, alphas):
alphas_x = alphas[:, tf.newaxis, tf.newaxis, tf.newaxis, tf.newaxis]
basel... |
e7bb4ca8a96798a6abf67f02862d0f7478c8740ba990b090a8f993f6232365e7 | Python | 8,903 | 278 | import math
import geomstats.backend as gs
from geomstats.test.data import TestData
from .base import MatrixVectorSpaceTestData
from .riemannian_metric import RiemannianMetricTestData
class MatrixOperationsTestData(TestData):
def equal_vec_test_data(self):
return self.generate_vec_data()
def equal_... |
5aeaaa5170da0c21b5d4ea0e39043443eba0d4714c76068882f98c6fccc4e6d5 | Python | 8,904 | 280 | # -*- coding: utf-8 -*-
#
# PyCircStat documentation build configuration file, created by
# sphinx-quickstart on Tue Sep 23 13:08:52 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
... |
ba2f11777c7e173c576109e97b1d1bb04a3775b2d6ef219cdf20ea56a02955da | Python | 8,913 | 283 | import pytest
import geomstats.backend as gs
from geomstats.test.data import TestData
from .base import LevelSetTestData
from .manifold import ManifoldTestData
from .riemannian_metric import RiemannianMetricTestData
class HypersphereCoordsTransformTestData(TestData):
def intrinsic_to_extrinsic_coords_vec_test_d... |
602c70fba53c250a90086ede9dc0056d75b4d313ebd4eda92770282c6090df77 | Python | 8,914 | 236 |
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import ppafm.ml.AuxMap as aux
import ppafm.ocl.field as FFcl
import ppafm.ocl.oclUtils as oclu
import ppafm.ocl.relax as oclr
import torch
from matplotlib import cm
from ppafm.ml.Generator import InverseAFMtrainer
from ppafm.ocl.AFMulator imp... |
13482882b1ac9dd29e980ca4a81a3e8d6f72b303802e0f58f2e36336ef251ddb | Python | 8,917 | 264 | import torch
import torch.nn as nn
import torch.nn.functional as F
from segmentation_models_pytorch.base import modules as md
from segmentation_models_pytorch.encoders import get_encoder
import torch
import torch.nn as nn
import torch.nn.functional as F
from segmentation_models_pytorch.base import modules as md
cla... |
b5a1caf24edee1a45cbcf5264693fc6aa6abd5a5ec7d402370bfaecb9a979f28 | Python | 8,917 | 246 | """
Motor imagery training
Kyuhwa Lee, 2015
Swiss Federal Institute of Technology (EPFL)
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 lat... |
f6542ad01ce77f6ae892981df339f1ed35e64aefa6180134cbeb9a3f87964b46 | Python | 8,921 | 247 | import torch
import torch.utils.data as tud
class Node:
def __init__(self, model, x, vocabulary, device, data_device="cpu", batch_size=64):
"""
Initialize a Node used for autoregression
predictions, such as greedy search, multinomial
sampling, or beam search
Parameters:
... |
2be925879c739e17528be349e3ca24fa1c8a91929c9b8a345deb9c53eee7f36e | Python | 8,922 | 166 | import jax.numpy as jnp
import haiku as hk
from deeperwin.configuration import TransformerConfig, MLPConfig, EmbeddingConfigTransformer, EmbeddingConfigAxialTranformer
from deeperwin.model.attention import Attention
from deeperwin.model.mlp import MLP
from deeperwin.model.definitions import Embeddings, InputFeatures
... |
25f1571aa2a4ee89bd866a1bc095928a640d34322827952cab8a2bcf137e156c | Python | 8,936 | 259 | """Tests for nltools.templates — brain-space configuration and helpers."""
import os
import nibabel as nib
import numpy as np
import pytest
from nltools.templates import (
BrainSpaceConfig,
_get_bg_image,
get_brainspace,
reset_brainspace,
_resolve_template_name,
set_brainspace,
with_brain... |
2b81832cd3b241831d3ba1a8a672fd051ebf9cce7bee58adbdba4d7feb319560 | Python | 8,938 | 273 | # Copyright (C) 2020-2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from openfl.experimental.workflow.interface import FLSpec, Aggregator, Collaborator
from openfl.experimental.workflow.runtime import LocalRuntime
from openfl.experimental.workflow.placement import aggregator, collaborator
import sys
imp... |
bac0268975dd126af6af33eb11295eed6452fd84b2a6253f4b712eb336c65219 | Python | 8,941 | 274 | """
Implementation of dFC methods.
Created on Jun 29 2023
@author: Mohammad Torabi
"""
import time
import numpy as np
from joblib import Parallel, delayed
from ..dfc import DFC
from ..time_series import TIME_SERIES
from .base_dfc_method import BaseDFCMethod
################################# Time-Frequency ########... |
f909e6a2c09a23c9be8c1050ef91b562e49cb7ee3311df4ffb1a1a88f86c43d9 | Python | 8,945 | 247 | #
# For licensing see accompanying LICENSE file.
# Copyright (C) 2022 Apple Inc. All Rights Reserved.
#
import math
from typing import Dict
import argparse
import torch
from torchvision.transforms import functional as F
from torch.nn import functional as F_torch
from utils import logger
from . import register_transf... |
0c38e5686e0e5cf9964232040cb6793e841543cc3d67bae5ac9627aac1c8f631 | Python | 8,949 | 280 | """
Module to reduce multicollinearity within a dataset
Author: Son Gyo Jung
Email: sgj13@cam.ac.uk
"""
import os
import pandas as pd
impor... |
47351dfac2ed196a37363abc89fcd23aa62adcb0007bd603d03ba252140bf6a8 | Python | 8,950 | 306 | import random
import pytest
import geomstats.backend as gs
from geomstats.geometry.positive_lower_triangular_matrices import (
PositiveLowerTriangularMatrices,
)
from geomstats.geometry.scalar_product_metric import ScalarProductMetric
from geomstats.geometry.spd_matrices import (
CholeskyMap,
LieCholeskyM... |
c6389d23d8b038e3157a5834ba3e87236161190966210a69d35e6d5d6b50141b | Python | 8,950 | 234 | import argparse
import json
import os
import sys
import matplotlib.pyplot as plt
import numpy as np
from pydfc.ml_utils import find_available_subjects, load_task_data
from pydfc.task_utils import extract_task_presence
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from helper_functions import ( # pyrig... |
dbaf1c71efcbb14996c9362ac184c5f8e51aa113329a6070f6124cdd6a5f1291 | Python | 8,954 | 212 | """Compute the scores and the transformed scores"""
__all__ = ["compute_transform"]
from typing import List, Tuple, Callable, Optional
import logging
import numpy as np
from reinvent_plugins.components.component_results import (
ComponentResults,
SmilesAssociatedComponentResults,
)
from .results import Tran... |
775e683678513dec55944e3c298224dcd4135ed11e3372f37942e481161d52b2 | Python | 8,959 | 280 | import os
import re
import numpy as np
def parse_raw_xmf(xmfpath):
"""
Returns shape and path to `.raw` file
xmfpath: path to `.xmf` metadata file
"""
with open(xmfpath) as fin:
text = "".join(fin.read().split("\n"))
# Extract RAW path and shape.
m = re.findall(
r"<Xdmf.*<... |
2fcebbb48ae804e4d6a023538bcc2145db5502c61cf92583f03d3151cb19c52d | Python | 8,960 | 222 | """Tests for ``BrainData.iplot()`` — the self-owned niivue `anywidget` viewer.
Headless: we assert only Python-set widget *traits* — which volume byte
buffers are populated (``bg_bytes`` / ``statmap_bytes`` / ``atlas_bytes``), the
stat-map display params (``statmap`` dict + ``cal_min`` / ``cal_max``),
``slice_type``, ... |
9c6cf19377e57262e4f2bafc63150a8472160e95ba994695c5f67a2ad0ad6ae6 | Python | 8,960 | 276 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
from fairseq import utils
from fairseq.data import (
AppendTokenDataset,
DenoisingDataset,
Dictionary,
... |
670e6521bef2d4faaa38c6491c54d7df539a677e14d82b5c5f5608a13b124773 | Python | 8,963 | 241 | import sys
import json
import os
import time
import six
import argparse
import glob
import re
import h5py
import modelhouse
import numpy as np
import torch
import torchfields
from metroem import helpers
import torch.multiprocessing as mp
from torch.nn.parallel import DistributedDataParallel as DDP
import torch.distr... |
7cc9e20afbe3f085425a97b33fc85a9fc06026f230ccd451cb87df9b649ae416 | Python | 8,964 | 297 | # copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
2703ba81f35f355279412586a27e94fd7fd0514c2cea077b933aeeae26c8c8f4 | Python | 8,970 | 242 | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
bf91c4ffeabb69f1f158c140dd9939f7b15c5f24ed93f5c66467a41e15f42cbc | Python | 8,979 | 217 | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
2775407cd97b911b131669f9dbc8e8f7a7e845db2b323e6adba5eb636948a8c4 | Python | 8,981 | 230 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
from dataclasses import dataclass, field
from typing import List, Optional
import torch
import torch.nn.functional as F
from fair... |
59f085011dbb16af6deb737357c42c893ff61d54634d1e3021238ede0f3010bb | Python | 8,988 | 210 | # -*- coding: utf-8 -*-
# /usr/bin/env python3
#
# This software and supporting documentation are distributed by
# Institut Federatif de Recherche 49
# CEA/NeuroSpin, Batiment 145,
# 91191 Gif-sur-Yvette cedex
# France
#
# This software is governed by the CeCILL license version 2 under
# French law... |
9d992c68b1498c936b45e29fe065368fce96b7406d184a4590578e4151525d36 | Python | 8,999 | 209 | # Copyright 2020-2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
import collections
import numpy as np
import logging
from openfl.experimental.workflow.interface import Aggregator, Collaborator
from openfl.experimental.workflow.runtime import LocalRuntime
log = logging.getLogger(__name__)
... |
3fd1d20acd341aa3733df45cd6ff1041b566469b688e6c366bd163009e96bd4d | Python | 9,010 | 292 | import operator as op
import re
from typing import Dict, List, TypeVar, Union, overload
import more_itertools as itx
from typing_extensions import Literal
from snakebids.utils.utils import matches_any
# pylint: disable=invalid-name
T_co = TypeVar("T_co", bound=Union[List[str], str], covariant=True)
@overload
def f... |
31a7056d275c9f5de0bc1512da056159cc95b93c263714b834586e7f7db440cd | Python | 9,012 | 175 | """The new VDJdb format: the definitive tables as they ship, plus the joined convenience view.
Three fact tables and one view, Parquet with gzip TSV projections of normalized tables (`docs/outputs.md` §3):
===================== =========================================================================
``records`` ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.