sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
6c63c5fe44e0e018f1ed30c78fd8a28ca964c81888263d6b6e7d3a6de6e00305
Python
37,770
1,073
# This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed # under the Apache License Version 2.0, see <https://www.apache.org/licenses/> from __future__ import annotations from typing import Callable, Tuple import numpy as np import pytest import torch from torch import Tensor, eye, nn, o...
d6a93a439bf3daf43a992818c2d5e0802ba293884f558df3310f82e3f28ac8b3
Python
37,868
891
"""weights2c.py This file is part of keras2c Copyright 2020 Rory Conlin Licensed under LGPLv3 https://github.com/f0uriest/keras2c Gets weights and other parameters from each layer and writes to C file """ # Imports import numpy as np from keras2c.io_parsing import layer_type, get_layer_io_names, get_model_io_names fr...
24e7630f3352a91b3599449e6d2bd580a0931ac5dde8ca7ee32feb07e231ad2a
Python
37,875
875
import numpy as np import pandas as pd import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec import os from os import path import scipy.stats as st from tqdm.notebook import tqdm from collections import defaultdict import cv2 import imageio import random from eye_tracking.eye_tracking import get_eye...
133e748afcfd6160bb9114c76c78bf882c896ff8409797cdcb9febe4ce64d55a
Python
37,902
991
# This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed # under the Apache License Version 2.0, see <https://www.apache.org/licenses/> import math from typing import Optional, Tuple import torch import torch.nn.functional as F from torch import nn class PositionalEncoder(nn.Module): ...
d66c5b4c039bf90771b1807924615aa9bd9baf9ff4506c6e483c0b73b07e5794
Python
37,941
791
# Copyright (C) 2022-2025 ETH Zurich, Jakob Teetz and other DASH contributors. import os import numpy import pickle try: from typing import Literal except ImportError: from typing_extensions import Literal from typing import Optional from collections import defaultdict from rdkit import Chem from rdkit.Chem ...
5b163b9c34b5029048eee5c605408c2fe7cfce61713bd2045beb5199e6382301
Python
37,977
861
import inspect import logging import math import re from collections.abc import Callable import numpy as np import omegaconf import torch from ignite import distributed as idist from ignite.engine import Engine, Events from ignite.handlers import ModelCheckpoint, ProgressBar, TerminateOnNan, global_step_from_engine fr...
a4bcbc978a9a8e3c4ce6e2be29c0ea8095ab3174ce8b362674a97598ea6c0a61
Python
38,230
847
""" signal processing functions """ import numpy as np from scipy.signal import butter,filtfilt import h5py from lib.data import * def butter_lowpass_filter(data, cutoff, fs, order): nyq = 0.5 * fs normal_cutoff = cutoff / nyq # Get the filter coefficients b, a = butter(order, normal_cutoff, btype='low...
9dfe218cb52eb5168f6360361a74ad19e3fb6a6d6f35a50bef2e444bdb9c85c0
Python
38,614
785
"""Interfaces for SHIVA project deep learning segmentation and prediction tools.""" import os import glob import shlex import json from shivai.utils.misc import md5 from nipype.interfaces.base import (traits, TraitedSpec, BaseInterfaceInputSpec, ...
adacf09fbfd5016cc10e0bd13c2a4a505f3ff6707d24333076cdb45c1d994fef
Python
38,736
839
# This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed # under the Apache License Version 2.0, see <https://www.apache.org/licenses/> import math import warnings from typing import Dict, Literal, Optional, Union import torch from torch import Tensor from torch.distributions import Distr...
02c1db285a96817415f2cd491a08fa92871585aadd54eb0599a5557ca0032799
Python
38,749
976
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Sep 6 14:19:20 2021 @author: baris """ from neural_coding import load_spikes, rate_n_phase from perceptron import run_perceptron import numpy as np import matplotlib.pyplot as plt import pandas as pd import seaborn as sns from sklearn import decompo...
733f871d844779a316ad1d743a96f2b8088bc5a8c465f250cbeba5277bf277da
Python
38,781
1,054
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: MIT # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without res...
ae9e243041338bbc8f73d144aa9047a194dbfad2dd43c9cd2277b0758a3a2114
Python
38,873
677
#!usr/bin/env python #coding:utf-8 """ @author: Haidong Zhang @contact: haidong_zhang14@yahoo.com @time: 2021/1/9 15:28 @project: MalariaDetection @description: """ from keras.layers import * #For adding convolutional layer from keras.layers import Dense, ZeroPadding2D, BatchNormalization, Activation ...
e2a30fab4ac6f306d95a35ef6a27c1fdadf8b48e35a93be1b5789922f2f1d59e
Python
38,906
677
#!usr/bin/env python #coding:utf-8 """ @author: Haidong Zhang @contact: haidong_zhang14@yahoo.com @time: 2021/1/9 15:28 @project: MalariaDetection @description: """ from keras.layers import * #For adding convolutional layer from keras.layers import Dense, ZeroPadding2D, BatchNormalization, Activation ...
04c9d522b7c8a60a6ba40ac043ab7cfae4a95158585fef76c6b0cd699db1e43a
Python
38,908
1,041
import sys import os import math import p4.func from p4.var import var from p4.tree import Tree from p4.p4exceptions import P4Error class Trees(object): """A bunch of trees, all with the same taxNames. This class would be good for doing things that you might want to do with a bunch of trees rather than ...
34816c970e7f2bff66119af16f9655769582e89d0ce125cc24afc8daa30bd568
Python
39,065
941
import glob import math import os import random import shutil import time from pathlib import Path from threading import Thread import cv2 import numpy as np import torch from PIL import Image, ExifTags from torch.utils.data import Dataset from tqdm import tqdm from utils.general import xyxy2xywh, xywh2xyxy, torch_di...
73d520c3f25b784a1518d24fbf2d87da3aee8e8a46de10318b1820bfcd0bbb77
Python
39,177
976
"""GPU-specific tests for AIMNet2 calculator. All tests in this module require CUDA and are marked with @pytest.mark.gpu. Run with: pytest -m gpu """ import warnings import pytest import torch from conftest import CAFFEINE_FILE, CIF_SPIRO, TAXOL_FILE, load_mol from aimnet.calculators import AIMNet2Calculator from a...
930c6624d3adba5d582e3517895e66ae6fcd09eb9cd775261af1b9d8fcc20267
Python
39,180
940
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from pathlib import Path import matplotlib.pyplot as plt import matplotlib.cm as cm import numpy as np import pandas as pd from scipy.stats import spearmanr from scipy.stats import rankdata import seaborn as sns from sklearn.decomposition import PCA from sklearn.preproces...
8e55fbd1726f1588488b1cd133980b539b4605b94686bbc6d8315b70262aba87
Python
39,275
1,062
import logging import os import re import json import nibabel as nib from nibabel.filebasedimages import ImageFileError import numpy as np import pandas as pd import sys from subprocess import run import datetime import zipfile import matplotlib.pyplot as plt import abc from datetime import time from nilearn.plotting i...
4a41ba600b48b1c628b7c21872629080e5c35cd77ff7791d72a4e135e1b33308
Python
39,353
733
#!/usr/bin/python import os import sys import numpy as np import pandas as pd import argparse from sklearn.metrics import mean_squared_error, r2_score from sklearn.preprocessing import MinMaxScaler import optuna from optuna.samplers import TPESampler import joblib import random import wandb random.seed(4) #import te...
d10741776ec42388eb1e44c1c943ffa955910c351d56728c2cb372c3026026d5
Python
39,368
678
''' File with configurations to run MLpipeline() class from MLpipeline.py on the IMAGEN data. This configuration was used for Evert's thesis' experiments and serves as an example for how to configure the MLpipeline class and run it. ''' import os, sys from glob import glob from os.path import join, isfile import numpy...
8706c510c22081d91ce2997f81dcd680e6e4481450f8f19dba5469ecc8cdd902
Python
39,409
1,382
#!/usr/bin/python # -*- coding: UTF-8 -*- from __future__ import absolute_import from __future__ import with_statement from __future__ import division from __future__ import nested_scopes from __future__ import generators from __future__ import unicode_literals from __future__ import print_function """ ``util.py``: Mi...
1a1c376069a5a9c09c41acca75da95a1860a3d1584891c7e51df35fd97cd07d4
Python
39,707
844
# Copyright (c) OpenMMLab. All rights reserved. import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import Conv2d, Linear, build_activation_layer from mmcv.cnn.bricks.transformer import FFN, build_positional_encoding from mmcv.runner import force_fp32 from mmdet.core import (bbox_cxcywh_to...
871d4678fb7ddb7c74203dc8f4f83b85fdfc038ec4a64109df90d98ec66eaf1e
Python
39,777
1,015
from Bio.Align import MultipleSeqAlignment from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord import numpy as np import math from itertools import chain from typing import Union from Bio.Phylo.BaseTree import Tree from .ambiguity import ( ambiguity_map, ambiguity_symbols, is_nucleotide_alphabet, ...
83a2db7cb82dc4d762b57a27b61cd4b53110d837a6fab3ddbd3bfa53c200d95a
Python
39,803
815
# coding=utf-8 # Copyright 2018 The Open AI Team Authors and The HuggingFace Inc. team. # # 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 # # ...
b2deec69633a0b4202dc699345286b712c271cbc3a71b40951b09d3eb6e57912
Python
39,822
1,052
import utils from os.path import join, isfile, split, splitext from os import listdir import logging import study_analyzer import sqldbutils as db import json import random import re import ann_post_rules import multiprocessing from analysis.semquery import SemEHRES class BasicAnn(object): """ a simple NLP (N...
36caaa9f6e4998c5ae7586f896942cf098e55afe3670e31a2f1a26bcc25f1a77
Python
39,934
921
import math import random from functools import partial from typing import Callable, Dict, List, Optional, Tuple, Union import numpy as np import torch from Bio.Align import MultipleSeqAlignment from torch.distributions import Categorical, Distribution from selbstaufsicht.utils import lehmer_encode # TODO task sched...
441d1cae82faa6f64d8a40f8183b410d5ae071b76b0776cf838dc16cba960d32
Python
39,961
993
# Copyright (C) 2023-2025 ETH Zurich, Marc Lehner and other DASH contributors. import gzip import io import os import pickle from collections import defaultdict from enum import Enum, auto from pathlib import Path import numpy as np import pandas as pd from PIL import Image from rdkit import Chem from rdkit.Chem impo...
56c40aaea3a777f3ef02d9b140f4e35fd191553add594ab14171c92585b193e4
Python
39,980
971
# libraries import argparse import sys import os os.environ['QT_QPA_PLATFORM']='offscreen' import re import numpy as np import pandas as pd pd.options.mode.chained_assignment = None # change from default "warn" import ete3 import logging # argument parser arp = argparse.ArgumentParser() # Add the arguments to the pa...
6b52395859c2ca079aa79d569763234788034de5b1ade657521ba59f4167faaa
Python
40,241
1,071
# Copyright (c) OpenMMLab. All rights reserved. from abc import ABCMeta, abstractmethod import cv2 import mmcv import numpy as np import pycocotools.mask as maskUtils import torch from mmcv.ops.roi_align import roi_align class BaseInstanceMasks(metaclass=ABCMeta): """Base class for instance masks.""" @abstr...
fb668cd07e73379897a58bc36a4fd49b496441082215e07bf6306a192c23323c
Python
40,437
780
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. 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 cop...
e8c7e0c2a53ade0d7687f6b33ac95c6c0e3c66d036595558a7f01a50afac14c9
Python
40,550
894
# -*- coding: utf-8 -*- """ Created on Sun Jul 25 23:58:42 2021 @author: fhu14 Methods for plotting SKF files for a directory of SKFs We are generally more interested in the functional form of the functions than the values attained. For this reason, the x-axis is plotted with more granular information than the y-ax...
7190cdafd85cc1caaf145e29db4e0670f61d06a477c07ae50458bc06987305d2
Python
40,732
713
import copy import copy import json import logging import pickle import numpy as np import torch import torch.nn.functional as F import torch.utils.data as data import torchvision from torch.autograd import Variable from torchvision import datasets, transforms from .datasets import MNIST_truncated, EMNIST_truncated, ...
afd9e3cee6b6fb12c2f5721c72c32126573190564140a6dc088e874380306ea5
Python
40,752
812
import pandas as pd from A_config import a10_config import os import sys import glob import calendar import numpy as np import seaborn as sns import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec from mpl_toolkits.axes_grid1 import make_axes_locatable import skill_metrics as sm from matplotlib.patche...
dfdd52fc88a53c4f888649e15d8a724a5a3dcdd17343e2147d4212f93b942afa
Python
41,155
1,041
from __future__ import annotations import os import re from typing import ItemsView, KeysView, ValuesView, Iterable, Tuple, Union, Dict import numpy as np import pandas as pd from numpy.polynomial import Polynomial from scipy.interpolate import PPoly, interp1d, CubicSpline, InterpolatedUnivariateSpline from .consts ...
a87464e35f30d2045fd71e2cd31b25dd7ae60ca2b9061578e20df5a5d682833a
Python
41,640
921
# -*- coding: utf-8 -*- """ Created on Mon Dec 28 13:40:17 2020 @author: Frank Module for writing skf files, which are basically text files that adhere to a specific format as described in the slater-koster file format document Right now, the writer only handles simple format since we are not doing angular momenta u...
7c8e32e901443a9ada0863abeff6b1d0279279cab3d2abe40bdf1bd58a49e0f6
Python
41,659
1,158
# This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed # under the Apache License Version 2.0, see <https://www.apache.org/licenses/> from __future__ import annotations import io import warnings from dataclasses import asdict from typing import Tuple, Union import pytest import torch i...
faf785d868e0f758a27cc621c238a762e1c870328ac104e178d8c7f9db9b9159
Python
41,786
955
''' * Copyright (c) 2022, salesforce.com, inc. * All rights reserved. * SPDX-License-Identifier: BSD-3-Clause * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause * By Junnan Li * Based on huggingface code base * https://github.com/huggingface/transformer...
2bce58a565ce88507105903d03400996e143ad5b1d4574cf5c900808c214534f
Python
41,878
1,056
import itk import numpy as np import random import typing import re import json import pickle from pathlib import Path import os from glob import glob import matplotlib.pyplot as plt import pkgutil from usqc.util import overlay, get_iterator_setup, add_to_group from usqc.data import get_files ''' Label-to-pixel value ...
8967700d45fb0045dba439a67bd57eac740edada8a91d9b6117bfbe7dbbdbf71
Python
42,416
857
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Feb 8 18:19:17 2021 @author: yaron (Frank): Made some changes to add_dftb and load_ani1 (documentation and path fixing) TODO: More options in the code to eventually handle non-zero Fermi temperatures. Analysis pipeline: 1) get test dataset ...
730f237fe2e899a6da0df6a042ce7fb1ae04d02edfa5d1c128f782f050e1276f
Python
42,550
961
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Nov 17 12:55:20 2021 @author: baris """ from neural_coding import load_spikes, rate_n_phase import numpy as np import matplotlib.pyplot as plt import pandas as pd import seaborn as sns import pickle from scipy.stats import pearsonr, spearmanr import c...
9bdc263649ceca08fae1c979552e20a148f2f732aa5a6f1b7d6191787b7d4596
Python
42,593
1,104
import os import numpy as np import tensorflow as tf import tensorflow.experimental.numpy as tnp import random from lib.commons import * import threading, queue import concurrent.futures import multiprocessing import urllib.request import time import random import itertools import math import tqdm import nibabel as...
a6629a9dc8515b596ad21b41bbc0e21f20673fe8c1f13d7f75f8114a1a8866a8
Python
42,614
1,231
# Copyright (C) 2013 Oskar Maier # # 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 program is distributed in th...
3e4cfde69bdc6ece5acce3dc284b332bfc13f32c8cea100ced62c973b76264f4
Python
42,669
1,180
# This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed # under the Apache License Version 2.0, see <https://www.apache.org/licenses/> from __future__ import annotations import warnings from copy import deepcopy from dataclasses import asdict import numpy as np import pytest import torc...
5eda037b0aa46e181eb0d701ad63058c2c05562abbd3726f9e48db2d5d06f4fe
Python
42,673
929
__author__ = "Grzegorz Chojnowski" __date__ = "26 May 2021" import os,sys,re from shutil import which import subprocess from scipy.special import erf,erfc from scipy import stats import numpy as np import gzip import math import tempfile sys.path.insert(2, '..') try: from doubleHelixLib import cmatch_rna as ...
566d8bad54d9f0a85bbadc21c1edbe27026061500f9512f341657aced8ec7edb
Python
42,682
1,096
import sys import os import gzip import argparse import numpy as np from itertools import product, groupby import pysam import util import snptable import tables MAX_SEQS_DEFAULT = 64 MAX_SNPS_DEFAULT = 6 class DataFiles(object): """Object to hold names and filehandles for all input / output datafiles"""...
130748b89e746565a61ccf60603a998c7c3ca2c6c26d8647726b83cce8213b5b
Python
42,897
907
import PySimpleGUI as sg import numpy as np import sys from Analysis_types.Whole_recording import extract_event_data_from_cols from Post_processing.FED3_post_processing import FED3_post_processing from Post_processing.Peri_events_post_processing import Peri_events_post_processing from Statistics.Statistics_GUI im...
5b3173bc990c6b7e02d394b15d7b73c3cf23ee33a9794d379ecda2fdbf32a0fb
Python
43,076
1,117
# This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed # under the Apache License Version 2.0, see <https://www.apache.org/licenses/> import math import warnings from typing import Callable, Literal, Optional, Union import torch from torch import Tensor, nn from sbi.neural_nets.estimat...
97902f6555d48a60501429c294a901b6fba94f5d062c3d9b973782c1eb4eb570
Python
43,375
998
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Feb 23 12:29:15 2022 @author: baris """ import pickle import numpy as np # import seaborn as sns import pandas as pd from phase_to_rate import grid_model from phase_to_rate.figure_functions import (_make_cmap, _precession_spikes, ...
f0977c8a0424d66008f0cba698d7057bb1cbda70439f89592688410650c03ca6
Python
43,474
1,018
# Copyright (c) OpenMMLab. All rights reserved. import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import ConvModule from mmcv.runner import BaseModule, ModuleList, force_fp32 from mmdet.core import build_sampler, fast_nms, images_to_levels, multi_apply from mmdet.core....
292a365a07ee4430655f929992e7ab8ccbae8bb59c4a55ccd36ed0971a6e9fc2
Python
43,660
1,283
#!/usr/bin/python # -*- coding: UTF-8 -*- import sys import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from numpy import * from lgcpspatial.util import * import traceback import scipy.linalg from scipy.sparse.linalg import LinearOperator from scipy.sparse.linalg ...
b3ed051cc113ed4fa580f30cd44333b69a7a6f8e0b31a0050246b13099d1e31b
Python
43,686
1,138
import sys import csv import random from p4.tree import Tree from p4.func import read from p4.var import var from p4.p4exceptions import P4Error from p4.reducedstrictconsensus import Intersection, TreeBuilderFromSplits class SuperTreeInputTrees(object): def __init__(self, inputTree, distributionTrees=None): ...
772e2fe3c6b30f1cc03bdfcbb45ccb2ace6dd346930c6f91a347f263e6417c13
Python
43,927
1,248
# Imports # import configparser import numpy as np import pathlib import random import statistics import time import traceback from Classes.Protocol import ImageButton, ProtocolBase, PreloadedVideo from kivy.clock import Clock from kivy.config import Config from kivy.loader import Loader from kivy.uix.button import ...
1ba70959aa50cc0cb115ef3be18cb38fd639a199d83d5a4f3d43af8422096c66
Python
44,103
1,104
import p4.pf as pf import sys import random import math import p4.func from p4.var import var from p4.p4exceptions import P4Error import numpy class BigQAndEig(object): # not used def __init__(self, dim, comp, rMatrix): self.dim = dim self.comp = comp self.rMatrix = rMatrix self....
f58fb51fce6d7d4e85d38996b0c811907ba77fdc00b01472252acf73171b2caa
Python
44,423
459
import argparse import importlib import h5py import numpy as np import os # import plotly.graph_objects as go import torch from datetime import datetime # from plotly.offline import plot from tqdm import tqdm # from utils import MetricTracker # from utils.clean_noise import CleanNoise # from data_loader.general_data...
113b1392061eade8eb2bd3485ab778308edfac9c1e3134697771cef459056251
Python
44,970
1,193
import time from typing import Callable, Tuple, Union import numpy as np import torch from numpy import ndarray from torch import Tensor from .utils import * class DistanceRuleSimulator: """Simulate Peters' rule with the dense structural model. We define new features, e.g., number of common cubes for each ...
162872a0eb620195392bd42029363ad7faa299facf1dc58bda1caa2329833f91
Python
45,129
781
#!usr/bin/env python #coding:utf-8 """ @author: Haidong Zhang @contact: haidong_zhang14@yahoo.com @time: 2021/1/9 15:28 @project: MalariaDetection @description: """ from keras.layers import * #For adding convolutional layer from keras.layers import Dense, ZeroPadding2D, BatchNormalization, Activation ...
72813bff72d4a77f2cbbf17b854efd5c0a3ca50c92a37e47f6bf268dbd65fd3d
Python
45,140
629
# ============================================================================= # Created at: # EMBL Hamburg # Author: # Grzegorz Chojnowski - gchojnowski@gmail.com # ============================================================================= stem_pdb_string_3bps = """\ REMARK 3DNA v2.1 (c) 2012 Dr. Xiang-Jun L...
8974b12c36b1cbd2eba367cf30a4c84e2471e3dbbf73ddb2c78d1900ad416135
Python
45,239
1,393
#!/usr/bin/python # -*- coding: UTF-8 -*- """ Plotting helpers copied from ``neurotools.graphics.plot``, and some new routines to reduce notebook clutter. """ import os import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from numpy import * from matplotlib.pyplot import *...
540c1847f0d4fff08ba70c3e2da29b00e2b4c833c49c968ab44e580e86054799
Python
45,277
1,351
#!/usr/bin/python # -*- coding: UTF-8 -*- """ posterior.py: Subroutines for further analysis of the posterior rate map returned from Gaussian process inference. """ # Load a Matlab-like namespace from numpy import * from scipy.spatial import ConvexHull from numpy.linalg import norm,LinAlgError from lgcpspat...
4b7c08f7d196143a8499a3220864f2efde5ced7165c94a71d5327fdc84ad30f8
Python
45,467
930
""" Utilities relating to genetic codes. date: 25/08/2016 """ import sys import copy import warnings from itertools import combinations, product import operator from Bio.Data import CodonTable from p4.p4exceptions import P4Error def formatwarning(message, category, filename, lineno, line): return "%s:%s: %s:%s" % ...
14b4cbd8ce362552f0b3fb83fde42d45290847550b43860cf079c97c7b1878c8
Python
45,716
1,069
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import numpy.random as npr import copy from functools import partial from contextlib import contextmanager from lib.model_zoo.common.get_model import get_model, register from lib.log_service import print_log version = '0' symbol = 's...
8fb420e52b960efdd7b564753fe69788f65d7ad29c76a914e11228f0522ff348
Python
45,828
866
"""CUDA-graph replay of repeated ``AIMNet2Calculator.eval`` calls. ``AIMNet2Calculator.eval`` asks ``CUDAGraphCache.eval`` first; ``None`` means "not handled" and the regular code path runs unchanged. Handled calls (all of): * CUDA device; closed-shell AIMNet2 model (``d2features``, one charge channel) with the defa...
4567106f70e8afdd68a3ece3cc93abbf9253928ed4fd78c73914d1402a0c1eb7
Python
45,887
709
import torch as th from torch.nn import functional as F import torch.nn as nn import numpy as np from torchdiffeq import odeint from latentvelo.models.velocity_field import VelocityFieldReg from latentvelo.models.modules import create_encoder, create_decoder, MLP, GCN from latentvelo.utils import normalize, sparse_m...
d063c73cb09abc7ae8aca504026c30b46db99d6fd78aa91e2e26c91993d777f9
Python
45,913
1,159
# Copyright (c) OpenMMLab. All rights reserved. import math import warnings 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_conv_layer, build_norm_layer, xavier_init) from mmcv.cnn.bricks.registry i...
84e61d6757b8a55cf410904a2c36cc7299b8b10ee3d9fdfafeb39921f2393538
Python
46,042
1,311
# This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed # under the Apache License Version 2.0, see <https://www.apache.org/licenses/> """Typed dataclass configs for the estimator families. The per-model configs are how a model is picked and configured: one small class per model, holding...
bb631d89a0dc60959edeac43efe05de5fb0af3b3acee21b863097d9819f8140d
Python
46,184
738
# Copyright (c) OpenMMLab. All rights reserved. import itertools import logging import os.path as osp import tempfile import warnings from collections import OrderedDict import numpy as np from mmcv.utils import print_log from terminaltables import AsciiTable from .builder import DATASETS from .coco import CocoDatase...
604315c2ba8618719e1d24feaaaf43ac38296820ec7436c702994d4f95eec023
Python
46,486
1,432
import sys from pathlib import Path import rich_click as click from rich.console import Console from rich.padding import Padding from rich.panel import Panel import genomad from genomad.utils import get_n_available_cpus CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"]) click.rich_click.USE_RICH_MARKUP = Tr...
e11271c316a4368596f9d93724712cb05cd6da0fae6bdfebf653a57a7086fb2e
Python
46,499
1,330
import base64 import gzip import json import lzma import struct import types import zlib from hashlib import sha256 from pathlib import Path import pytest from clipkit.ecomp.reader import ( HEADER_MAGIC, LEGACY_HEADER_STRUCT, METADATA_COMPRESSED_MAGIC, METADATA_CODEC_VERSION, METADATA_SUFFIX, ...
9a146e2dc9101593ae94108778d10ae4d2ce97403d88f3bcd8362d76de2d48a0
Python
46,604
1,022
u""" Module for recoding matrices. date: 25/08/2016 """ import sys import os import subprocess import re import copy import warnings from Bio.Data import CodonTable from p4.alignment import Alignment import p4.func from p4.var import var from p4.p4exceptions import P4Error from p4.func import read from p4.code_utils im...
07b41c6b382b7a046baa8dc203f1300d74cd3dec9aa369c0dbb8ff89ed1e5bc0
Python
46,998
1,016
# Author: Fabi Prezja <faprezja@fairn.fi> # Copyright (C) 2023 Fabi Prezja # License: MIT License (see LICENSE.txt for details) import glob import os import sys import numpy as np import tensorflow as tf from sklearn.utils.class_weight import compute_class_weight from tensorflow.keras.callbacks import EarlyStopping f...
0a9b47acbec1d3e604f42f75dc79dec525c6136ed0c3875fa9b369c28ecc7a51
Python
47,039
1,214
# Copyright (c) OpenMMLab. All rights reserved. import math import random import cv2 import numpy as np from mmpose.core.post_processing import (get_affine_transform, get_warp_matrix, warp_affine_joints) from mmpose.datasets.builder import PIPELINES from .shared_transform impo...
c9954fa41f06764c919f4901c642a2ea84d632069e988a2c448516e8196a1ba7
Python
47,250
1,134
import os import argparse import json from pathlib import Path import tqdm import glob import multiprocessing import multiprocessing.dummy as mp import numpy as np import librosa import pyroomacoustics as pra import soundfile as sf import sep.helpers.utils as utils from sep.helpers.constants import SPEED_OF_SOUND # ...
cd9bdb8f0af453f139f0c71b3624e2b9b64e6c06cc6b4fac9e2c3df1f1310c30
Python
47,265
1,177
# Copyright (c) OpenMMLab. All rights reserved. import mmcv import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import ConvModule from mmdet.core import InstanceData, mask_matrix_nms, multi_apply from mmdet.core.utils import center_of_mass, generate_coordinate from mmdet...
7c8d5b554f59828313a5e9dbe1cfe3e2c4a67ea25c6025a257cb5b59660005d9
Python
47,403
1,062
import numpy as np import pandas as pd import math import seaborn as sns import matplotlib.pyplot as plt from scipy.stats import linregress import traceback import shelve import pyabf from utils.calcium_traces import get_pos_y, get_pos_x from utils.groupsCells import get_cells_group, get_cell_side, get_cells_group_adde...
1cdc8799f236a050de908db9dc676d97f56b927690f8434268f559fad8e8622b
Python
47,474
1,251
import numpy as np import pickle as pkl import scipy.sparse import scipy.special from elements import ELEMENTS from h5py import File from matplotlib import pyplot as plt from deprecated.slakos_deprecated.mio_0_1 import ParDict from tfspline import spline_linear_model, Bcond, spline_new_xvals from util import get_datase...
53a652d342f0a2566fc2d9d9694be1906d43ae012f96be8f0d10354727e0258e
Python
47,672
1,166
import copy import warnings from dataclasses import dataclass from typing import Dict, List, Optional import numpy as np import pandas as pd from scipy.optimize import minimize_scalar from scipy.stats import norm from statsmodels.stats.multitest import multipletests from .utils._checks import ( _check_benchmarks,...
7857e6d59ceff818bb1cd303262f2ec9ff278c69fbfc34f6f22680eafa96abf0
Python
47,796
740
import torch as th from torch.nn import functional as F import torch.nn as nn import numpy as np from torchdiffeq import odeint from latentvelo.models.velocity_field import VelocityFieldReg from latentvelo.models.modules import create_encoder, create_decoder, MLP, GCN from latentvelo.utils import normalize, sparse_mx...
57bdaf414ed098be5e86d1b9801dcb53bfd16a11969a83cb25c130d9045e63a3
Python
47,878
1,289
# -*- coding: utf-8 -*- """HiFi-GAN Modules. This code is based on https://github.com/jik876/hifi-gan. """ import copy import logging import numpy as np import torch import torch.nn.functional as F from parallel_wavegan.layers import CausalConv1d, CausalConvTranspose1d from parallel_wavegan.layers import HiFiGANR...
0ffb542ecb21d24d18d377e439fa79f26f5d7bf84c7ab79de606d70795070fb0
Python
47,936
1,293
# IMPORT STATEMENTS import cv2 import re import numpy as np import matplotlib matplotlib.rcParams['pdf.fonttype'] = 42 matplotlib.rcParams['ps.fonttype'] = 42 from matplotlib import pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable, axes_size import matplotlib.patches as patches import matplotlib.co...
79289cf83fb22833ef15ad6e8e97f92276eb92153b3a533e5a2ce7cb0b45c6cf
Python
48,420
1,083
# Copyright (c) OpenMMLab. All rights reserved. from logging import warning from math import ceil, log import torch import torch.nn as nn from mmcv.cnn import ConvModule, bias_init_with_prob from mmcv.ops import CornerPool, batched_nms from mmcv.runner import BaseModule from mmdet.core import multi_apply from ..build...
048b9737bb3e43ae730a71510545764b2af668988291507b8862fadec3500dfc
Python
48,921
1,020
"""This module contains all parts of the unified extractor for diagrams, labels and reaction conditions""" import copy from itertools import product from math import ceil import numpy as np import json import os import re from typing import List, Tuple, Union import warnings import cv2 from matplotlib import pyplot as...
14b09774aafb4126f9bb6d92bbc9eaf9f7e69abc09a0182361c8614b71c50856
Python
49,039
1,014
# -*- coding: utf-8 -*- """ Created on Sun Nov 1 23:15:17 2020 @author: Frank """ ''' Functions for writing and handling h5 files Note: to go back from bytestring to normal string, you have to do x.decode('UTF-8') where x is the byte string representation With this method of working with h5 files, only ...
432e98c2b4985fedecc6eab414f535d49f4c8ded0bf0076595db38e500b59143
Python
49,143
1,244
#! /usr/bin/env libtbx.python # -*- coding: utf-8 -*- # ============================================================================= # Created at: # International Institute of Molecular and Cell Biology in Warsaw, Poland # Author: # Grzegorz Chojnowski - gchojnowski@genesilico.pl, gchojnowski@gmail.com # ===========...
2a3ef2a5a3d36c59b4cf206f4af1738f8e1047ca2850124ab788ad313a43e738
Python
49,353
1,236
#! /usr/bin/env libtbx.python # -*- coding: utf-8 -*- # ============================================================================= # Created at: # International Institute of Molecular and Cell Biology in Warsaw, Poland # Author: # Grzegorz Chojnowski - gchojnowski@genesilico.pl, gchojnowski@gmail.com # ===========...
5bf18220109082ed9bb93274874ab1d1f245637e301a8d34e9e7655f40c3afca
Python
49,355
1,303
__author__ = "Grzegorz Chojnowski" __date__ = "21 Apr 2021" import sys, os, re # it seems that real_space_refinement_simple # supports greedy multiprocessing, that for simple, # and fast single-sc fitting makes no good os.environ["OMP_NUM_THREADS"] = "1" ROOT = os.path.dirname(os.path.realpath(__file__)) impo...
f0d92e427fa8064eef04eb9aa7a539605a634d1b70818b1c9a1f52fdcae597f6
Python
49,460
1,171
# This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed # under the Apache License Version 2.0, see <https://www.apache.org/licenses/> import inspect import warnings from functools import partial from math import ceil from typing import Any, Callable, Dict, Literal, Optional, Union from wa...
2603b6e6c8d4af8552c5ee86171ec42618ce45d4203012c96c65a21b3315ffba
Python
49,689
742
import h5py as h5 import numpy as np import sys import ArgParser as argp from scipy.signal import find_peaks import PatchAnalPlots as pu import spike_utilities as su HEADSTAGE_V={'H1':'_S2_', 'H2':'_S4_'} HV_VAL_KEY={v:k for k,v in HEADSTAGE_V.items()} HEADSTAGE_I={'H1':'_S1_', 'H2':'_S3_'} CURRENT_THRESH=5e-12 #det...
5b09a23926c80091649f4eb43050339be3a9d749d1e6c68b7c0b7b5d301f9b7e
Python
49,795
1,070
############################################ # imports ############################################ import os import shutil import unittest from pathlib import Path from typing import Any import pandas as pd from Bio.SeqUtils import MeltingTemp as mt from effidict import EffiDict, LRUReplacement, PickleBackend from ...
26d05058477836c143a434ec5a47f37db89932aa3995ddc3f3e6dd7d130b15b5
Python
50,409
1,507
#!/usr/bin/python # -*- coding: UTF-8 -*- """ heading.py: Subroutines used in ``example 5: heading dependence``. Some of these routines overlap and will likely be merged in a later clean-up. """ import warnings import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from nump...
0ae5a7d463ede8ab2fb42708a94d367fecbe66d2723664be737e56efe824805d
Python
50,496
1,350
import itertools import numpy as np import os import pickle as pkl import scipy.sparse import scipy.special from elements import ELEMENTS from h5py import File from matplotlib import pyplot as plt from deprecated.slakos_deprecated.mio_0_1 import ParDict from tfspline import spline_linear_model, Bcond, spline_new_xvals ...
b00ca7f2be4390e958f253088cc0414ec988d12eb839bb2f0823d1c70b898f3c
Python
50,671
1,699
import sys import os import re import json import requests from PIL import Image try: from StringIO import StringIO ## for Python 2 except ImportError: from io import StringIO ## for Python 3 import pandas as pd import numpy as np import bitarray import math from matplotlib import pyplot as plt from lifelines i...
e71267db2b5c2f7ca149a6e13f3f2a1cac2589bd72706d7282260b90039dbb53
Python
50,786
1,158
############################################ # imports ############################################ import os import shutil from pathlib import Path from typing import Any import yaml from pydantic import ValidationError from oligo_designer_toolsuite.config.pipelines.oligo_seq_probe_designer import OligoSeqProbeDesi...
ecd4860507c359c6d64dcb382b34d3b385874f7a8b7b5873c719fadd16e55839
Python
50,941
1,303
# This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed # under the Apache License Version 2.0, see <https://www.apache.org/licenses/> import warnings from dataclasses import dataclass from enum import Enum, auto from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union ...
433527059613f2c4958a8b327b56c667ecc8774da4064fa0eaa30db73100abe6
Python
51,045
1,213
# -*- coding: utf-8 -*- """ @author: yaron The function create_data_set(geom_list, data_list, parDict) creates the data needed for the DFTB model. geom_list is a list of Geometry objects data_list is a list of strings specifying data to be returned parDict is the parDict object used by the DFTB class The allowed ...
7a700985daa0a39d964a78234bfe89175e355a04a7a718038276a30903d14505
Python
51,505
1,983
import numpy as np kernel_1_aggregated = np.array( [ [ -0.5936652, -0.06157227, -1.171423, 0.26309013, 0.03982045, -0.87791234, 0.47679257, 4.6908383, -0.16051118, 0.53950083, ...
2f7017f6c05bceccb1e4c43f46f9ceaee59b3fd0b0cc8a49bc20608b9273aff6
Python
51,510
1,345
# This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed # under the Apache License Version 2.0, see <https://www.apache.org/licenses/> import logging import random import warnings from math import pi from pathlib import Path from typing import ( Any, Callable, Dict, List, ...
cbdf8157157dbc6b67f6f944def4c5cadc1dba2ccb791fba1a4d8a45753d802a
Python
51,731
1,717
# Import import configparser import datetime import os import pandas as pd import pathlib import sys import time import threading import queue import random import gc import math from collections import Counter from ffpyplayer.player import MediaPlayer from kivy.app import App from kivy.clock import Clock, mainthread...
91e23a9f11f2e54d1eee69fd9e970af7907b139cf30bf44ee05811f5b4ab67bc
Python
51,865
1,426
# This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed # under the Apache License Version 2.0, see <https://www.apache.org/licenses/> # pyright: reportIncompatibleMethodOverride=true import functools import math from abc import ABC, abstractmethod from dataclasses import dataclass from ...
49844359de78d6dcde5060ab5ac6544c9e6efbe64abaecc93097973e69998510
Python
52,115
866
import torch as th from torch.nn import functional as F import torch.nn as nn import numpy as np from torchdiffeq import odeint, odeint_adjoint from latentvelo.models.velocity_field import VelocityFieldReg from latentvelo.models.modules import create_encoder, MLP, GCN from latentvelo.utils import normalize, sparse_mx...
f21e80ef608ee5b6c3ee1063155794a7382d90e3567ccd05f14b1a960d10c758
Python
52,639
1,065
# Imports # import sys import os import configparser import time import numpy as np import random import csv from kivy.uix.button import Button from kivy.uix.image import Image from kivy.uix.label import Label from kivy.uix.floatlayout import FloatLayout from kivy.uix.behaviors import ButtonBehavior from kivy.clock imp...