sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
5909eb533454493c9d21943adb337f0deb338c51b6bbb9390c551cb50193a39f
Python
19,354
487
# *********************************************************************************** # * Copyright 2010 - 2016 Paulo A. Herrera. All rights reserved. * # * * # * Redistribution and use in source and binary forms, with o...
939d75ae757d7b726a9aff5424c04819df2861333565207b483f0fc328a66a5e
Python
19,371
441
#!/usr/bin/env python # -*- coding: utf-8 -*- # encoding=utf8 from collections import namedtuple import rrc_evaluation_funcs import importlib def evaluation_imports(): """ evaluation_imports: Dictionary ( key = module name , value = alias ) with python modules used in the evaluation. """ retur...
5fa668ce60b4b5df2667d4a38b35b3d25575f10c4e0845e833ab05f1816cfc65
Python
19,374
524
import numpy as np import pandas as pd import os from collections import defaultdict from typing import Union, Tuple, List from statistics.utilities import ( CONFIG, bootstrap_ci, pchip_interpolator, benjamini_hochberg_correct, ) from statistics.clustered_mlp_output_wrappers import ( load_metadata_s...
f4737bcc2a65e010ab587b50ba6e32422faaab0f40d2af0ac1b44dd5142e70dc
Python
19,382
481
# -*- coding: utf-8 -*- """ Created on Wed Oct 12 13:38:23 2022 @author: Daniel """ from phase_to_rate.neural_coding import load_spikes, rate_n_phase, load_spikes_DMK import numpy as np import matplotlib.pyplot as plt import pandas as pd import seaborn as sns import os import sys import matplotlib as mpl import pdb i...
89fdf89014e2d0e75ccee574bf103535b4e23d4062aa2ecd320ab4df3dfb1463
Python
19,417
489
############################################ # imports ############################################ import os import shutil import unittest from abc import abstractmethod from oligo_designer_toolsuite.database import OligoDatabase, ReferenceDatabase from oligo_designer_toolsuite.oligo_specificity_filter import ( ...
2941dd52e3819f79643ec78cd74e8bade6aaf9e22cf6e479a9e123db58d3a05f
Python
19,427
522
# Copyright (c) OpenMMLab. All rights reserved. import math import os import warnings import cv2 import mmcv import numpy as np from matplotlib import pyplot as plt from mmcv.utils.misc import deprecated_api_warning from mmcv.visualization.color import color_val try: import trimesh has_trimesh = True except (...
7989962cd81b6b5a8ae516ccf9326087a1e7a710f7717088c2663545a0aa4386
Python
19,429
481
#!/usr/bin/env python import sys from os import path, chdir, getcwd import json import numpy as np from picrust2.util import (system_call_check, make_output_dir, read_fasta, read_phylip, write_fasta, write_phylip, read_stockholm) def place_seqs_pipeline(study_fas...
fb6849e974ac8c3eda12f8508cab5f5142eec3baee8867e25229d9cb5b28e683
Python
19,442
478
# 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 warnings from pathlib import Path from typing import Mapping, Optional, Tuple, Union import torch from torch import Tensor, nn try...
e8153aeaa6f09604ce4fa74ae24c74eb9139507e3c8c8ddd9b808dbe1833d304
Python
19,443
612
#!/usr/bin/python # -*- coding: UTF-8 -*- import numpy as np from pylab import * def zgrid(W,H=None,): if H is None: H=W cw = arange(W)-W//2 ch = arange(H)-H//2 return 1j*ch[:,None]+cw[None,:] def p2c(p): p = np.array([*p]) if np.any(np.iscomplex(p)): return p which = np.where(int32(p.shap...
db00b9404c411c02b96fab241590acc4fb67b33f55626f9738cfb5568698d7f1
Python
19,485
540
# 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 the hope that it will be usef...
c47e81cc6475145960c2ba9f459afe4eda59f20e64414ca5131e0c102bb14f35
Python
19,511
511
# 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/> """Unit tests for the MoG (Mixture of Gaussians) dataclass.""" from __future__ import annotations import pytest import torch from torch.distributions im...
33f58942fd58297ac0e6460a522670d5d54332fae8754de54f0c4f480d2df9ce
Python
19,521
541
#import warnings #from nengo.exceptions import ValidationError from nengo.params import NumberParam #, IntParam, FrozenObject, Parameter #from nengo.utils.compat import is_iterable, is_string, itervalues import nengo.learning_rules from nengo.synapses import Lowpass import numpy as np from nengo.builder.operator impo...
bf37655d6344db89389d009f4f35b3dada7a6e4c16cbe4d08d5425865da8baa5
Python
19,528
453
# Copyright (c) OpenMMLab. All rights reserved. import warnings import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import Scale from mmcv.runner import force_fp32 from mmdet.core import multi_apply, reduce_mean from ..builder import HEADS, build_loss from .anchor_free_head import AnchorF...
ab0e9b0a888c52d6b44b6c1c6548e2fdd58dd38cb0ab0aa1695c7a05bfecd493
Python
19,564
457
""" Step 2 pattern separation analysis with Pearson's R. Load the raw data, extract phase and rate code and calculate Pearson's R between pairs of input and output patterns. The results are stored in a .csv file. These results are necessary to reproduce Figures 1 & 2. """ from phase_to_rate.neural_coding import load_...
57ac029c3bacf9e124bd364b07e8a3140a9e860212ad995f396d5522eca11f15
Python
19,568
581
# 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 dataclasses import asdict import pytest import torch from torch import eye, ones, zeros from torch.distributions...
f2aa5e688191a5b254246db0eea287856f3e11e13af618ead505e9cb553e4b1a
Python
19,586
648
import pandas as pd import numpy as np import matplotlib.pyplot as plt import tkinter as tk from tkinter import filedialog, messagebox import os import sys def Peri_events_post_processing(): # ------------------------------------------------------------ # SELECT DATA FILES # ------------------...
9ceb902d708d4523d352c5b1f979b1c341c0b2061ebe646d0bea4d1e96577b05
Python
19,594
466
# -*- coding: utf-8 -*- """ Created on Wed Oct 12 13:38:23 2022 @author: Daniel """ from phase_to_rate.neural_coding import load_spikes, rate_n_phase, load_spikes_DMK from phase_to_rate.information_measure import skaggs_information import numpy as np import matplotlib.pyplot as plt import pandas as pd import seaborn ...
ffada61e134b353646e03f92ef2038215aa461cf388ac1aed7c0a17f13bba818
Python
19,594
458
""" Step 2 pattern separation analysis with Pearson's R. Load the raw data, extract phase and rate code and calculate Pearson's R between pairs of input and output patterns. The results are stored in a .csv file. These results are necessary to reproduce Figures 1 & 2. """ from phase_to_rate.neural_coding import load_...
c61f411c468334d94a76d478959e1214713cc6ddf72d015292cfd3a9ef82d089
Python
19,636
499
import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as ticker import pywt import seaborn as sns import pandas as pd from sklearn.metrics import r2_score, mean_squared_error, mean_absolute_error from sklearn.impute import KNNImputer from matplotlib.ticker import MaxNLocator from scipy.signal impo...
08757fda408a8d0604a63d4deffd0847ac5d01d15bf3bda69882a75e5bf623de
Python
19,684
463
import queue import collections import threading import functools import torch import torch.nn.functional as F from torch.nn.modules.batchnorm import _BatchNorm from torch.nn.parallel._functions import ReduceAddCoalesced, Broadcast from torch.nn.parallel.data_parallel import DataParallel __all__ = ['FutureResult',...
edbc6c683b8c7d1488ccb9bdb289c5cb92a75782218cc599b41e15b62af3a389
Python
19,696
605
# (c) 2015-2018 Acellera Ltd http://www.acellera.com # All Rights Reserved # Distributed under HTMD Software License Agreement # No redistribution in whole or part # import parmed import numpy as np from torchmd.forcefields.forcefield import ForceField from torchmd.parameters import Parameters from torchmd.forces impor...
1430f0c464fd9de20abd4102d1a3b20b06410750e8b237f63b9e4155c4c8bdf6
Python
19,720
499
# Copyright (c) OpenMMLab. All rights reserved. import os.path as osp import tempfile import warnings from collections import OrderedDict import json_tricks as json import numpy as np from mmcv import Config, deprecated_api_warning from mmpose.core.evaluation.top_down_eval import keypoint_epe from mmpose.datasets.bui...
91e4373c9b45695dae7b89b4904fa9468aec9035acd87a1d52c381a3309307fb
Python
19,747
467
from math import ceil from scipy.interpolate import PPoly from typing import List, Tuple from util import path_check from util import mpl_default_setting import imageio import matplotlib.pyplot as plt import numpy as np import os import pandas as pd import seaborn as sns HARTREE = 627.50947406 # TODO: SKF.__init__()...
7b0532ec24bd81329b5e39a5c846bde8edc9626600ff43ebbf425eb509457758
Python
19,773
521
# 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 (build_conv_layer, build_norm_layer, build_upsample_layer, constant_init, normal_init) from mmpose.core.evaluation.top_down_eval import ( ...
718d65b10b5c60715b87710d053d8ca7d317a534314823a322d420ccab25448a
Python
19,793
522
import matplotlib matplotlib.use('agg') import os import sys import argparse import h5py import random import numpy as np import matplotlib.pyplot as plt from skimage.transform import resize import torch import torch.utils.data as data import yaml sys.path.insert(0, os.path.abspath(os.path.join(os.getcwd(), "../../../"...
95901caeac0d9a683d23a3741f94b6a5660fd174d930ace279398ca90d1cd853
Python
19,803
453
from plotly.subplots import make_subplots import plotly.graph_objects as go import pandas as pd import numpy as np import scipy import plotly.express as px from app_main.constants import color_types, color_types_title, font_size, marker_size from operations.preprocessing import preprocess from operator import itemgette...
6acacf9b9dcf9ca549b2736bed4e9e14cfd91848c6a99a3f19481d9034b37f15
Python
19,809
396
# permutate confounds (other than 'sex', 'site') with random binary values to test stability ''' 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 ...
33ac63875d41e6f93e00fa2511db9e929f707e0c3fa3285e0e2d29f8b92e0e5c
Python
19,811
427
# Copyright (c) OpenMMLab. All rights reserved. import torch.nn as nn from mmcv.cnn import ConvModule, normal_init from mmcv.ops import DeformConv2d from mmdet.core import multi_apply from ..builder import HEADS, build_loss from .corner_head import CornerHead @HEADS.register_module() class CentripetalHead(CornerHead...
338bc347f9d0160fbaf5ea4781d380045d97ac0557f4001c6c01f4f46bac1a78
Python
19,840
538
# 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 functools import partial from typing import Callable, Dict, List, Optional, Type, Union import torch import torch.nn as nn from torch import Tensor ...
bf99e0633769047fce12c2df09061767918a1cbc788f5b1ec1be3bed9655c3a9
Python
19,850
441
""" This test file contains tests that involve generating synthetic data (using internal functions from powerlaw) and then fitting to make sure we get the expected result. So a full test of most aspects of the library; these tests are meant to ensure that the library works as it would likely be used. That being said, ...
656a99acab2f5c3b2a2362eb9bdfc90163577e228d3f48089f693127c77ec31f
Python
19,857
519
import math from abc import abstractmethod, ABC from typing import Union, Optional, Any, Tuple import eagerpy as ep from eagerpy.astensor import T from .base import MinimizationAttack, raise_if_kwargs, get_criterion, get_is_adversarial from .gradient_descent_base import ( uniform_l1_n_balls, normalize_lp_norm...
124dd1fbbb97c1846a82f941bba3e436addd8bbfe878a0a63ad2d8267a148f4e
Python
19,869
427
# Module containing the genetic algorithms # # Author: Fernando García Gutiérrez # Email: fgarcia@fundacioace.org # import random import pandas as pd import sklearn from sklearn.model_selection import RepeatedKFold, RepeatedStratifiedKFold from deap import creator from deap import base from deap import tools...
afdcbc989142ddb39bf33b81d2e03837e6008c7fa8d634cd1be1df860f763d74
Python
19,900
494
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Dec 30 11:21:33 2021 @author: baris """ import shelve import numpy as np import glob import os import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import copy def load_spikes(grid_seed, network_type, shuffling, pp_weight): t...
9dcc9322e786f35b94304ceed82200a15070dfe92369619fc5a3528f317a5878
Python
19,926
457
# coding=utf-8 # Copyright 2018 The Google AI Language 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/LICEN...
fece7ee3fe1f8befb52ab5cac927cd4d8426d5486db3764bcfc7bdd07974038d
Python
19,926
547
import warnings from nengo.config import SupportDefaultsMixin from nengo.exceptions import ValidationError from nengo.params import ( Default, IntParam, FrozenObject, NumberParam, Parameter, Unconfigurable, NdarrayParam, BoolParam, ) from nengo.synapses import Lowpass, SynapseParam from...
ccd5ea2aec05055a45882b3c80cf2d7d32ba1d4941b00e2a68aab345852a370c
Python
19,955
471
# -*- coding: utf-8 -*- """ Created on Wed Oct 12 13:38:23 2022 @author: Daniel """ from phase_to_rate.neural_coding import load_spikes, rate_n_phase, load_spikes_DMK from phase_to_rate.information_measure import skaggs_information import numpy as np import matplotlib.pyplot as plt import pandas as pd import seaborn ...
cd4a2de8cac4e7c0a7aa9d175f78387f904c2c8db678fa6be30478d13b1b9094
Python
19,965
475
#!/usr/bin/env python3 """ simulate_sv_genome.py -- svaba SV simulator (genome construction + truth set) Generates thousands of NON-OVERLAPPING structural variants spanning the full size range (small indels -> inter-chromosomal rearrangements), applies them to a reference genome to build a diploid DONOR genome (hap1...
e8372c1747b1ac877d3d190a0e3a82441fbc4c9b8eeac32d78f0a9eb2211d905
Python
19,973
494
class QuartetSet(object): def __init__(self): self.quartetLogic = QuartetLogic() self.quartetSet = DualIndexNoDupes() self.closureSet = DualIndexNoDupes() self.conflictingSet = DualIndexNoDupes() self.compatibleSet = DualIndexNoDupes() self.compatibleClosure = DualI...
9948978b47a42ba6e92f27527d82c697d35a7b74a7fa472a965f92f4306fa0d6
Python
19,975
604
# Copyright (c) OpenMMLab. All rights reserved. import copy import tempfile import numpy as np import pytest from mmcv import Config from mmpose.datasets import DATASETS from mmpose.datasets.builder import build_dataset def test_body3d_h36m_dataset(): # Test Human3.6M dataset dataset = 'Body3DH36MDataset' ...
61d4cee63ede11403a3bc7e7dd15d75d08d7adf952b0faf389b7ad1dada43ff3
Python
19,977
526
# -*- coding: utf-8 -*- # # This file is part of the taxopy package, available at: # https://github.com/apcamargo/taxopy # # Taxopy 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...
e3d58b3265056ed73d3e9c96630b9c7b3d804717a4c4dac4228d0679f05b459d
Python
19,980
497
# 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 abc import abstractmethod from pathlib import Path from typing import Any, Callable, Dict, Optional, Self, Tuple, Union from warnings import warn im...
cc4f7290aeb7027fba6c3812878ac62e053c744e3ad7f009d1a3502d36d80262
Python
19,985
516
# Copyright (c) OpenMMLab. All rights reserved. import copy import numpy as np import pycocotools.mask as maskUtils import pytest from mmcv.utils import build_from_cfg from mmdet.core.mask import BitmapMasks, PolygonMasks from mmdet.datasets.builder import PIPELINES def _check_keys(results, results_translated): ...
0f4628e322372bf697301fd44a083a4771786f8cae3e9c86f8b3e96869e1d985
Python
20,023
469
# Copyright (C) 2022-2025 ETH Zurich, Marc Lehner and other DASH contributors. import datetime import pickle import random import os import logging import time from typing import NoReturn import numpy as np import pandas as pd from rdkit import Chem from tqdm import tqdm from collections import defaultdict from sere...
267199c40282569d9a4d7fa315a84565fb8e23fefe095049f52cd3f7a9f990f5
Python
20,023
499
############################################ # imports ############################################ import os import shutil import unittest import pandas as pd from Bio.SeqUtils import MeltingTemp as mt from oligo_designer_toolsuite._exceptions import DatabaseError from oligo_designer_toolsuite.database import Oligo...
86b8adb01565bb7f61b13302bf9285d6fba0962da1a603a989127700ac78d07c
Python
20,031
545
# Copyright (c) OpenMMLab. All rights reserved. import os import os.path as osp import tempfile from collections import OrderedDict, defaultdict import json_tricks as json import numpy as np from mmcv import deprecated_api_warning from ....core.post_processing import oks_nms, soft_oks_nms from ...builder import DATAS...
033fa67465bc7b1fbe5af4af56348644479da7007a846750ac624492cf6bebf1
Python
20,035
588
import torch import csv import os import shutil import sys import json import time # import matlab # import matlab.engine import numpy as np import torch.nn as nn import matplotlib.pyplot as plt from numpy import random from scipy import stats from skimage import img_as_float from skimage.metrics import structural_simi...
ffdb96ab56a087c86398fd99ce6a74d49a4e33087ee69c56c4b46d836ac7601c
Python
20,045
424
from fold import * from model_v0 import * from util import get_sha256 from deprecated.solver_v1 import Solver from sklearn.model_selection import ParameterGrid from sklearn.linear_model import LinearRegression class GridSearchCV: def __init__(self, dataset_path, gammas_path, target_type, param_g...
645a54455d4238afd731048813023cfda2080217133acf6f3725e3515bb6d534
Python
20,048
572
# Copyright (c) OpenMMLab. All rights reserved. import copy as cp import torch.nn as nn from mmcv.cnn import (ConvModule, DepthwiseSeparableConvModule, Linear, build_activation_layer, build_conv_layer, build_norm_layer, build_upsample_layer, constant_init, ...
2ed27563e016ebbb1a7e26b5b635994dc30d449df43631782902f21bb0ceb766
Python
20,068
464
# 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 abc import ABC from typing import ( Any, ClassVar, Dict, Literal, Optional, Self, Sequence, Tuple, ...
cf534482df530d3bc3768be9368c9943fe461d92c87f737a906b05ed6e33db49
Python
20,116
494
# -*- coding: utf-8 -*- """ Created on Mon Jul 5 12:07:56 2021 @author: fhu14 """ #%% Imports, definitions import re from Elements import ELEMENTS import numpy as np import numbers from MasterConstants import valence_dict from typing import List, Dict Array = np.ndarray #%% Code behind def named_re(name: str, re...
b7f0dc75495c2cf92e14ed14a5edc7bff63e26fe804cb44693b7479f246d9fa8
Python
20,130
408
import os import torch from collections import OrderedDict from abc import ABC, abstractmethod from . import networks class BaseModel(ABC): """This class is an abstract base class (ABC) for models. To create a subclass, you need to implement the following five functions: -- <__init__>: ...
1fc2df2dc1910b6b36a51b78985b62611f2b14a53f4d0ac0b1383eb6e02b733c
Python
20,189
501
# Imports # import kivy import zipimport import sys import os import configparser import time import numpy as np import random import csv from kivy.app import App from kivy.uix.widget import Widget from kivy.uix.button import Button from kivy.uix.image import Image from kivy.uix.label import Label from kivy.uix.floatla...
668a22f0c8d59312ff040aa85be53e383c935360403cce16653a6c02f2efc67c
Python
20,208
621
""" Multi-panel figure for arousal detection analysis on MASS dataset. This script creates a publication figure combining: 1. Arousal detection performance metrics at different temporal resolutions 2. Sleep stage distribution during detected arousals 3. Example recording visualization with EEG, spectrogram, and predic...
c0c83e6ca264c15bb08d3ff3a0cc723bf782fc93e85d07f77c55658eae1a7d65
Python
20,222
623
""" Tutorial 01: Linear Models ========================================= In this tutorial you will set up your first linear model with BrainStat. To this end, we will first load some sample data from the MICS dataset. """ from brainstat.datasets import fetch_mask, fetch_template_surface from brainstat.tutorial.utils...
bcdb3621009304eba949f2a50f15f988d8d1d8bc23171177b7f7bab1df66fbcc
Python
20,236
609
# Copyright Universitat Pompeu Fabra 2020-2023 https://www.compscience.org # Distributed under the MIT License. # (See accompanying file README.md file or copy at http://opensource.org/licenses/MIT) from abc import abstractmethod, ABCMeta from typing import Optional import torch from torch import nn from torchmdnet.m...
17e51c012c6d48cb3b5673dbabe5d6f6eef24eff5c9ed831b04df7c0280452de
Python
20,276
405
import argparse import sys import os import subprocess as sb from sympy import * from mpmath import * import numpy as np import re class UMIException(Exception): pass #def dedupUMIs(fastq,fastq_out,head_to_trim_seq,tail_to_trim_seq): def dedupUMIs(args,parser): if not os.path.isfile(args.fastq): raise...
471f5fbbf92ad5855d54362a41fc2a81e8e68ea47c36038fab20a2864d9e0bce
Python
20,282
462
import ontotextapi as onto import utils import json from os.path import isfile, join, split import joblib as jl import cohortanalysis as cohort from ann_post_rules import AnnRuleExecutor import sys import xml.etree.ElementTree as ET import concept_mapping import urllib3 import logging class StudyConcept(object): ...
dcf91185663924a40a749d635121508709496032c1559a44bdf680501247e38c
Python
20,288
554
#import warnings #from nengo.exceptions import ValidationError from nengo.params import NumberParam #, IntParam, FrozenObject, Parameter #from nengo.utils.compat import is_iterable, is_string, itervalues import nengo.learning_rules from nengo.synapses import Lowpass import numpy as np from nengo.builder.operator impo...
20f89354ea2c510e91e3da90cfafa3320c61b94aabbeb2cca0b8f11e3131c270
Python
20,292
539
#EEG MODELS: Introducing 5 Branches #---------------------------- import model from tensorflow.keras import backend as K from tensorflow.keras.constraints import max_norm from tensorflow.keras.layers import BatchNormalization from tensorflow.keras.layers import Conv2D, MaxPooling2D, AveragePooling2D from te...
2da989609ba5a1cb01076575663b2b9b3c380edf00929235cfbb6ab000cafea6
Python
20,334
478
import torch from math import sqrt import numpy as np class Parameters: def __init__( self, ff, mol, terms=None, precision=torch.float, device="cpu", ): self.nonbonded_params = None self.bond_params = None self.charges = None self...
60ed23d1317ca0394f71f6bfa444073ff7ec4e62fcfcc333afb1cc550b761bbb
Python
20,344
408
# -*- coding: utf-8 -*- """ Created on Tue Jun 8 18:50:46 2021 @author: fhu14 TODO: Fix the link with DFTBrepulsive when everything's up """ #%% Imports, definitions import torch Tensor = torch.Tensor from typing import List, Dict import numpy as np Array = np.ndarray from MasterConstants import Model from Spline im...
1fae6d8ea66993568400cc04eaae1df7acf09e4c1b47b6c752b79916e2eff1f5
Python
20,423
502
# Copyright (c) OpenMMLab. All rights reserved. import copy import os import os.path as osp import warnings from argparse import ArgumentParser import cv2 import mmcv import numpy as np from mmpose.apis import (collect_multi_frames, extract_pose_sequence, get_track_id, inference_pose_lifter_m...
c684e7042aa9ef9b8ad19b883547ff96ec37e31dc16f44da2a9e14f259085e09
Python
20,445
532
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Mar 3 20:54:08 2021 @author: ravinderjit This script averages mcBTRFs across subjects and does a PCA analysis to get a sBTRF. Also comparison with behavior """ import os import pickle import numpy as np import mne import matplotlib.pyplot as plt impor...
88b47f2ae3577f45b7841bb912e5d7f52722f045c38d9c1392c7d85dbf59f55b
Python
20,447
498
# 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 typing import Callable, List, Optional, Tuple, Union import torch from torch import Tensor from torch.distributions import Distribut...
557d82ec567a8de5bd91feb571652ed8740a4af51ebe377a9b6e115fc20f9d3b
Python
20,474
421
from functools import partial from typing import Dict, List, Tuple, Union import torch from torch.nn import CrossEntropyLoss, Module, ModuleDict, MSELoss from torchmetrics import MeanAbsoluteError, PearsonCorrCoef, SpearmanCorrCoef from selbstaufsicht import transforms from selbstaufsicht.models.self_supervised.msa.t...
92ebd13250f94b0ceca9cf1f2fcea8060a2fa228baf833bdfb3112d71ced4ebe
Python
20,478
516
from typing import Optional from math import sqrt from inspect import signature import torch from tqdm import tqdm from torch_geometric.data import Data from torch_geometric.nn import MessagePassing from torch_geometric.utils import to_networkx """This is pyg 2.0.3 code for GNNExplainer made to work on pytorch-geome...
f7fb84fe8bd69c1a7213ec8be3c4a54ae634208e410167b78d135d1e105f9eae
Python
20,485
529
from __future__ import annotations import copy from typing import Any, List, Mapping, Optional, Set # import glob import networkx as nx import os from pathlib import Path from networkx.classes.reportviews import NodeView import zipfile from . import _checksum_validator from ._archive_parser import ( Config, Parse...
a37a352f9b8e97bc9f1e616d8f991de0fb964d02485dc61f2701441703ca0127
Python
20,496
664
import os import os.path as osp import shutil import copy import time import pprint import numpy as np import torch import matplotlib import argparse import json import yaml from easydict import EasyDict as edict from .model_zoo import get_model ############ # cfg_bank # ############ def cfg_solvef(cmd, root): i...
31a135cdd6e47746c1c901eee7bb3910431af854158c023db0ef060a81ec8640
Python
20,516
664
import os import os.path as osp import shutil import copy import time import pprint import numpy as np import torch import matplotlib import argparse import json import yaml from easydict import EasyDict as edict from .model_zoo import get_model ############ # cfg_bank # ############ def cfg_solvef(cmd, root): i...
35ab64367c575c24d4688fb737eb38346604d0febb15e0c5e941b694c80ec241
Python
20,521
583
# Copyright (c) OpenMMLab. All rights reserved. import os.path as osp import mmcv import numpy as np import pycocotools.mask as maskUtils from mmdet.core import BitmapMasks, PolygonMasks from ..builder import PIPELINES try: from panopticapi.utils import rgb2id except ImportError: rgb2id = None @PIPELINES.r...
121b131dec1ad9df0502d41448024025029837f22de38470c2de933d443f279e
Python
20,554
549
import torch import torch.distributed as dist from torchvision import transforms as tvtrans import os import os.path as osp import time import timeit import copy import json import pickle import PIL.Image import numpy as np from datetime import datetime from easydict import EasyDict as edict from collections import Ord...
53893c29e891e7c00953421477e09c6070d82977ce2f7c9f132f77632ec58470
Python
20,554
423
import pandas as pd import numpy as np import geopandas as gpd import os from pathlib import Path import matplotlib.pyplot as plt from B_preprocess import b101_load_cleaned from B_preprocess import b50_yield_data_analysis from B_preprocess import b100_load import pymannkendall as mk import matplotlib.ticker as mticker ...
541234eca16415b0812a08eadd956aeea4ea4a3bcecfbeadd98b4c58d9c4b1c9
Python
20,604
456
# -*- coding: utf-8 -*- import ast import difflib import itertools import collections import numpy as np from spacy import load from spacy.matcher import Matcher from spacy.pipeline import EntityRuler from .captions import lists from .utilities import files from .captions import interpret as interpret from .captions ...
eb86e788f74d92618eb947bce941adc610f3a623265e14fd53284eb0cfa15dbb
Python
20,629
402
from GUI_and_data_processing.Data_processing import analyse_Ethovision_data from Root_Morales_lab_codes.FibPhoEpocAveraging import FiPhoEpocAveraging from tdt import StructType import pandas as pd import numpy as np import matplotlib.pyplot as plt import os def find_lists_of_events(inputs): inputs['...
9f3d690467a779a5c583afb7d8967324878108a6658f7f34c3ae64bbad225fdd
Python
20,654
480
############################################ # imports ############################################ from Bio.Seq import Seq from Bio.SeqUtils import MeltingTemp, gc_fraction from seqfold import dg from oligo_designer_toolsuite._exceptions import ConfigurationError from oligo_designer_toolsuite.utils import cast_to_li...
04c8d6f28066f668dbab0c6f72ca2fe5e151bb6e32b86b8b11ed59a24f16ef48
Python
20,671
509
# *********************************************************************************** # * Copyright 2010 - 2016 Paulo A. Herrera. All rights reserved. * # * * # * Redistribution and use in source and binary forms, with o...
53beaca9d335af741add25580b64bbca4a96d68c13e802dd64845e3708aa514a
Python
20,692
541
# 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 copy import deepcopy from typing import ( Callable, Dict, Iterable, Optional, TypeVar, Union, ) import torch from torch impo...
7667083549ed8e59ec2fc99cabfb171629207b17a2c65391943fccff0aa29a16
Python
20,714
602
# Copyright 2021 Tomoki Hayashi # MIT License (https://opensource.org/licenses/MIT) """StyleMelGAN Modules.""" import copy import logging import numpy as np import torch import torch.nn.functional as F from parallel_wavegan.layers import PQMF, TADEResBlock from parallel_wavegan.models import MelGANDiscriminator as...
6ba290f525de29cf5cff2bb4387be220119c9b0330254dc6dfb039a08cd33b5b
Python
20,724
509
# Copyright (c) OpenMMLab. All rights reserved. from multiprocessing import Pool import mmcv import numpy as np from mmcv.utils import print_log from terminaltables import AsciiTable from .bbox_overlaps import bbox_overlaps from .class_names import get_classes def average_precision(recalls, precisions, mode='area')...
aca8ea4b381230b19a6c4bc0cdde694e8bec1145e2ce93cb171565ff4cfb2617
Python
20,726
581
import copy import pickle import numpy as np import torch import torch.utils.data as data from PIL import Image from torchvision import transforms from torchvision.datasets import DatasetFolder from torchvision.datasets import MNIST, EMNIST, CIFAR10 IMG_EXTENSIONS = ('.jpg', '.jpeg', '.png', '.ppm', '.bmp', '.pgm', '...
5a9d7331bb503d1be98a09978e9b632b00a88defe852492b881665050c9e142a
Python
20,735
512
from typing import Annotated, Literal from pydantic import ( AliasChoices, BaseModel, ConfigDict, Field, NonNegativeInt, NonPositiveInt, PositiveInt, model_serializer, model_validator, ) from typing_extensions import Self class General(BaseModel): model_config = ConfigDict(ext...
4f14f60ca9284ee6b4c5e5c9cacea910fcf250fecad20aa6108a072ffcdb3dc6
Python
20,762
571
from os.path import join, exists from matplotlib.ticker import FormatStrFormatter from sklearn.metrics import confusion_matrix, precision_recall_curve from paper_analysis.plot_utils import plot_confusion_matrix from file_browser import get_models import pandas as pd from matplotlib import pyplot as plt import os from ...
fdf0f9cc5f04cae7aaacbe45686ab222d25ea50f4ed27064db00650be2dd2126
Python
20,844
492
# Copyright (c) OpenMMLab. All rights reserved. import torch import torch.nn as nn from mmcv.cnn import ConvModule, Scale from mmcv.runner import force_fp32 from mmdet.core import (anchor_inside_flags, build_assigner, build_sampler, images_to_levels, multi_apply, reduce_mean, unmap) from ..buil...
246781f5c75316369b47365f315b6cf050ead70d234630d64cf2a25994b65c78
Python
20,845
601
import itk import math import numpy as np from usqc.data import get_files import usqc.phantom import json from usqc.util import clamped_region from glob import glob import usqc.phantom import usqc.data import pickle import matplotlib.pyplot as plt import scipy.optimize from scipy.signal import find_peaks from scipy.int...
6ba63bf5abd4800fe92e8d7d8986777534ab32018f0ade03c66291f4ff74a669
Python
20,866
709
''' Author: ---- Date: 2022-04-08 11:09:07 LastEditors: GhMa LastEditTime: 2022-10-02 19:26:00 ''' import torch import torch.nn as nn from .snn_modules import tdLayer, BN, Seq2ANN def reset_snn(net: nn.Module): for m in net.modules(): if hasattr(m, '_reset'): m._reset() # blocks ############...
66b38b651d7161d2e1d90af9f792d2dea39c8e4d02a9162f2b1a15449687089d
Python
20,878
490
# Copyright (c) OpenMMLab. All rights reserved. import math import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import (ConvModule, DepthwiseSeparableConvModule, bias_init_with_prob) from mmcv.ops.nms import batched_nms from mmcv.runner import force_fp32 from mmdet.c...
b321eff938fda7b81ae50540112e1c17247076daeff31f6548c165009ca0f5cf
Python
20,878
531
import torch import torch.testing as testing import pytest from selbstaufsicht.modules import Accuracy, EmbeddedJigsawAccuracy, EmbeddedJigsawLoss, SigmoidCrossEntropyLoss, BinaryFocalLoss, DiceLoss, BinaryPrecision, BinaryRecall, BinaryF1Score, BinaryConfusionMatrix, BinaryMatthewsCorrelationCoefficient from selbstau...
f6f7448e474fecf47e179b406a1d278e1f0741dbf073d587f562be253bfb77aa
Python
20,891
607
# Copyright (c) OpenMMLab. All rights reserved. import math from functools import partial import torch import torch.nn as nn import torch.nn.functional as F from ..builder import LOSSES from ..utils.realnvp import RealNVP @LOSSES.register_module() class RLELoss(nn.Module): """RLE Loss. `Human Pose Regressi...
4f5f0706f0081652338618827ce247a0c89412373731b43559122ba9c93b1f71
Python
20,892
635
# -*- coding: utf-8 -*- """ Contains the primary functions for conducting similarity network fusion workflows. """ import numpy as np from scipy.spatial.distance import cdist from scipy import sparse, stats from sklearn.utils.validation import (check_array, check_symmetric, check_...
6f0c4e682003501a82526f2132f5d5b5cc6b8f4dd3c89ee746dbc3d254a93b9a
Python
20,920
530
# Copyright (c) OpenMMLab. All rights reserved. import copy import os.path as osp import cv2 import numpy as np import pytest import xtcocotools from xtcocotools.coco import COCO from mmpose.datasets.pipelines import BottomUpGenerateHeatmapTarget # noqa from mmpose.datasets.pipelines import (BottomUpGenerateOffsetTa...
6a685c62f1bffb7a2ed3cd95a69d5cdcfb049aba16ebe35fb3131ffd475b3270
Python
20,993
587
""" YL The nobiko_opt.neko names are for the LSTM options: Maru - CRNN Haku - CRNN Pixel - CNN only Requires util.restnet_3d.py for the 3D resnet. """ import torch import torch.nn as nn import util.resnet_3d as tora_3dresnet class Maru(nn.Module): def __init__(self, tora_opt): super().__init__() ...
05ef7dd083d5e75a1cbdddce946fc87f461aa5e22d07fa9425283d9d5c046081
Python
21,060
487
#!/usr/bin/env python3 """ mcnemar_inception.py ──────────────────── McNemar's test comparing MVLM against a faithful reimplementation of InceptionDTA's multi-scale inception CNN architecture on the KIBA benchmark. InceptionDTA reference: Kalemati et al., Heliyon 2025, doi:10.1016/j.heliyon.2025.e42476 Why a reim...
892071fe99a1577b7e3015744b1fe77c3999ec7fd88c2ab0ee5ace23707d7b14
Python
21,074
515
# coding: utf-8 """Callbacks library.""" from collections import OrderedDict from dataclasses import dataclass from functools import partial from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Tuple, Union from .basic import ( Booster, EvalResult, _ConfigAliases, _log_info, _log...
bb1f30f963d0dcf339f973298540b3710a89d8e1a7715e0bb234062838961d7d
Python
21,111
605
import json from html import escape from typing import Any import numpy as np from .ambiguity import is_nucleotide_alphabet def _to_list(values: Any) -> list: if values is None: return [] if isinstance(values, np.ndarray): return values.tolist() return list(values) def _site_class_valu...
6eff3f2876e4bafd4a15941aa253aba34da03f448690cef4ea18d7ff2a21e31b
Python
21,117
595
# 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 typing import Dict, Optional, Sequence, Union import torch from torch import Tensor, float32 from torch.distributions import ( B...
b471b564e3c56474941dccd6bd827d942990a4a38211ebc295c2a30a87ff2b8c
Python
21,126
599
import os import os.path as osp import PIL from PIL import Image from pathlib import Path import numpy as np import numpy.random as npr import torch import torchvision.transforms as tvtrans from lib.cfg_helper import model_cfg_bank from lib.model_zoo import get_model from lib.model_zoo.ddim_dualcontext import DDIMSamp...
bdbbe9845a0adac8ba0a336c8cee8aaff327a6845c12945a1d24efd162eb3321
Python
21,179
551
from p4.p4exceptions import P4Error from p4.tree import Tree import p4.nexus from p4.var import var import os import string import io import copy import math import sys class PosteriorSamples(object): """A container for mcmc samples from files. This would be useful if you wanted to do eg posterior predictiv...
961e84e5acce0c85530ba284dd693f4212ca1fcd82760f354f58b7d09b7b55f3
Python
21,181
382
"""Deep Hebbian Predictive Coding networks. """ import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1.inset_locator import inset_axes import numpy as np import os import torch import torch.nn as nn class pclayer(nn.Module): def __init__(self, layer_size, nextlayer_size, i_rate, device, l_rate): ""...
6733679aed9a3362d43c874c5b68de6d45b5df3bbd010e7b5290bb8ff7b56e12
Python
21,205
591
import copy import numpy as np import pytest import torch from mmdet.core import GeneralData, InstanceData def _equal(a, b): if isinstance(a, (torch.Tensor, np.ndarray)): return (a == b).all() else: return a == b def test_general_data(): # test init meta_info = dict( img_s...
7a019af15211eea37bb0f92060ba75f1b6c1ae0fbfa3270598d383e4fe279390
Python
21,258
455
import torch from torch import nn from .perception_loss import vgg16_feat, perceptual_loss from .base_model import BaseModel from . import networks # from parse_config import ConfigParser # import parse_config import numpy as np class DadganModelG(BaseModel): """ This class implements the generator model only, f...